From f8282ec465db9d34eac882f1c7bc6ad200e10b13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bence=20Horn=C3=A1k?= Date: Mon, 18 Aug 2025 20:33:18 +0200 Subject: [PATCH 1/3] Fix Maven metadata MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bence Hornák --- kotlin-sdk/build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kotlin-sdk/build.gradle.kts b/kotlin-sdk/build.gradle.kts index 730d863..0926321 100644 --- a/kotlin-sdk/build.gradle.kts +++ b/kotlin-sdk/build.gradle.kts @@ -84,9 +84,9 @@ publishing { register("release") { pom { - name.set("OpenFeature Android SDK") + name.set("OpenFeature Kotlin SDK") description.set( - "This is the Android implementation of OpenFeature, a vendor-agnostic abstraction library for evaluating feature flags." + "This is the Kotlin implementation of OpenFeature, a vendor-agnostic abstraction library for evaluating feature flags." ) url.set("https://openfeature.dev") licenses { From 02063694faabe212849b1541cc7455032e0ee567 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bence=20Horn=C3=A1k?= Date: Mon, 18 Aug 2025 20:33:41 +0200 Subject: [PATCH 2/3] Fix conflicting publications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bence Hornák --- kotlin-sdk/build.gradle.kts | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/kotlin-sdk/build.gradle.kts b/kotlin-sdk/build.gradle.kts index 0926321..1d39fa1 100644 --- a/kotlin-sdk/build.gradle.kts +++ b/kotlin-sdk/build.gradle.kts @@ -15,6 +15,8 @@ version = releaseVersion kotlin { androidTarget { + publishLibraryVariants("release") + compilations.all { compileTaskProvider.configure { compilerOptions { @@ -70,19 +72,11 @@ android { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 } - - publishing { - singleVariant("release") { - withJavadocJar() - withSourcesJar() - } - } } publishing { publications { - register("release") { - + withType(MavenPublication::class) { pom { name.set("OpenFeature Kotlin SDK") description.set( @@ -127,14 +121,10 @@ publishing { url.set("https://github.com/open-feature/kotlin-sdk") } } - - afterEvaluate { - from(components["release"]) - } } } } signing { - sign(publishing.publications["release"]) + sign(publishing.publications) } \ No newline at end of file From 2215f4868122cb7ea1081e0693cabcf8149a35a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bence=20Horn=C3=A1k?= Date: Mon, 18 Aug 2025 22:10:35 +0200 Subject: [PATCH 3/3] Apply Dokka and Gradle Maven Publish plugins MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bence Hornák --- build.gradle.kts | 2 + gradle.properties | 6 +- kotlin-sdk/build.gradle.kts | 119 +++++++++++++++++++++--------------- 3 files changed, 77 insertions(+), 50 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index f1100ec..c7f6bee 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,9 +4,11 @@ plugins { id("com.android.application").version("8.10.0").apply(false) id("org.jetbrains.kotlin.multiplatform").version("2.1.21").apply(false) id("org.jetbrains.kotlin.plugin.compose").version("2.1.0").apply(false) + id("org.jetbrains.dokka").version("2.0.0").apply(false) id("org.jlleitschuh.gradle.ktlint").version("11.6.1").apply(true) id("io.github.gradle-nexus.publish-plugin").version("2.0.0").apply(true) id("org.jetbrains.kotlinx.binary-compatibility-validator").version("0.17.0").apply(false) + id("com.vanniktech.maven.publish").version("0.34.0").apply(false) } allprojects { extra["groupId"] = "dev.openfeature" diff --git a/gradle.properties b/gradle.properties index 3c5031e..dafa068 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,4 +20,8 @@ kotlin.code.style=official # Enables namespacing of each library's R class so that its R class includes only the # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library -android.nonTransitiveRClass=true \ No newline at end of file +android.nonTransitiveRClass=true +# Enable the v2 syntax of the Dokka Gradle Plugin +# https://kotlinlang.org/docs/dokka-migration.html +org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled +org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true \ No newline at end of file diff --git a/kotlin-sdk/build.gradle.kts b/kotlin-sdk/build.gradle.kts index 1d39fa1..d544c24 100644 --- a/kotlin-sdk/build.gradle.kts +++ b/kotlin-sdk/build.gradle.kts @@ -1,11 +1,16 @@ +import com.vanniktech.maven.publish.JavadocJar +import com.vanniktech.maven.publish.KotlinMultiplatform import org.jetbrains.kotlin.gradle.dsl.JvmTarget + plugins { id("com.android.library") id("org.jetbrains.kotlin.multiplatform") + id("org.jetbrains.dokka") id("maven-publish") id("signing") id("org.jlleitschuh.gradle.ktlint") id("org.jetbrains.kotlinx.binary-compatibility-validator") + id("com.vanniktech.maven.publish") } val releaseVersion = project.extra["version"].toString() @@ -74,57 +79,73 @@ android { } } -publishing { - publications { - withType(MavenPublication::class) { - pom { - name.set("OpenFeature Kotlin SDK") - description.set( - "This is the Kotlin implementation of OpenFeature, a vendor-agnostic abstraction library for evaluating feature flags." - ) - url.set("https://openfeature.dev") - licenses { - license { - name.set("The Apache License, Version 2.0") - url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") - } - } - developers { - developer { - id.set("vahidlazio") - name.set("Vahid Torkaman") - email.set("vahidt@spotify.com") - } - developer { - id.set("fabriziodemaria") - name.set("Fabrizio Demaria") - email.set("fdema@spotify.com") - } - developer { - id.set("nicklasl") - name.set("Nicklas Lundin") - email.set("nicklasl@spotify.com") - } - developer { - id.set("nickybondarenko") - name.set("Nicky Bondarenko") - email.set("nickyb@spotify.com") - } - } - scm { - connection.set( - "scm:git:https://github.com/open-feature/kotlin-sdk.git" - ) - developerConnection.set( - "scm:git:ssh://open-feature/kotlin-sdk.git" - ) - url.set("https://github.com/open-feature/kotlin-sdk") - } - } +// Configure Dokka for documentation +dokka { + dokkaPublications.html { + suppressInheritedMembers.set(true) + failOnWarning.set(true) + } + dokkaSourceSets.commonMain { + sourceLink { + localDirectory.set(file("src/")) + remoteUrl("https://github.com/open-feature/kotlin-sdk/tree/main/kotlin-sdk/src") + remoteLineSuffix.set("#L") } } } -signing { - sign(publishing.publications) +mavenPublishing { + configure( + KotlinMultiplatform( + javadocJar = JavadocJar.Dokka("dokkaGeneratePublicationHtml"), + sourcesJar = true, + androidVariantsToPublish = listOf("release") + ) + ) + signAllPublications() + + pom { + name.set("OpenFeature Kotlin SDK") + description.set( + "This is the Kotlin implementation of OpenFeature, a vendor-agnostic abstraction library for evaluating feature flags." + ) + url.set("https://openfeature.dev") + licenses { + license { + name.set("The Apache License, Version 2.0") + url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") + } + } + developers { + developer { + id.set("vahidlazio") + name.set("Vahid Torkaman") + email.set("vahidt@spotify.com") + } + developer { + id.set("fabriziodemaria") + name.set("Fabrizio Demaria") + email.set("fdema@spotify.com") + } + developer { + id.set("nicklasl") + name.set("Nicklas Lundin") + email.set("nicklasl@spotify.com") + } + developer { + id.set("nickybondarenko") + name.set("Nicky Bondarenko") + email.set("nickyb@spotify.com") + } + } + scm { + connection.set( + "scm:git:https://github.com/open-feature/kotlin-sdk.git" + ) + developerConnection.set( + "scm:git:ssh://open-feature/kotlin-sdk.git" + ) + url.set("https://github.com/open-feature/kotlin-sdk") + } + } } \ No newline at end of file