diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b190252..ae33165 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,13 +8,6 @@ on: branches: - '*' -env: - ORG_GRADLE_PROJECT_NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} - ORG_GRADLE_PROJECT_NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} - ORG_GRADLE_PROJECT_SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} - ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.SIGNING_KEY }} - ORG_GRADLE_PROJECT_SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} - jobs: build-on-macos: @@ -70,30 +63,30 @@ jobs: path: | ~/.android/avd/* ~/.android/adb* - key: avd-35 + key: avd-36 - name: Create AVD and Generate Snapshot for Caching if: steps.avd-cache.outputs.cache-hit != 'true' uses: reactivecircus/android-emulator-runner@v2 with: - api-level: 35 + api-level: 36 target: google_apis arch: x86_64 profile: pixel_6 - emulator-build: 13373845 + emulator-build: 13701740 force-avd-creation: false emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true script: echo "Generated AVD snapshot for caching." - - name: Run Android 15 Instrumented Tests + - name: Run Android 16 Instrumented Tests uses: reactivecircus/android-emulator-runner@v2 with: - api-level: 35 + api-level: 36 target: google_apis arch: x86_64 profile: pixel_6 - emulator-build: 13373845 + emulator-build: 13701740 force-avd-creation: false emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true @@ -239,7 +232,7 @@ jobs: target: default arch: x86_64 profile: pixel_2 - emulator-build: 13373845 + emulator-build: 13701740 force-avd-creation: false emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true @@ -252,7 +245,7 @@ jobs: target: default arch: x86_64 profile: pixel_2 - emulator-build: 13373845 + emulator-build: 13701740 force-avd-creation: false emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3549dae..ea5c9a9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,11 +4,11 @@ on: workflow_dispatch: env: - ORG_GRADLE_PROJECT_NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} - ORG_GRADLE_PROJECT_NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} - ORG_GRADLE_PROJECT_SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} - ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.SIGNING_KEY }} - ORG_GRADLE_PROJECT_SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} + ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }} jobs: @@ -84,7 +84,7 @@ jobs: run: ./gradlew :sqllin-dsl:mingwX64MainKlibrary - name: Publish to MavenCentral - run: ./gradlew :sqllin-driver:publishMingwX64PublicationToMavenRepository && ./gradlew :sqllin-dsl:publishMingwX64PublicationToMavenRepository + run: ./gradlew :sqllin-driver:publishMingwX64PublicationToMavenCentralRepository && ./gradlew :sqllin-dsl:publishMingwX64PublicationToMavenCentralRepository build-on-linux: runs-on: ubuntu-latest diff --git a/CHANGELOG.md b/CHANGELOG.md index dade522..1dfb3cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,24 @@ - Date format: YYYY-MM-dd +## 1.4.4 / 2025-07-07 + +### All + +* Update `Kotlin`'s version to `2.2.0` + +### sqllin-dsl + +* Update `kotlinx.serialization`'s version to `1.9.0` + +### sqllin-driver + +* Update the `sqlite-jdbc`'s version to `3.50.2.0` + +### sqllin-processor + +* Update `KSP`'s version to `2.2.0-2.0.2` + ## v1.4.3 / 2025-06-02 ### All diff --git a/build.gradle.kts b/build.gradle.kts index 53d2bda..0a338ce 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,4 +4,5 @@ plugins { alias(libs.plugins.kotlinx.serialization) apply false alias(libs.plugins.android.library) apply false alias(libs.plugins.ksp) apply false + alias(libs.plugins.vanniktech.maven.publish) apply false } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 42555fb..788c736 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ -VERSION=1.4.3 -GROUP=com.ctrip.kotlin +VERSION=1.4.4 +GROUP_ID=com.ctrip.kotlin #Maven Publishing Information githubURL=https://github.com/ctripcorp/SQLlin @@ -28,4 +28,6 @@ kotlin.mpp.stability.nowarn=true kotlin.mpp.enableCInteropCommonization=true kotlin.natvie.increment=true kotlin.jvm.target.validation.mode=warning +kotlin.native.binary.pagedAllocator=false +kotlin.native.binary.latin1Strings=true #kotlin.compiler.execution.strategy=out-of-process \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e48f925..aaafc87 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,15 +1,19 @@ [versions] -kotlin = "2.1.21" -agp = "8.9.3" -ksp = "2.1.21-2.0.1" -serialization = "1.8.1" +kotlin = "2.2.0" +agp = "8.10.1" +ksp = "2.2.0-2.0.2" +serialization = "1.9.0" coroutines = "1.10.2" androidx-annotation = "1.9.1" androidx-test = "1.6.1" androidx-test-runner = "1.6.2" -sqlite-jdbc = "3.49.1.0" +sqlite-jdbc = "3.50.2.0" desugar-jdk-libs = "2.1.5" +jvm-toolchain = "21" +android-sdk-compile = "36" +android-sdk-min = "23" +vanniktech-maven-publish = "0.33.0" [libraries] @@ -34,4 +38,4 @@ kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } android-library = { id = "com.android.library", version.ref = "agp" } -maven-publish = { id = "maven-publish" } \ No newline at end of file +vanniktech-maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "vanniktech-maven-publish" } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 6c046e8..f76881e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Tue Mar 08 15:11:46 CST 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME \ No newline at end of file diff --git a/publish_apple_android_jvm.sh b/publish_apple_android_jvm.sh index 839b7db..d8c076a 100755 --- a/publish_apple_android_jvm.sh +++ b/publish_apple_android_jvm.sh @@ -1,3 +1,3 @@ # Publish artifacts on macOS env -./gradlew :sqllin-driver:publishAllPublicationsToMavenRepository -PonCICD -./gradlew :sqllin-dsl:publishAllPublicationsToMavenRepository -PonCICD \ No newline at end of file +./gradlew :sqllin-driver:publishAllPublicationsToMavenCentralRepository -PonCICD +./gradlew :sqllin-dsl:publishAllPublicationsToMavenCentralRepository -PonCICD \ No newline at end of file diff --git a/publish_linux_processor.sh b/publish_linux_processor.sh index d2379d7..fef590e 100755 --- a/publish_linux_processor.sh +++ b/publish_linux_processor.sh @@ -1,6 +1,6 @@ # Publish artifacts on Linux env -./gradlew :sqllin-driver:publishLinuxX64PublicationToMavenRepository -./gradlew :sqllin-driver:publishLinuxArm64PublicationToMavenRepository -./gradlew :sqllin-processor:publishProcessorPublicationToMavenRepository -./gradlew :sqllin-dsl:publishLinuxX64PublicationToMavenRepository -./gradlew :sqllin-dsl:publishLinuxArm64PublicationToMavenRepository \ No newline at end of file +./gradlew :sqllin-driver:publishLinuxX64PublicationToMavenCentralRepository +./gradlew :sqllin-driver:publishLinuxArm64PublicationToMavenCentralRepository +./gradlew :sqllin-processor:publishMavenPublicationToMavenCentralRepository +./gradlew :sqllin-dsl:publishLinuxX64PublicationToMavenCentralRepository +./gradlew :sqllin-dsl:publishLinuxArm64PublicationToMavenCentralRepository \ No newline at end of file diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts index d18eb25..59a260f 100644 --- a/sample/build.gradle.kts +++ b/sample/build.gradle.kts @@ -11,7 +11,7 @@ plugins { version = "1.0" kotlin { - jvmToolchain(21) + jvmToolchain(libs.versions.jvm.toolchain.get().toInt()) androidTarget { publishLibraryVariants("release") } @@ -23,7 +23,7 @@ kotlin { iosSimulatorArm64() compilerOptions { - freeCompilerArgs.add("-Xexpect-actual-classes") + freeCompilerArgs.addAll("-Xexpect-actual-classes", "-Xcontext-parameters", "-Xnested-type-aliases") } sourceSets { @@ -43,9 +43,9 @@ kotlin { android { namespace = "com.ctrip.sqllin.sample" - compileSdk = 35 + compileSdk = libs.versions.android.sdk.compile.get().toInt() defaultConfig { - minSdk = 23 + minSdk = libs.versions.android.sdk.min.get().toInt() } compileOptions { isCoreLibraryDesugaringEnabled = true diff --git a/sqllin-driver/build.gradle.kts b/sqllin-driver/build.gradle.kts index f2c2f92..c21185d 100644 --- a/sqllin-driver/build.gradle.kts +++ b/sqllin-driver/build.gradle.kts @@ -7,20 +7,19 @@ import org.jetbrains.kotlin.konan.target.HostManager plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.android.library) - alias(libs.plugins.maven.publish) - signing + alias(libs.plugins.vanniktech.maven.publish) } -val GROUP: String by project +val GROUP_ID: String by project val VERSION: String by project -group = GROUP +group = GROUP_ID version = VERSION @OptIn(ExperimentalKotlinGradlePluginApi::class) kotlin { explicitApi() - jvmToolchain(21) + jvmToolchain(libs.versions.jvm.toolchain.get().toInt()) androidTarget { publishLibraryVariants("release") instrumentedTestVariant.sourceSetTree.set(KotlinSourceSetTree.test) @@ -57,7 +56,7 @@ kotlin { } compilerOptions { - freeCompilerArgs.add("-Xexpect-actual-classes") + freeCompilerArgs.addAll("-Xexpect-actual-classes", "-Xcontext-parameters", "-Xnested-type-aliases") } sourceSets { @@ -101,9 +100,9 @@ gradle.taskGraph.whenReady { android { namespace = "com.ctrip.sqllin.driver" - compileSdk = 35 + compileSdk = libs.versions.android.sdk.compile.get().toInt() defaultConfig { - minSdk = 23 + minSdk = libs.versions.android.sdk.min.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } compileOptions { @@ -129,66 +128,45 @@ dependencies { coreLibraryDesugaring(libs.desugar.jdk.libs) } -val javadocJar: TaskProvider by tasks.registering(Jar::class) { - archiveClassifier.set("javadoc") -} - -publishing { - publications.withType { - artifact(javadocJar) - with(pom) { - name.set(artifactId) - description.set("Low-level API for SQLite on Kotlin Multiplatform") - val githubURL: String by project - url.set(githubURL) - licenses { - license { - val licenseName: String by project - name.set(licenseName) - val licenseURL: String by project - url.set(licenseURL) - } - } - developers { - developer { - val developerID: String by project - id.set(developerID) - val developerName: String by project - name.set(developerName) - val developerEmail: String by project - email.set(developerEmail) - } - } - scm { - url.set(githubURL) - val scmURL: String by project - connection.set(scmURL) - developerConnection.set(scmURL) +mavenPublishing { + publishToMavenCentral() + signAllPublications() + + val artifactId = "sqllin-driver" + coordinates( + groupId = GROUP_ID, + artifactId = artifactId, + version = VERSION, + ) + + pom { + name.set(artifactId) + description.set("Low-level API for SQLite on Kotlin Multiplatform") + val githubURL: String by project + url.set(githubURL) + licenses { + license { + val licenseName: String by project + name.set(licenseName) + val licenseURL: String by project + url.set(licenseURL) } } - } - repositories { - maven { - credentials { - val NEXUS_USERNAME: String by project - val NEXUS_PASSWORD: String by project - username = NEXUS_USERNAME - password = NEXUS_PASSWORD + developers { + developer { + val developerID: String by project + id.set(developerID) + val developerName: String by project + name.set(developerName) + val developerEmail: String by project + email.set(developerEmail) } - val mavenRepositoryURL: String by project - url = uri(mavenRepositoryURL) + } + scm { + url.set(githubURL) + val scmURL: String by project + connection.set(scmURL) + developerConnection.set(scmURL) } } - signing { - val SIGNING_KEY_ID: String by project - val SIGNING_KEY: String by project - val SIGNING_PASSWORD: String by project - useInMemoryPgpKeys(SIGNING_KEY_ID, SIGNING_KEY, SIGNING_PASSWORD) - sign(publishing.publications) - } -} - -// TODO: remove after https://youtrack.jetbrains.com/issue/KT-46466 is fixed -project.tasks.withType(AbstractPublishToMaven::class.java).configureEach { - dependsOn(project.tasks.withType(Sign::class.java)) } \ No newline at end of file diff --git a/sqllin-dsl-test/build.gradle.kts b/sqllin-dsl-test/build.gradle.kts index d5f468f..f858304 100644 --- a/sqllin-dsl-test/build.gradle.kts +++ b/sqllin-dsl-test/build.gradle.kts @@ -17,7 +17,7 @@ version = "1.0" @OptIn(ExperimentalKotlinGradlePluginApi::class) kotlin { - jvmToolchain(21) + jvmToolchain(libs.versions.jvm.toolchain.get().toInt()) androidTarget { publishLibraryVariants("release") instrumentedTestVariant.sourceSetTree.set(KotlinSourceSetTree.test) @@ -54,7 +54,7 @@ kotlin { } compilerOptions { - freeCompilerArgs.add("-Xexpect-actual-classes") + freeCompilerArgs.addAll("-Xexpect-actual-classes", "-Xcontext-parameters", "-Xnested-type-aliases") } sourceSets { @@ -84,9 +84,9 @@ kotlin { android { namespace = "com.ctrip.sqllin.dsl.test" - compileSdk = 35 + compileSdk = libs.versions.android.sdk.compile.get().toInt() defaultConfig { - minSdk = 23 + minSdk = libs.versions.android.sdk.min.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } compileOptions { diff --git a/sqllin-dsl-test/src/mingwTest/kotlin/com/ctrip/sqllin/dsl/test/PlatformMingw.kt b/sqllin-dsl-test/src/mingwTest/kotlin/com/ctrip/sqllin/dsl/test/PlatformMingw.kt index 062c256..a87f013 100644 --- a/sqllin-dsl-test/src/mingwTest/kotlin/com/ctrip/sqllin/dsl/test/PlatformMingw.kt +++ b/sqllin-dsl-test/src/mingwTest/kotlin/com/ctrip/sqllin/dsl/test/PlatformMingw.kt @@ -21,7 +21,7 @@ import platform.posix._wgetcwd /** * Windows platform-related functions - * The doc of _getcwd: https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/getcwd-wgetcwd?view=msvc-170 + * The doc of _wgetcwd: https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/getcwd-wgetcwd?view=msvc-170 * @author yaqiao */ diff --git a/sqllin-dsl/build.gradle.kts b/sqllin-dsl/build.gradle.kts index 9af470f..dcbdb26 100644 --- a/sqllin-dsl/build.gradle.kts +++ b/sqllin-dsl/build.gradle.kts @@ -6,19 +6,18 @@ plugins { alias(libs.plugins.kotlinx.serialization) alias(libs.plugins.android.library) alias(libs.plugins.ksp) - alias(libs.plugins.maven.publish) - signing + alias(libs.plugins.vanniktech.maven.publish) } -val GROUP: String by project +val GROUP_ID: String by project val VERSION: String by project -group = GROUP +group = GROUP_ID version = VERSION kotlin { explicitApi() - jvmToolchain(21) + jvmToolchain(libs.versions.jvm.toolchain.get().toInt()) androidTarget { publishLibraryVariants("release") } @@ -50,7 +49,7 @@ kotlin { mingwX64() compilerOptions { - freeCompilerArgs.add("-Xexpect-actual-classes") + freeCompilerArgs.addAll("-Xexpect-actual-classes", "-Xcontext-parameters", "-Xnested-type-aliases") } sourceSets { @@ -84,9 +83,9 @@ gradle.taskGraph.whenReady { android { namespace = "com.ctrip.sqllin.dsl" - compileSdk = 35 + compileSdk = libs.versions.android.sdk.compile.get().toInt() defaultConfig { - minSdk = 23 + minSdk = libs.versions.android.sdk.min.get().toInt() } compileOptions { isCoreLibraryDesugaringEnabled = true @@ -97,66 +96,45 @@ dependencies { coreLibraryDesugaring(libs.desugar.jdk.libs) } -val javadocJar: TaskProvider by tasks.registering(Jar::class) { - archiveClassifier.set("javadoc") -} - -publishing { - publications.withType { - artifact(javadocJar) - with(pom) { - name.set(artifactId) - description.set("SQL DSL APIs for SQLite on Kotlin Multiplatform") - val githubURL: String by project - url.set(githubURL) - licenses { - license { - val licenseName: String by project - name.set(licenseName) - val licenseURL: String by project - url.set(licenseURL) - } - } - developers { - developer { - val developerID: String by project - id.set(developerID) - val developerName: String by project - name.set(developerName) - val developerEmail: String by project - email.set(developerEmail) - } - } - scm { - url.set(githubURL) - val scmURL: String by project - connection.set(scmURL) - developerConnection.set(scmURL) +mavenPublishing { + publishToMavenCentral() + signAllPublications() + + val artifactId = "sqllin-dsl" + coordinates( + groupId = GROUP_ID, + artifactId = artifactId, + version = VERSION, + ) + + pom { + name.set(artifactId) + description.set("SQL DSL APIs for SQLite on Kotlin Multiplatform") + val githubURL: String by project + url.set(githubURL) + licenses { + license { + val licenseName: String by project + name.set(licenseName) + val licenseURL: String by project + url.set(licenseURL) } } - } - repositories { - maven { - credentials { - val NEXUS_USERNAME: String by project - val NEXUS_PASSWORD: String by project - username = NEXUS_USERNAME - password = NEXUS_PASSWORD + developers { + developer { + val developerID: String by project + id.set(developerID) + val developerName: String by project + name.set(developerName) + val developerEmail: String by project + email.set(developerEmail) } - val mavenRepositoryURL: String by project - url = uri(mavenRepositoryURL) + } + scm { + url.set(githubURL) + val scmURL: String by project + connection.set(scmURL) + developerConnection.set(scmURL) } } - signing { - val SIGNING_KEY_ID: String by project - val SIGNING_KEY: String by project - val SIGNING_PASSWORD: String by project - useInMemoryPgpKeys(SIGNING_KEY_ID, SIGNING_KEY, SIGNING_PASSWORD) - sign(publishing.publications) - } -} - -// TODO: remove after https://youtrack.jetbrains.com/issue/KT-46466 is fixed -project.tasks.withType(AbstractPublishToMaven::class.java).configureEach { - dependsOn(project.tasks.withType(Sign::class.java)) } \ No newline at end of file diff --git a/sqllin-dsl/doc/getting-start-cn.md b/sqllin-dsl/doc/getting-start-cn.md index e51d742..8189762 100644 --- a/sqllin-dsl/doc/getting-start-cn.md +++ b/sqllin-dsl/doc/getting-start-cn.md @@ -14,7 +14,7 @@ plugins { id("com.google.devtools.ksp") } -val sqllinVersion = "1.4.3" +val sqllinVersion = "1.4.4" kotlin { // ...... @@ -28,10 +28,10 @@ kotlin { implementation("com.ctrip.kotlin:sqllin-driver:$sqllinVersion") // The sqllin-dsl serialization and deserialization depends on kotlinx-serialization - implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.8.0") + implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.9.0") // Since 1.2.2, sqllin-dsl depends on kotlinx.coroutines - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.1") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2") } } // ...... diff --git a/sqllin-dsl/doc/getting-start.md b/sqllin-dsl/doc/getting-start.md index e9385b8..9157ca8 100644 --- a/sqllin-dsl/doc/getting-start.md +++ b/sqllin-dsl/doc/getting-start.md @@ -16,7 +16,7 @@ plugins { id("com.google.devtools.ksp") } -val sqllinVersion = "1.4.3" +val sqllinVersion = "1.4.4" kotlin { // ...... @@ -30,7 +30,7 @@ kotlin { implementation("com.ctrip.kotlin:sqllin-driver:$sqllinVersion") // The sqllin-dsl serialization and deserialization depends on kotlinx-serialization - implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.8.1") + implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.9.0") // Since 1.2.2, sqllin-dsl depends on kotlinx.coroutines implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2") diff --git a/sqllin-processor/build.gradle.kts b/sqllin-processor/build.gradle.kts index 0f3855d..01d3ed3 100644 --- a/sqllin-processor/build.gradle.kts +++ b/sqllin-processor/build.gradle.kts @@ -1,13 +1,12 @@ plugins { alias(libs.plugins.kotlin.jvm) - alias(libs.plugins.maven.publish) - signing + alias(libs.plugins.vanniktech.maven.publish) } -val GROUP: String by project +val GROUP_ID: String by project val VERSION: String by project -group = GROUP +group = GROUP_ID version = VERSION repositories { @@ -23,73 +22,45 @@ dependencies { implementation(libs.ksp) } -val NEXUS_USERNAME: String by project -val NEXUS_PASSWORD: String by project +mavenPublishing { + publishToMavenCentral() + signAllPublications() -val javadocJar: TaskProvider by tasks.registering(Jar::class) { - archiveClassifier.set("javadoc") -} - -val sourceJar: TaskProvider by tasks.registering(Jar::class) { - archiveClassifier.set("sources") - from(project.the()["main"].allSource) -} + val artifactId = "sqllin-processor" + coordinates( + groupId = GROUP_ID, + artifactId = artifactId, + version = VERSION, + ) -publishing { - publications.create("Processor") { - artifactId = "sqllin-processor" - setArtifacts( - listOf( - "$projectDir/build/libs/sqllin-processor-$version.jar", - javadocJar, sourceJar, - ) - ) - with(pom) { - name.set(artifactId) - description.set("KSP code be used to generate the database column properties") - val githubURL: String by project - url.set(githubURL) - licenses { - license { - val licenseName: String by project - name.set(licenseName) - val licenseURL: String by project - url.set(licenseURL) - } - } - developers { - developer { - val developerID: String by project - id.set(developerID) - val developerName: String by project - name.set(developerName) - val developerEmail: String by project - email.set(developerEmail) - } - } - scm { - url.set(githubURL) - val scmURL: String by project - connection.set(scmURL) - developerConnection.set(scmURL) + pom { + name.set(artifactId) + description.set("KSP code be used to generate the database column properties") + val githubURL: String by project + url.set(githubURL) + licenses { + license { + val licenseName: String by project + name.set(licenseName) + val licenseURL: String by project + url.set(licenseURL) } } - } - repositories { - maven { - credentials { - username = NEXUS_USERNAME - password = NEXUS_PASSWORD + developers { + developer { + val developerID: String by project + id.set(developerID) + val developerName: String by project + name.set(developerName) + val developerEmail: String by project + email.set(developerEmail) } - val mavenRepositoryURL: String by project - url = uri(mavenRepositoryURL) } - } - signing { - val SIGNING_KEY_ID: String by project - val SIGNING_KEY: String by project - val SIGNING_PASSWORD: String by project - useInMemoryPgpKeys(SIGNING_KEY_ID, SIGNING_KEY, SIGNING_PASSWORD) - sign(publishing.publications) + scm { + url.set(githubURL) + val scmURL: String by project + connection.set(scmURL) + developerConnection.set(scmURL) + } } } \ No newline at end of file