diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ca15c4e..d7bdd533 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,5 +43,5 @@ jobs: - name: Upload snapshot (main only) run: | ./gradlew --stop && jps|grep -E 'KotlinCompileDaemon|GradleDaemon'| awk '{print $1}'| xargs kill -9 || true - ./gradlew publishAllPublicationsToMavenCentralRepository -PmavenCentralUsername=${{ secrets.SONATYPE_USERNAME }} -PmavenCentralPassword=${{ secrets.SONATYPE_PASSWORD }} + ./gradlew publish -PmavenCentralUsername=${{ secrets.SONATYPE_USERNAME }} -PmavenCentralPassword=${{ secrets.SONATYPE_PASSWORD }} if: github.ref == 'refs/heads/main' && github.event_name == 'push' && matrix.java_version == '16' && !matrix.ksp_enabled diff --git a/RELEASING.md b/RELEASING.md index c8276249..25b678cc 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -5,7 +5,7 @@ Releasing 2. Update the `CHANGELOG.md` for the impending release. 3. `git commit -am "Prepare for release X.Y.Z."` (where X.Y.Z is the new version) 4. `git tag -a X.Y.Z -m "Version X.Y.Z"` (where X.Y.Z is the new version) -5. `./gradlew clean publishAllPublicationsToMavenCentralRepository --no-daemon --no-parallel && ./gradlew closeAndReleaseRepository` +5. `./gradlew clean publish --no-daemon --no-parallel && ./gradlew closeAndReleaseRepository` * Make sure to run this with JDK 16 6. Update the `gradle.properties` to the next SNAPSHOT version. 7. `git commit -am "Prepare next development version."` diff --git a/gradle.properties b/gradle.properties index c800afbd..3c3f0dde 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,37 +19,31 @@ # Adds exports for GJF in spotless # https://github.com/diffplug/spotless/issues/834 org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 \ - --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \ - --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \ - --add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \ - --add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \ - --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \ + --add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \ --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \ --add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED \ --add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \ --add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED \ --add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED \ + --add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \ --add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED \ --add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \ --add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED kotlin.daemon.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 \ - --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \ - --add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \ - --add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \ - --add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \ - --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \ + --add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \ --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \ --add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED \ --add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \ --add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED \ --add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED \ + --add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \ --add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED \ --add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \ --add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED GROUP=dev.zacsweers.moshix -VERSION_NAME=0.13.0 +VERSION_NAME=0.14.0-SNAPSHOT POM_DESCRIPTION=Moshi Extensions POM_URL=https://github.com/ZacSweers/MoshiX POM_SCM_URL=https://github.com/ZacSweers/MoshiX diff --git a/moshi-adapters/build.gradle.kts b/moshi-adapters/build.gradle.kts index 592d7cb6..1e8b53db 100644 --- a/moshi-adapters/build.gradle.kts +++ b/moshi-adapters/build.gradle.kts @@ -18,7 +18,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { kotlin("jvm") - kotlin("kapt") + alias(libs.plugins.ksp) id("com.vanniktech.maven.publish") } @@ -31,7 +31,7 @@ tasks.named("compileTestKotlin") { dependencies { implementation(libs.moshi) - kaptTest(libs.moshi.codegen) + kspTest(project(":moshi-ksp")) testImplementation(libs.moshi.kotlin) testImplementation(libs.okhttp) testImplementation(libs.okhttp.mockwebserver) diff --git a/moshi-metadata-reflect/build.gradle.kts b/moshi-metadata-reflect/build.gradle.kts index 2ca75b16..10756b9c 100644 --- a/moshi-metadata-reflect/build.gradle.kts +++ b/moshi-metadata-reflect/build.gradle.kts @@ -18,7 +18,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { kotlin("jvm") - kotlin("kapt") + alias(libs.plugins.ksp) id("com.vanniktech.maven.publish") } @@ -32,8 +32,8 @@ tasks.named("compileTestKotlin") { dependencies { implementation(libs.kotlin.metadata) implementation(libs.moshi) - kaptTest(libs.moshi.codegen) - testImplementation("org.assertj:assertj-core:3.11.1") + kspTest(project(":moshi-ksp")) + testImplementation("org.assertj:assertj-core:3.20.2") testImplementation(libs.junit) testImplementation(libs.truth) } diff --git a/moshi-sealed/codegen/build.gradle.kts b/moshi-sealed/codegen/build.gradle.kts index 9ba3a196..7d14383d 100644 --- a/moshi-sealed/codegen/build.gradle.kts +++ b/moshi-sealed/codegen/build.gradle.kts @@ -15,19 +15,14 @@ */ plugins { - // TODO use ksp version again when ksp supports 1.4.30 - // https://github.com/google/ksp/issues/267 -// id("com.google.devtools.ksp") version Dependencies.Kotlin.Ksp.version kotlin("jvm") - kotlin("kapt") + alias(libs.plugins.ksp) id("com.vanniktech.maven.publish") } dependencies { implementation(libs.autoService) - kapt(libs.autoService.processor) - kapt(libs.incap.processor) - compileOnly(libs.incap) + ksp(libs.autoService.ksp) implementation(libs.autoCommon) implementation(libs.kotlinpoet) diff --git a/moshi-sealed/codegen/src/main/kotlin/dev/zacsweers/moshix/sealed/codegen/MoshiSealedProcessor.kt b/moshi-sealed/codegen/src/main/kotlin/dev/zacsweers/moshix/sealed/codegen/MoshiSealedProcessor.kt index d8d80078..b726c594 100644 --- a/moshi-sealed/codegen/src/main/kotlin/dev/zacsweers/moshix/sealed/codegen/MoshiSealedProcessor.kt +++ b/moshi-sealed/codegen/src/main/kotlin/dev/zacsweers/moshix/sealed/codegen/MoshiSealedProcessor.kt @@ -49,8 +49,6 @@ import dev.zacsweers.moshix.sealed.annotations.DefaultObject import dev.zacsweers.moshix.sealed.annotations.TypeLabel import dev.zacsweers.moshix.sealed.codegen.MoshiSealedProcessor.Companion.OPTION_GENERATED import dev.zacsweers.moshix.sealed.runtime.internal.ObjectJsonAdapter -import net.ltgt.gradle.incap.IncrementalAnnotationProcessor -import net.ltgt.gradle.incap.IncrementalAnnotationProcessorType import javax.annotation.processing.AbstractProcessor import javax.annotation.processing.Filer import javax.annotation.processing.Messager @@ -65,7 +63,6 @@ import javax.lang.model.util.Types import javax.tools.Diagnostic @KotlinPoetMetadataPreview -@IncrementalAnnotationProcessor(IncrementalAnnotationProcessorType.AGGREGATING) @SupportedOptions(OPTION_GENERATED) @AutoService(Processor::class) public class MoshiSealedProcessor : AbstractProcessor() { diff --git a/moshi-sealed/codegen/src/main/resources/META-INF/gradle/incremental.annotation.processors b/moshi-sealed/codegen/src/main/resources/META-INF/gradle/incremental.annotation.processors new file mode 100644 index 00000000..9d7afc66 --- /dev/null +++ b/moshi-sealed/codegen/src/main/resources/META-INF/gradle/incremental.annotation.processors @@ -0,0 +1 @@ +dev.zacsweers.moshix.sealed.codegen.MoshiSealedProcessor,aggregating \ No newline at end of file