Skip to content

Commit

Permalink
Final adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
gabfssilva committed Jan 23, 2024
1 parent 60c7102 commit 9e25f3d
Show file tree
Hide file tree
Showing 11 changed files with 112 additions and 190 deletions.
52 changes: 1 addition & 51 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,56 +24,6 @@ permissions:

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Assembly
uses: gradle/gradle-build-action@v2
with:
arguments: assemble sourcesJar javadocJar --parallel --stacktrace

- name: Sign & publish to Maven Central
uses: gradle/gradle-build-action@v2
env:
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_SECRET_FILE: ${{ secrets.SIGNING_SECRET_FILE }}
RELEASER_NEXUS2_USERNAME: ${{ secrets.RELEASER_NEXUS2_USERNAME }}
RELEASER_NEXUS2_PASSWORD: ${{ secrets.RELEASER_NEXUS2_PASSWORD }}
with:
arguments: assemble sourcesJar javadocJar signAllPublications publishJvmArtifacts publishLinuxArtifacts publishJsArtifacts --stacktrace

windows-release:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Assembly
uses: gradle/gradle-build-action@v2
with:
arguments: assemble sourcesJar javadocJar --parallel --stacktrace

- name: Sign & publish to Maven Central
uses: gradle/gradle-build-action@v2
env:
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_SECRET_FILE: ${{ secrets.SIGNING_SECRET_FILE }}
RELEASER_NEXUS2_USERNAME: ${{ secrets.RELEASER_NEXUS2_USERNAME }}
RELEASER_NEXUS2_PASSWORD: ${{ secrets.RELEASER_NEXUS2_PASSWORD }}
with:
arguments: assemble sourcesJar javadocJar publishWindowsArtifacts publish --stacktrace

macos-release:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -96,4 +46,4 @@ jobs:
RELEASER_NEXUS2_USERNAME: ${{ secrets.RELEASER_NEXUS2_USERNAME }}
RELEASER_NEXUS2_PASSWORD: ${{ secrets.RELEASER_NEXUS2_PASSWORD }}
with:
arguments: assemble sourcesJar javadocJar publishOSXArtifacts publish --stacktrace
arguments: assemble sourcesJar javadocJar signAllPublications publish --stacktrace
55 changes: 54 additions & 1 deletion .github/workflows/test-module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,23 @@ on:
containers:
required: false
type: string
linux:
required: false
type: boolean
default: true
windows:
required: false
type: boolean
default: false
osx:
required: false
type: boolean
default: false

jobs:
run:
linux-test:
name: ${{ inputs.module }} module
if: ${{ inputs.linux }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -33,3 +46,43 @@ jobs:
uses: gradle/gradle-build-action@v2
with:
arguments: ${{ inputs.path }}:test
windows-test:
name: ${{ inputs.module }} module
if: ${{ inputs.windows }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check
run: ls -lh
- name: Run docker-compose
if: ${{ inputs.containers }}
run: docker compose up ${{ inputs.containers }} -d
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Run tests
uses: gradle/gradle-build-action@v2
with:
arguments: ${{ inputs.path }}:test
osx-test:
name: ${{ inputs.module }} module
if: ${{ inputs.osx }}
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Check
run: ls -lh
- name: Run docker-compose
if: ${{ inputs.containers }}
run: docker compose up ${{ inputs.containers }} -d
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Run tests
uses: gradle/gradle-build-action@v2
with:
arguments: ${{ inputs.path }}:test
6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ jobs:
with:
module: River Core
path: :core
windows: true
linux: true
osx: true

amqp:
uses: ./.github/workflows/test-module.yml
Expand Down Expand Up @@ -90,6 +93,9 @@ jobs:
with:
module: Formats (JSON, CSV, Positional Flat Line)
path: :connector:connector-format
windows: true
linux: true
osx: true

ftp:
uses: ./.github/workflows/test-module.yml
Expand Down
93 changes: 4 additions & 89 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ subprojects {
apply(plugin = "signing")
apply(plugin = "com.google.osdetector")

version = "1.0.0-alpha13"
version = rootProject.libs.versions.river.get()
group = "com.river-kt"

kotlin {
Expand Down Expand Up @@ -107,7 +107,7 @@ subprojects {
pluginManager.withPlugin("com.android.library") {
extensions.configure<AndroidExtension> {
namespace = "com.river"
compileSdk = 30
compileSdk = rootProject.libs.versions.android.compile.sdk.get().toInt()
}
}

Expand Down Expand Up @@ -191,35 +191,6 @@ subprojects {
email.set("[email protected]")
}
}

// withXml {
// asNode().appendNode("dependencies").apply {
// val dependencies = configurations.asMap["api"]?.dependencies ?: emptySet()
//
// for (dependency in dependencies) {
// appendNode("dependency").apply {
// appendNode("groupId", dependency.group)
// appendNode("artifactId", dependency.name)
// appendNode("version", dependency.version)
//
// val excludeRules =
// if (dependency is ModuleDependency) dependency.excludeRules
// else emptySet()
//
// if (excludeRules.isNotEmpty()) {
// appendNode("exclusions").apply {
// appendNode("exclusion").apply {
// excludeRules.forEach { excludeRule ->
// appendNode("groupId", excludeRule.group)
// appendNode("artifactId", excludeRule.module)
// }
// }
// }
// }
// }
// }
// }
// }
}
}
}
Expand All @@ -240,64 +211,14 @@ subprojects {
dependsOn(tasks.withType<Sign>())
}

onWindows {
val publishWindowsArtifacts by tasks.registering {
dependsOn(
tasks
.withType<PublishToMavenRepository>()
.filter { it.name.contains("mingw", ignoreCase = true) }
)
}
}

onMacOS {
val publishOSXArtifacts by tasks.registering {
val appleOs = listOf("ios", "macos", "watchos", "tvos")

dependsOn(
tasks
.withType<PublishToMavenRepository>()
.filter { p ->
appleOs.any { p.name.contains(it, ignoreCase = true) }
}
)
}
}

onLinux {
val publishJvmArtifacts by tasks.registering {
dependsOn(
tasks
.withType<PublishToMavenRepository>()
.filter { it.name.contains("jvm", ignoreCase = true) }
)
}

val publishLinuxArtifacts by tasks.registering {
dependsOn(
tasks
.withType<PublishToMavenRepository>()
.filter { it.name.contains("linux", ignoreCase = true) }
)
}

val publishJsArtifacts by tasks.registering {
dependsOn(
tasks
.withType<PublishToMavenRepository>()
.filter { it.name.contains("js", ignoreCase = true) }
)
}
}

signing {
useInMemoryPgpKeys(signingKeyId, signingSecretKey, signingPassword)
sign(publishing.publications)
}

tasks.withType<PublishToMavenRepository>().configureEach {
tasks.withType<AbstractPublishToMaven>().configureEach {
skipExamples()
dependsOn(tasks.withType<Sign>())
dependsOn(signAllPublications)
}

tasks.withType<AbstractDokkaTask>().configureEach {
Expand All @@ -311,12 +232,6 @@ subprojects {
}
)
}

// tasks.javadoc {
// if (JavaVersion.current().isJava9Compatible) {
// (options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
// }
// }
}

fun Task.skipExamples() {
Expand Down
28 changes: 28 additions & 0 deletions connectors/format/positional-flat-line/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
plugins {
alias(libs.plugins.android)
}

kotlin {
linuxX64()
linuxArm64()

mingwX64()

js(IR) {
browser()
nodejs()
}

androidTarget {
publishLibraryVariants("release", "debug")
}

macosArm64()
macosX64()

iosArm64()

tvosArm64()

watchosArm64()
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.river.core.ExperimentalRiverApi
import com.river.core.lines
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map
import java.time.LocalDate
import kotlinx.datetime.LocalDate

@ExperimentalRiverApi
data class Field<T>(
Expand Down
4 changes: 3 additions & 1 deletion core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ kotlin {
nodejs()
}

androidTarget()
androidTarget {
publishLibraryVariants("release", "debug")
}

macosArm64()
macosX64()
Expand Down
9 changes: 0 additions & 9 deletions core/src/commonMain/kotlin/com/river/core/FlowByteArrayExt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,6 @@ package com.river.core
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map

//import java.nio.ByteBuffer

/**
* Converts the [Flow] of [ByteArray] to a [Flow] of [ByteBuffer].
*
* @return A new [Flow] of [ByteBuffer] converted from the original [Flow] of [ByteArray].
*/
//fun Flow<ByteArray>.asByteBuffer(): Flow<ByteBuffer> = map { ByteBuffer.wrap(it) }

/**
* Converts the [Flow] of [ByteArray] to a [Flow] of [String].
*
Expand Down
38 changes: 0 additions & 38 deletions core/src/commonMain/kotlin/com/river/core/FlowStringExt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.onCompletion

//import java.nio.ByteBuffer
//import java.nio.charset.Charset

/**
* Splits and buffers the [Flow] of [String] based on the provided delimiter, emitting each piece as a separate element in the resulting [Flow].
*
Expand Down Expand Up @@ -78,38 +75,3 @@ fun Flow<String>.splitEvery(
* ```
*/
fun Flow<String>.lines() = splitEvery("\n")
//
///**
// * Converts the [Flow] of [String] to a [Flow] of [Byte] using the specified [charset].
// *
// * @param charset The [Charset] to use for converting the strings to bytes. Defaults to the system's default charset.
// *
// * @return A new [Flow] of [Byte] converted from the original [Flow] of [String].
// */
//fun Flow<String>.asBytes(
// charset: Charset = Charset.defaultCharset()
//) = asByteArray(charset)
// .map { it.toList() }
// .flattenIterable()
//
///**
// * Converts the [Flow] of [String] to a [Flow] of [ByteArray] using the specified [charset].
// *
// * @param charset The [Charset] to use for converting the strings to byte arrays. Defaults to the system's default charset.
// *
// * @return A new [Flow] of [ByteArray] converted from the original [Flow] of [String].
// */
//fun Flow<String>.asByteArray(
// charset: Charset = Charset.defaultCharset()
//): Flow<ByteArray> = map { it.toByteArray(charset) }
//
///**
// * Converts the [Flow] of [String] to a [Flow] of [ByteBuffer] using the specified [charset].
// *
// * @param charset The [Charset] to use for converting the strings to byte buffers. Defaults to the system's default charset.
// *
// * @return A new [Flow] of [ByteBuffer] converted from the original [Flow] of [String].
// */
//fun Flow<String>.asByteBuffer(
// charset: Charset = Charset.defaultCharset()
//): Flow<ByteBuffer> = map { ByteBuffer.wrap(it.toByteArray(charset)) }
Loading

0 comments on commit 9e25f3d

Please sign in to comment.