Skip to content

Commit 088907b

Browse files
committed
update project config
1 parent e89b304 commit 088907b

File tree

4 files changed

+37
-29
lines changed

4 files changed

+37
-29
lines changed

build.gradle.kts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
22
* Copyright 2025 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
33
*/
4+
apply(plugin = "dev.icerock.moko.gradle.publication.nexus")
45

56
buildscript {
67
repositories {
@@ -15,13 +16,18 @@ buildscript {
1516
gradlePluginPortal()
1617
}
1718
dependencies {
19+
classpath(libs.mokoGradlePlugin)
1820
classpath(":javascript-build-logic")
1921
}
2022
}
2123

24+
val mokoVersion = moko.versions.mokoJavascriptVersion.get()
2225
allprojects {
23-
plugins.withId("org.gradle.maven-publish") {
24-
group = "dev.icerock.moko"
25-
version = moko.versions.mokoJavascriptVersion.get()
26-
}
27-
}
26+
group = "dev.icerock.moko"
27+
version = mokoVersion
28+
}
29+
30+
tasks.register("clean", Delete::class).configure {
31+
group = "build"
32+
delete(rootProject.layout.buildDirectory)
33+
}

gradle/libs.versions.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ kotlinGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", ver
3434
androidGradlePlugin = { module = "com.android.tools.build:gradle", version.ref = "androidGradleVersion" }
3535
detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detektVersion" }
3636
detektPlugin = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", version.ref = "detektVersion" }
37+
mokoGradlePlugin = { module = "dev.icerock.moko:moko-gradle-plugin", version = "0.5.1" }

javascript-build-logic/src/main/kotlin/publication-convention.gradle.kts

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,14 @@
11
/*
2-
* Copyright 2021 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright 2025 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
import java.util.Base64
66

77
plugins {
8-
id("javadoc-stub-convention")
98
id("org.gradle.maven-publish")
10-
id("signing")
119
}
1210

1311
publishing {
14-
repositories.maven("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") {
15-
name = "OSSRH"
16-
17-
credentials {
18-
username = System.getenv("OSSRH_USER")
19-
password = System.getenv("OSSRH_KEY")
20-
}
21-
}
22-
2312
publications.withType<MavenPublication> {
2413
// Provide artifacts information requited by Maven Central
2514
pom {
@@ -61,15 +50,22 @@ publishing {
6150
}
6251
}
6352

53+
val signingKeyId: String? = System.getenv("SIGNING_KEY_ID")
54+
if (signingKeyId != null) {
55+
apply(plugin = "signing")
56+
57+
configure<SigningExtension> {
58+
val signingPassword: String? = System.getenv("SIGNING_PASSWORD")
59+
val signingKey: String? = System.getenv("SIGNING_KEY")?.let { base64Key ->
60+
String(Base64.getDecoder().decode(base64Key))
61+
}
6462

65-
signing {
66-
val signingKeyId: String? = System.getenv("SIGNING_KEY_ID")
67-
val signingPassword: String? = System.getenv("SIGNING_PASSWORD")
68-
val signingKey: String? = System.getenv("SIGNING_KEY")?.let { base64Key ->
69-
String(Base64.getDecoder().decode(base64Key))
70-
}
71-
if (signingKeyId != null) {
7263
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
7364
sign(publishing.publications)
7465
}
66+
67+
val signingTasks = tasks.withType<Sign>()
68+
tasks.withType<AbstractPublishToMaven>().configureEach {
69+
dependsOn(signingTasks)
70+
}
7571
}

javascript/build.gradle.kts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,21 @@ plugins {
1212

1313
android {
1414
namespace = "dev.icerock.moko.javascript"
15-
testOptions.unitTests.isIncludeAndroidResources = true
15+
1616
defaultConfig {
1717
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
1818
}
1919

20+
testOptions {
21+
unitTests.isIncludeAndroidResources = true
22+
}
23+
2024
sourceSets {
21-
getByName("test").java.srcDirs(
22-
file("src/androidAndroidTest/kotlin"),
23-
file("src/mobileDeviceTest/kotlin")
24-
)
25+
getByName("test") {
26+
java.srcDirs(
27+
"src/mobileDeviceTest/kotlin"
28+
)
29+
}
2530
}
2631
}
2732

0 commit comments

Comments
 (0)