1+ import com.vanniktech.maven.publish.JavadocJar
2+ import com.vanniktech.maven.publish.KotlinMultiplatform
13import org.jetbrains.kotlin.gradle.dsl.JvmTarget
4+
25plugins {
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
1116val releaseVersion = project.extra[" version" ].toString()
@@ -15,6 +20,8 @@ version = releaseVersion
1520
1621kotlin {
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(" vahidt@spotify.com" )
103- }
104- developer {
105- id.set(" fabriziodemaria" )
106- name.set(" Fabrizio Demaria" )
107- email.set(" fdema@spotify.com" )
108- }
109- developer {
110- id.set(" nicklasl" )
111- name.set(" Nicklas Lundin" )
112- email.set(" nicklasl@spotify.com" )
113- }
114- developer {
115- id.set(" nickybondarenko" )
116- name.set(" Nicky Bondarenko" )
117- email.set(" nickyb@spotify.com" )
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(" vahidt@spotify.com" )
124+ }
125+ developer {
126+ id.set(" fabriziodemaria" )
127+ name.set(" Fabrizio Demaria" )
128+ email.set(" fdema@spotify.com" )
129+ }
130+ developer {
131+ id.set(" nicklasl" )
132+ name.set(" Nicklas Lundin" )
133+ email.set(" nicklasl@spotify.com" )
134+ }
135+ developer {
136+ id.set(" nickybondarenko" )
137+ name.set(" Nicky Bondarenko" )
138+ email.set(" nickyb@spotify.com" )
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