1
+ import com.vanniktech.maven.publish.JavadocJar
2
+ import com.vanniktech.maven.publish.KotlinMultiplatform
1
3
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
4
+
2
5
plugins {
3
6
id(" com.android.library" )
4
7
id(" org.jetbrains.kotlin.multiplatform" )
8
+ id(" org.jetbrains.dokka" )
5
9
id(" maven-publish" )
6
10
id(" signing" )
7
11
id(" org.jlleitschuh.gradle.ktlint" )
8
12
id(" org.jetbrains.kotlinx.binary-compatibility-validator" )
13
+ id(" com.vanniktech.maven.publish" )
9
14
}
10
15
11
16
val releaseVersion = project.extra[" version" ].toString()
@@ -15,6 +20,8 @@ version = releaseVersion
15
20
16
21
kotlin {
17
22
androidTarget {
23
+ publishLibraryVariants(" release" )
24
+
18
25
compilations.all {
19
26
compileTaskProvider.configure {
20
27
compilerOptions {
@@ -70,71 +77,75 @@ android {
70
77
sourceCompatibility = JavaVersion .VERSION_11
71
78
targetCompatibility = JavaVersion .VERSION_11
72
79
}
80
+ }
73
81
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" )
78
93
}
79
94
}
80
95
}
81
96
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()
85
106
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
-
103
- }
104
- developer {
105
- id.set(" fabriziodemaria" )
106
- name.set(" Fabrizio Demaria" )
107
-
108
- }
109
- developer {
110
- id.set(" nicklasl" )
111
- name.set(" Nicklas Lundin" )
112
-
113
- }
114
- developer {
115
- id.set(" nickybondarenko" )
116
- name.set(" Nicky Bondarenko" )
117
-
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" )
129
117
}
130
-
131
- afterEvaluate {
132
- from(components[" release" ])
118
+ }
119
+ developers {
120
+ developer {
121
+ id.set(" vahidlazio" )
122
+ name.set(" Vahid Torkaman" )
123
+
124
+ }
125
+ developer {
126
+ id.set(" fabriziodemaria" )
127
+ name.set(" Fabrizio Demaria" )
128
+
129
+ }
130
+ developer {
131
+ id.set(" nicklasl" )
132
+ name.set(" Nicklas Lundin" )
133
+
134
+ }
135
+ developer {
136
+ id.set(" nickybondarenko" )
137
+ name.set(" Nicky Bondarenko" )
138
+
133
139
}
134
140
}
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
+ }
135
150
}
136
- }
137
-
138
- signing {
139
- sign(publishing.publications[" release" ])
140
151
}
0 commit comments