Skip to content

Commit

Permalink
Publish android lib (#310)
Browse files Browse the repository at this point in the history
Co-authored-by: hfhbd <[email protected]>
  • Loading branch information
hfhbd and hfhbd authored Mar 20, 2024
1 parent ffb8a55 commit 461ad4a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
7 changes: 3 additions & 4 deletions gradle/build-logic/src/main/kotlin/publish.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ publishing {
}

signing {
val signingKey: String? by project
val signingPassword: String? by project
signingKey?.let {
useInMemoryPgpKeys(String(Base64.getDecoder().decode(it)).trim(), signingPassword)
val signingKey = providers.gradleProperty("signingKey")
if (signingKey.isPresent) {
useInMemoryPgpKeys(signingKey.get(), providers.gradleProperty("signingPassword").get())
sign(publishing.publications)
}
}
Expand Down
18 changes: 17 additions & 1 deletion kotlinx-uuid-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,27 @@ android {

defaultConfig {
minSdk = 21
aarMetadata {
minCompileSdk = 21
}
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

publishing {
multipleVariants {
allVariants()
withJavadocJar()
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
testOptions {
managedDevices {
localDevices {
register("pixel2api30") {
register("pixel2api34") {
device = "Pixel 2"
apiLevel = 34
systemImageSource = "aosp-atd"
Expand All @@ -79,3 +89,9 @@ kotlin.sourceSets {
}
}
}

publishing.publications.register("androidLib", MavenPublication::class) {
afterEvaluate {
from(components["default"])
}
}

0 comments on commit 461ad4a

Please sign in to comment.