Skip to content

Commit 2897a0a

Browse files
committed
Add publishing logic and set version to 0.1.0
1 parent 7bb414e commit 2897a0a

File tree

6 files changed

+79
-11
lines changed

6 files changed

+79
-11
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
local.properties
2+
13
# Created by https://www.toptal.com/developers/gitignore/api/gradle,kotlin,intellij,swift
24
# Edit at https://www.toptal.com/developers/gitignore?templates=gradle,kotlin,intellij,swift
35

build.gradle.kts

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,77 @@ buildscript {
99
}
1010

1111
allprojects {
12+
group = "com.rickclephas.kmp"
13+
version = "0.1.0"
14+
1215
repositories {
1316
mavenCentral()
1417
}
18+
19+
ext["signing.keyId"] = null
20+
ext["signing.password"] = null
21+
ext["signing.secretKeyRingFile"] = null
22+
ext["ossrhUsername"] = null
23+
ext["ossrhPassword"] = null
24+
val localPropsFile = project.rootProject.file("local.properties")
25+
if (localPropsFile.exists()) {
26+
localPropsFile.reader()
27+
.use { java.util.Properties().apply { load(it) } }
28+
.onEach { (name, value) -> ext[name.toString()] = value }
29+
} else {
30+
ext["signing.keyId"] = System.getenv("SIGNING_KEY_ID")
31+
ext["signing.password"] = System.getenv("SIGNING_PASSWORD")
32+
ext["signing.secretKeyRingFile"] = System.getenv("SIGNING_SECRET_KEY_RING_FILE")
33+
ext["ossrhUsername"] = System.getenv("OSSRH_USERNAME")
34+
ext["ossrhPassword"] = System.getenv("OSSRH_PASSWORD")
35+
}
36+
37+
val emptyJavadocJar by tasks.registering(Jar::class) {
38+
archiveClassifier.set("javadoc")
39+
}
40+
41+
afterEvaluate {
42+
extensions.findByType<PublishingExtension>()?.apply publishingExtension@{
43+
repositories {
44+
maven {
45+
name = "sonatype"
46+
setUrl("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
47+
credentials {
48+
username = ext["ossrhUsername"]?.toString()
49+
password = ext["ossrhPassword"]?.toString()
50+
}
51+
}
52+
}
53+
54+
publications.withType<MavenPublication> {
55+
artifact(emptyJavadocJar.get())
56+
57+
pom {
58+
name.set("KMP-NativeCoroutines")
59+
description.set("Swift library for Kotlin Coroutines")
60+
url.set("https://github.com/rickclephas/KMP-NativeCoroutines")
61+
licenses {
62+
license {
63+
name.set("MIT")
64+
url.set("https://opensource.org/licenses/MIT")
65+
}
66+
}
67+
developers {
68+
developer {
69+
id.set("rickclephas")
70+
name.set("Rick Clephas")
71+
email.set("[email protected]")
72+
}
73+
}
74+
scm {
75+
url.set("https://github.com/rickclephas/KMP-NativeCoroutines")
76+
}
77+
}
78+
}
79+
80+
extensions.findByType<SigningExtension>()?.apply {
81+
sign(this@publishingExtension.publications)
82+
}
83+
}
84+
}
1585
}

kmp-nativecoroutines-core/build.gradle.kts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
plugins {
22
kotlin("multiplatform")
3+
`maven-publish`
4+
signing
35
}
46

5-
group = "com.rickclephas.kmp"
6-
version = "0.1.0-SNAPSHOT"
7-
87
kotlin {
98
jvm()
109
macosX64()

sample/Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ PODS:
22
- KMPNativeCoroutinesCombine (0.1.0):
33
- KMPNativeCoroutinesCore
44
- KMPNativeCoroutinesCore (0.1.0)
5-
- shared (0.1.0-SNAPSHOT)
5+
- shared (0.1.0)
66

77
DEPENDENCIES:
88
- KMPNativeCoroutinesCombine (from `../`)
@@ -18,9 +18,9 @@ EXTERNAL SOURCES:
1818
:path: "./shared"
1919

2020
SPEC CHECKSUMS:
21-
KMPNativeCoroutinesCombine: d3660dda94264185e56006b064c862c8e58e9dda
22-
KMPNativeCoroutinesCore: 1d92cbe2059fe7c3951ddff0f2ef5a364a8aee61
23-
shared: 4f6ad6cf7ce9f21e809b9db1798a12bb0ae682b4
21+
KMPNativeCoroutinesCombine: 2e60c258d60b8825262e148987750975f963143b
22+
KMPNativeCoroutinesCore: fc1db1c14e26fac6d675db37aa1f51dedf3d5074
23+
shared: 9c516b6ee865e88319a649a60e6175181d5621fa
2424

2525
PODFILE CHECKSUM: 7f1e43d0c1555df8202cbe830774e6b5b3fa3e4b
2626

sample/shared/build.gradle.kts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ plugins {
33
kotlin("native.cocoapods")
44
}
55

6-
group = "com.rickclephas.kmp"
7-
version = "0.1.0-SNAPSHOT"
8-
96
kotlin {
107
macosX64()
118
iosArm64()

sample/shared/shared.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |spec|
22
spec.name = 'shared'
3-
spec.version = '0.1.0-SNAPSHOT'
3+
spec.version = '0.1.0'
44
spec.homepage = 'https://github.com/rickclephas/KMP-NativeCoroutines'
55
spec.source = { :git => "Not Published", :tag => "Cocoapods/#{spec.name}/#{spec.version}" }
66
spec.authors = ''

0 commit comments

Comments
 (0)