Skip to content

Commit aba29a6

Browse files
committed
Migrate maven publication scripts
1 parent 5da9930 commit aba29a6

8 files changed

Lines changed: 72 additions & 150 deletions

File tree

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ plugins {
33
alias(libs.plugins.android.library) apply false
44
alias(libs.plugins.kotlin.android) apply false
55
alias(libs.plugins.compose.compiler) apply false
6-
alias(libs.plugins.nexusPlugin)
6+
alias(libs.plugins.nexus.plugin)
77
alias(libs.plugins.spotless)
88
alias(libs.plugins.dokka)
99
}
1010

11-
apply(from ="${rootDir}/scripts/publish-root.gradle")
11+
apply(from ="${rootDir}/scripts/publish-module.gradle.kts")
1212

1313
subprojects {
1414
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {

gradle.properties

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,30 @@ android.defaults.buildfeatures.shaders=false
4141
# resources declared in the library itself and none from the library's dependencies,
4242
# thereby reducing the size of the R class for that library
4343
# https://developer.android.com/studio/releases/gradle-plugin#4.1-nontransitive-r-class
44-
android.nonTransitiveRClass=true
44+
android.nonTransitiveRClass=true
45+
46+
## Maven Central Publication ##
47+
systemProp.org.gradle.internal.publish.checksums.insecure=true
48+
49+
# Increase timeout when pushing to Sonatype (otherwise we get timeouts)
50+
systemProp.org.gradle.internal.http.socketTimeout=120000
51+
52+
GROUP=com.github.skydoves
53+
54+
POM_URL=https://github.com/skydoves/sealedx/
55+
POM_SCM_URL=https://github.com/skydoves/sealedx/
56+
POM_SCM_CONNECTION=scm:git:git://github.com/skydoves/sealedx.git
57+
POM_SCM_DEV_CONNECTION=scm:git:git://github.com/skydoves/sealedx.git
58+
59+
POM_LICENCE_NAME=The Apache Software License, Version 2.0
60+
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
61+
POM_LICENCE_DIST=repo
62+
63+
POM_DEVELOPER_ID=skydoves
64+
POM_DEVELOPER_NAME=Jaewoong Eum
65+
POM_DEVELOPER_URL=https://github.com/skydoves/
66+
POM_DEVELOPER_EMAIL=skydoves2@gmail.com
67+
68+
SONATYPE_HOST=DEFAULT
69+
RELEASE_SIGNING_ENABLED=true
70+
SONATYPE_AUTOMATIC_RELEASE=true

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ kotlin = "2.1.10"
44
jvmTarget = "17"
55
kotlinpoet = "1.18.1"
66
ksp = "2.1.10-1.0.31"
7+
nexusPlugin = "0.31.0"
78
material = "1.12.0"
89
androidxActivity = "1.10.1"
910
androidxCompose = "1.8.1"
@@ -19,9 +20,8 @@ kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
1920
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
2021
dokka = { id = "org.jetbrains.dokka", version = "2.0.0" }
2122
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
22-
nexusPlugin = { id = "io.github.gradle-nexus.publish-plugin", version = "1.3.0" }
23+
nexus-plugin = { id = "com.vanniktech.maven.publish", version.ref = "nexusPlugin" }
2324
spotless = { id = "com.diffplug.spotless", version = "6.9.0" }
24-
kotlinBinaryCompatibilityValidator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version = "0.17.0" }
2525

2626
[libraries]
2727
agp = { module = "com.android.tools.build:gradle", version.ref = "agp" }

scripts/publish-module.gradle

Lines changed: 0 additions & 87 deletions
This file was deleted.

scripts/publish-module.gradle.kts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apply(plugin = "com.vanniktech.maven.publish")
2+
3+
rootProject.extra.apply {
4+
val snapshot = System.getenv("SNAPSHOT").toBoolean()
5+
val libVersion = if (snapshot) {
6+
Configuration.snapshotVersionName
7+
} else {
8+
Configuration.versionName
9+
}
10+
set("libVersion", libVersion)
11+
}

scripts/publish-root.gradle

Lines changed: 0 additions & 46 deletions
This file was deleted.

sealedx-core/build.gradle.kts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
plugins {
22
kotlin("jvm")
3+
id(libs.plugins.nexus.plugin.get().pluginId)
34
}
45

5-
rootProject.extra.apply {
6-
set("PUBLISH_GROUP_ID", Configuration.artifactGroup)
7-
set("PUBLISH_ARTIFACT_ID", "sealedx-core")
8-
set("PUBLISH_VERSION", rootProject.extra.get("rootVersionName"))
9-
}
6+
apply(from ="${rootDir}/scripts/publish-module.gradle.kts")
7+
8+
mavenPublishing {
9+
val artifactId = "sealedx-core"
10+
coordinates(
11+
Configuration.artifactGroup,
12+
artifactId,
13+
rootProject.extra.get("libVersion").toString()
14+
)
1015

11-
apply(from ="${rootDir}/scripts/publish-module.gradle")
16+
pom {
17+
name.set(artifactId)
18+
description.set("Kotlin Symbol Processor that auto-generates extensive sealed classes and interfaces for Android and Kotlin.")
19+
}
20+
}

sealedx-processor/build.gradle.kts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
plugins {
22
kotlin("jvm")
3+
id(libs.plugins.nexus.plugin.get().pluginId)
34
}
45

5-
rootProject.extra.apply {
6-
set("PUBLISH_GROUP_ID", Configuration.artifactGroup)
7-
set("PUBLISH_ARTIFACT_ID", "sealedx-processor")
8-
set("PUBLISH_VERSION", rootProject.extra.get("rootVersionName"))
9-
}
6+
apply(from ="${rootDir}/scripts/publish-module.gradle.kts")
7+
8+
mavenPublishing {
9+
val artifactId = "sealedx-processor"
10+
coordinates(
11+
Configuration.artifactGroup,
12+
artifactId,
13+
rootProject.extra.get("libVersion").toString()
14+
)
1015

11-
apply(from ="${rootDir}/scripts/publish-module.gradle")
16+
pom {
17+
name.set(artifactId)
18+
description.set("Kotlin Symbol Processor that auto-generates extensive sealed classes and interfaces for Android and Kotlin.")
19+
}
20+
}
1221

1322
dependencies {
1423
implementation(project(":sealedx-core"))

0 commit comments

Comments
 (0)