-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Deploying to Maven central (#50)
Signed-off-by: Nicklas Lundin <[email protected]>
- Loading branch information
Showing
3 changed files
with
105 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ plugins { | |
id("com.android.library") | ||
id("org.jetbrains.kotlin.android") | ||
id("maven-publish") | ||
id("signing") | ||
id("org.jlleitschuh.gradle.ktlint") | ||
kotlin("plugin.serialization") version "1.9.10" | ||
} | ||
|
@@ -38,41 +39,82 @@ android { | |
kotlinOptions { | ||
jvmTarget = JavaVersion.VERSION_11.toString() | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3") | ||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0") | ||
testImplementation("junit:junit:4.13.2") | ||
testImplementation("org.mockito.kotlin:mockito-kotlin:5.1.0") | ||
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3") | ||
} | ||
|
||
afterEvaluate { | ||
publishing { | ||
publications { | ||
register<MavenPublication>("release") { | ||
groupId = "dev.openfeature" | ||
artifactId = "kotlin-sdk" | ||
version = releaseVersion | ||
singleVariant("release") { | ||
withJavadocJar() | ||
withSourcesJar() | ||
} | ||
} | ||
} | ||
|
||
from(components["release"]) | ||
artifact(androidSourcesJar.get()) | ||
publishing { | ||
publications { | ||
register<MavenPublication>("release") { | ||
groupId = "dev.openfeature" | ||
artifactId = "kotlin-sdk" | ||
version = releaseVersion | ||
|
||
pom { | ||
name.set("OpenfeatureSDK") | ||
pom { | ||
name.set("OpenFeature Android SDK") | ||
description.set( | ||
"This is the Android 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("[email protected]") | ||
} | ||
developer { | ||
id.set("fabriziodemaria") | ||
name.set("Fabrizio Demaria") | ||
email.set("[email protected]") | ||
} | ||
developer { | ||
id.set("nicklasl") | ||
name.set("Nicklas Lundin") | ||
email.set("[email protected]") | ||
} | ||
developer { | ||
id.set("nickybondarenko") | ||
name.set("Nicky Bondarenko") | ||
email.set("[email protected]") | ||
} | ||
} | ||
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") | ||
} | ||
} | ||
|
||
afterEvaluate { | ||
from(components["release"]) | ||
} | ||
} | ||
} | ||
} | ||
|
||
val androidSourcesJar by tasks.registering(Jar::class) { | ||
archiveClassifier.set("sources") | ||
from(android.sourceSets.getByName("main").java.srcDirs) | ||
dependencies { | ||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3") | ||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0") | ||
testImplementation("junit:junit:4.13.2") | ||
testImplementation("org.mockito.kotlin:mockito-kotlin:5.1.0") | ||
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3") | ||
} | ||
|
||
// Assembling should be performed before publishing package | ||
tasks.named("publish") { | ||
dependsOn("assemble") | ||
signing { | ||
sign(publishing.publications["release"]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters