Skip to content

Commit c1284aa

Browse files
authored
fix: fix publication (#166)
Signed-off-by: Bence Hornák <[email protected]>
1 parent c8b1dda commit c1284aa

File tree

3 files changed

+75
-58
lines changed

3 files changed

+75
-58
lines changed

build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ plugins {
44
id("com.android.application").version("8.10.0").apply(false)
55
id("org.jetbrains.kotlin.multiplatform").version("2.1.21").apply(false)
66
id("org.jetbrains.kotlin.plugin.compose").version("2.1.0").apply(false)
7+
id("org.jetbrains.dokka").version("2.0.0").apply(false)
78
id("org.jlleitschuh.gradle.ktlint").version("11.6.1").apply(true)
89
id("io.github.gradle-nexus.publish-plugin").version("2.0.0").apply(true)
910
id("org.jetbrains.kotlinx.binary-compatibility-validator").version("0.17.0").apply(false)
11+
id("com.vanniktech.maven.publish").version("0.34.0").apply(false)
1012
}
1113
allprojects {
1214
extra["groupId"] = "dev.openfeature"

gradle.properties

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,8 @@ kotlin.code.style=official
2020
# Enables namespacing of each library's R class so that its R class includes only the
2121
# resources declared in the library itself and none from the library's dependencies,
2222
# thereby reducing the size of the R class for that library
23-
android.nonTransitiveRClass=true
23+
android.nonTransitiveRClass=true
24+
# Enable the v2 syntax of the Dokka Gradle Plugin
25+
# https://kotlinlang.org/docs/dokka-migration.html
26+
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
27+
org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true

kotlin-sdk/build.gradle.kts

Lines changed: 68 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1+
import com.vanniktech.maven.publish.JavadocJar
2+
import com.vanniktech.maven.publish.KotlinMultiplatform
13
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
4+
25
plugins {
36
id("com.android.library")
47
id("org.jetbrains.kotlin.multiplatform")
8+
id("org.jetbrains.dokka")
59
id("maven-publish")
610
id("signing")
711
id("org.jlleitschuh.gradle.ktlint")
812
id("org.jetbrains.kotlinx.binary-compatibility-validator")
13+
id("com.vanniktech.maven.publish")
914
}
1015

1116
val releaseVersion = project.extra["version"].toString()
@@ -15,6 +20,8 @@ version = releaseVersion
1520

1621
kotlin {
1722
androidTarget {
23+
publishLibraryVariants("release")
24+
1825
compilations.all {
1926
compileTaskProvider.configure {
2027
compilerOptions {
@@ -70,71 +77,75 @@ android {
7077
sourceCompatibility = JavaVersion.VERSION_11
7178
targetCompatibility = JavaVersion.VERSION_11
7279
}
80+
}
7381

74-
publishing {
75-
singleVariant("release") {
76-
withJavadocJar()
77-
withSourcesJar()
82+
// Configure Dokka for documentation
83+
dokka {
84+
dokkaPublications.html {
85+
suppressInheritedMembers.set(true)
86+
failOnWarning.set(true)
87+
}
88+
dokkaSourceSets.commonMain {
89+
sourceLink {
90+
localDirectory.set(file("src/"))
91+
remoteUrl("https://github.com/open-feature/kotlin-sdk/tree/main/kotlin-sdk/src")
92+
remoteLineSuffix.set("#L")
7893
}
7994
}
8095
}
8196

82-
publishing {
83-
publications {
84-
register<MavenPublication>("release") {
97+
mavenPublishing {
98+
configure(
99+
KotlinMultiplatform(
100+
javadocJar = JavadocJar.Dokka("dokkaGeneratePublicationHtml"),
101+
sourcesJar = true,
102+
androidVariantsToPublish = listOf("release")
103+
)
104+
)
105+
signAllPublications()
85106

86-
pom {
87-
name.set("OpenFeature Android SDK")
88-
description.set(
89-
"This is the Android implementation of OpenFeature, a vendor-agnostic abstraction library for evaluating feature flags."
90-
)
91-
url.set("https://openfeature.dev")
92-
licenses {
93-
license {
94-
name.set("The Apache License, Version 2.0")
95-
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
96-
}
97-
}
98-
developers {
99-
developer {
100-
id.set("vahidlazio")
101-
name.set("Vahid Torkaman")
102-
email.set("[email protected]")
103-
}
104-
developer {
105-
id.set("fabriziodemaria")
106-
name.set("Fabrizio Demaria")
107-
email.set("[email protected]")
108-
}
109-
developer {
110-
id.set("nicklasl")
111-
name.set("Nicklas Lundin")
112-
email.set("[email protected]")
113-
}
114-
developer {
115-
id.set("nickybondarenko")
116-
name.set("Nicky Bondarenko")
117-
email.set("[email protected]")
118-
}
119-
}
120-
scm {
121-
connection.set(
122-
"scm:git:https://github.com/open-feature/kotlin-sdk.git"
123-
)
124-
developerConnection.set(
125-
"scm:git:ssh://open-feature/kotlin-sdk.git"
126-
)
127-
url.set("https://github.com/open-feature/kotlin-sdk")
128-
}
107+
pom {
108+
name.set("OpenFeature Kotlin SDK")
109+
description.set(
110+
"This is the Kotlin implementation of OpenFeature, a vendor-agnostic abstraction library for evaluating feature flags."
111+
)
112+
url.set("https://openfeature.dev")
113+
licenses {
114+
license {
115+
name.set("The Apache License, Version 2.0")
116+
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
129117
}
130-
131-
afterEvaluate {
132-
from(components["release"])
118+
}
119+
developers {
120+
developer {
121+
id.set("vahidlazio")
122+
name.set("Vahid Torkaman")
123+
email.set("[email protected]")
124+
}
125+
developer {
126+
id.set("fabriziodemaria")
127+
name.set("Fabrizio Demaria")
128+
email.set("[email protected]")
129+
}
130+
developer {
131+
id.set("nicklasl")
132+
name.set("Nicklas Lundin")
133+
email.set("[email protected]")
134+
}
135+
developer {
136+
id.set("nickybondarenko")
137+
name.set("Nicky Bondarenko")
138+
email.set("[email protected]")
133139
}
134140
}
141+
scm {
142+
connection.set(
143+
"scm:git:https://github.com/open-feature/kotlin-sdk.git"
144+
)
145+
developerConnection.set(
146+
"scm:git:ssh://open-feature/kotlin-sdk.git"
147+
)
148+
url.set("https://github.com/open-feature/kotlin-sdk")
149+
}
135150
}
136-
}
137-
138-
signing {
139-
sign(publishing.publications["release"])
140151
}

0 commit comments

Comments
 (0)