Skip to content

Commit 36a3ed1

Browse files
committed
Configure release tasks
1 parent c98f669 commit 36a3ed1

File tree

9 files changed

+81
-150
lines changed

9 files changed

+81
-150
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@
1515
local.properties
1616
/SecretRingKey.gpg
1717
/secring.gpg
18-
/zoomables_testing
18+
/zoomables_testing
19+
/buildSrc/src/main/kotlin/myPublishData.kt

.idea/gradle.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle.kts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,14 @@ tasks.create<Delete>("clean") {
1111
delete(rootProject.buildDir)
1212
}
1313

14-
apply(from = "${rootDir}/scripts/publish-root.gradle")
14+
nexusPublishing {
15+
this.repositories {
16+
sonatype {
17+
stagingProfileId.set(publishData.sonatypeStagingProfileId)
18+
username.set(publishData.ossrh.username)
19+
password.set(publishData.ossrh.password)
20+
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
21+
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
22+
}
23+
}
24+
}

buildSrc/build.gradle.kts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
plugins {
2+
`kotlin-dsl`
3+
}
4+
5+
repositories {
6+
mavenCentral()
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
data class PublishData(val signing: Signing, val artifact: Artifact, val ossrh: OSSRH, val sonatypeStagingProfileId: String)
2+
3+
data class Signing(val keyname: String, val passphrase: String, val executable: String)
4+
5+
data class Artifact(val group: String, val version: String, val id: String)
6+
7+
data class OSSRH(val username: String, val password: String)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
val artifact = Artifact(
2+
group = "de.mr-pine.utils",
3+
id = "zoomables",
4+
version = "1.2.0"
5+
)

scripts/publish-module.gradle

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

scripts/publish-root.gradle

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

zoomables/build.gradle.kts

Lines changed: 48 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ plugins {
55
kotlin("android")
66
`maven-publish`
77
alias(libs.plugins.dokka)
8+
signing
89
}
910

1011
android {
@@ -39,15 +40,22 @@ android {
3940
buildFeatures {
4041
compose = true
4142
}
43+
4244
namespace = "de.mr_pine.zoomables"
45+
46+
publishing {
47+
singleVariant("release") {
48+
withSourcesJar()
49+
withJavadocJar()
50+
}
51+
}
4352
}
4453

4554
tasks.withType<KotlinCompile> {
4655
kotlinOptions.freeCompilerArgs += listOf("-Xexplicit-api=strict")
4756
}
4857

4958
dependencies {
50-
5159
implementation(libs.androidx.ktx)
5260
implementation(libs.compose.ui)
5361
implementation(libs.compose.ui.util)
@@ -57,29 +65,47 @@ dependencies {
5765
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
5866
}
5967

60-
/*ext {
61-
PUBLISH_GROUP_ID = "de.mr-pine.utils"
62-
PUBLISH_VERSION = "1.1.2"
63-
PUBLISH_ARTIFACT_ID = "zoomables"
64-
}*/
68+
publishing {
69+
publications {
70+
register<MavenPublication>("zoomables") {
71+
groupId = publishData.artifact.group
72+
artifactId = publishData.artifact.id
73+
version = publishData.artifact.version
74+
75+
afterEvaluate {
76+
from(components["release"])
77+
}
6578

66-
//apply(from = "${rootProject.projectDir}/scripts/publish-module.gradle")
79+
pom {
80+
description.set("A library provides Composables that handle nice and smooth zooming behaviour for you")
81+
name.set(publishData.artifact.id)
82+
url.set("https://github.com/Mr-Pine/Zoomables")
6783

68-
// Because the components are created only during the afterEvaluate phase, you must
69-
// configure your publications using the afterEvaluate() lifecycle method.
70-
/*
71-
afterEvaluate {
72-
publishing {
73-
publications {
74-
mavenLocal(MavenPublication) {
75-
// Applies the component for the release build variant.
76-
from(components.release)
77-
78-
// You can then customize attributes of the publication as shown below.
79-
groupId = PUBLISH_GROUP_ID
80-
artifactId = PUBLISH_ARTIFACT_ID
81-
version = PUBLISH_VERSION
84+
licenses {
85+
license {
86+
name.set("Apache License 2.0")
87+
url.set("https://github.com/Mr-Pine/Zoomables/blob/master/LICENSE")
88+
}
89+
}
90+
91+
developers {
92+
developer {
93+
id.set("Mr-Pine")
94+
}
95+
}
96+
97+
scm {
98+
connection.set("scm:git:github.com/Mr-Pine/Zoomables.git")
99+
developerConnection.set("scm:git:ssh://github.com/Mr-Pine/Zoomables.git")
100+
url.set("https://github.com/Mr-Pine/Zoomables")
101+
}
82102
}
83103
}
104+
84105
}
85-
}*/
106+
}
107+
108+
signing {
109+
useGpgCmd()
110+
sign(publishing.publications)
111+
}

0 commit comments

Comments
 (0)