From 5ee32605281374cdff854cfd80812d0e0840e640 Mon Sep 17 00:00:00 2001 From: Sergio Belda Galbis Date: Sun, 7 Apr 2024 23:33:01 +0200 Subject: [PATCH] Prepare compiler module for maven publishing --- build.gradle.kts | 1 + gradle/libs.versions.toml | 2 +- .../build.gradle.kts | 12 ++++++++++++ .../processor/generator/SafeNavArgsClassGenerator.kt | 1 - 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 43f7b2e..a34984c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,5 +3,6 @@ plugins { alias(libs.plugins.androidLibrary) apply false alias(libs.plugins.kotlin) apply false alias(libs.plugins.ksp) apply false + alias(libs.plugins.vanniktechMavenPublish) apply false alias(libs.plugins.dokka) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1ba269a..e21fb3f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -16,7 +16,7 @@ ksp = "1.9.23-1.0.19" ktlint = "0.50.0" lifecycleRuntimeKtx = "2.7.0" navigationCompose = "2.7.7" -navigationComposeExtended = "0.1.0" +navigationComposeExtended = "0.2.0" spotless = "6.25.0" vanniktechMavenPublishPlugin = "0.28.0" diff --git a/navigation-compose-extended-compiler/build.gradle.kts b/navigation-compose-extended-compiler/build.gradle.kts index e4ab47f..1abd328 100644 --- a/navigation-compose-extended-compiler/build.gradle.kts +++ b/navigation-compose-extended-compiler/build.gradle.kts @@ -1,10 +1,16 @@ +import com.vanniktech.maven.publish.SonatypeHost + plugins { kotlin("jvm") alias(libs.plugins.ksp) alias(libs.plugins.dokka) + alias(libs.plugins.vanniktechMavenPublish) id("dev.sergiobelda.gradle.spotless") } +group = "dev.sergiobelda.navigation.compose.extended" +version = libs.versions.navigationComposeExtended.get() + java { toolchain { languageVersion = JavaLanguageVersion.of(17) @@ -16,3 +22,9 @@ dependencies { implementation(libs.squareup.kotlinpoet) implementation(libs.squareup.kotlinpoetKsp) } + +mavenPublishing { + publishToMavenCentral(SonatypeHost.S01, true) + + signAllPublications() +} diff --git a/navigation-compose-extended-compiler/src/main/kotlin/dev/sergiobelda/navigation/compose/extended/compiler/processor/generator/SafeNavArgsClassGenerator.kt b/navigation-compose-extended-compiler/src/main/kotlin/dev/sergiobelda/navigation/compose/extended/compiler/processor/generator/SafeNavArgsClassGenerator.kt index 09d5a68..0a67eb8 100644 --- a/navigation-compose-extended-compiler/src/main/kotlin/dev/sergiobelda/navigation/compose/extended/compiler/processor/generator/SafeNavArgsClassGenerator.kt +++ b/navigation-compose-extended-compiler/src/main/kotlin/dev/sergiobelda/navigation/compose/extended/compiler/processor/generator/SafeNavArgsClassGenerator.kt @@ -80,7 +80,6 @@ internal class SafeNavArgsClassGenerator( navArgumentParameter.parameter.type.resolve().toTypeName().copy(nullable = true) val member: MemberName = navArgumentParameter.parameter.type.resolve().mapToNavArgsGetter() - ?: return@forEach addProperty( PropertySpec.builder( navArgumentParameter.name,