Skip to content

Commit 861216e

Browse files
author
azharkova
committed
Fix commit
1 parent 522a7a3 commit 861216e

24 files changed

+549
-18
lines changed

.gitignore

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,16 @@
22
/.gradle/
33
/build/
44
/build/classes/kotlin/ios/main/
5-
/build/classes/kotlin/jvm/main/
5+
/build/classes/kotlin/jvm/main/
6+
*.iml
7+
.gradle
8+
.idea
9+
.DS_Store
10+
build
11+
*/build
12+
captures
13+
.externalNativeBuild
14+
.cxx
15+
local.properties
16+
xcuserdata/
17+
Pods/

.idea/artifacts/di_multiplatform_lib_jvm_1_0_4_5.xml

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

.idea/gradle.xml

Lines changed: 14 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle.kts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
plugins {
22
kotlin("multiplatform") version "1.4.32"
3-
id("maven-publish")
4-
// id("convention.publication")
3+
//id("maven-publish")
4+
id("convention.publication")
55
}
66

77
group = "io.github.anioutkazharkova"
88
version = "1.0.4.5"
99

1010
repositories {
11-
jcenter()
1211
mavenCentral()
1312
}
1413

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
plugins {
2+
`kotlin-dsl` // Is needed to turn our build logic written in Kotlin into Gralde Plugin
3+
}
4+
5+
repositories {
6+
gradlePluginPortal() // To use 'maven-publish' and 'signing' plugins in our own plugin
7+
}

convention-plugins/gradle.properties

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

convention-plugins/local.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
# For customization when using a Version Control System, please read the
66
# header note.
77
#Sat Jan 30 22:59:41 GMT+07:00 2021
8-
signing.keyId=15EDFFBE
9-
signing.password=Multiplatform
8+
signing.keyId=SRf6d2NJ
9+
signing.password=iJmTNKuLYv+y2luyKwrFUa5SWWIa5XmKDVM2DIUt9D77
1010
signing.secretKeyRingFile=/Users/annazharkova/15EDFFBE.gpg
1111
ossrhUsername=anioutkazharkova
12-
ossrhPassword=Anna123456!!
12+
ossrhPassword=Anna123456!!
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
import org.gradle.api.publish.maven.MavenPublication
2+
import org.gradle.api.tasks.bundling.Jar
3+
import org.gradle.kotlin.dsl.`maven-publish`
4+
import org.gradle.kotlin.dsl.signing
5+
import java.util.*
6+
7+
plugins {
8+
`maven-publish`
9+
signing
10+
}
11+
12+
// Stub secrets to let the project sync and build without the publication values set up
13+
ext["signingKeyId"] = null
14+
ext["signingPassword"] = null
15+
ext["signingSecretKeyRingFile"] = null
16+
ext["ossrhUsername"] = null
17+
ext["ossrhPassword"] = null
18+
19+
// Grabbing secrets from local.properties file or from environment variables, which could be used on CI
20+
val secretPropsFile = project.rootProject.file("local.properties")
21+
if (secretPropsFile.exists()) {
22+
secretPropsFile.reader().use {
23+
Properties().apply {
24+
load(it)
25+
}
26+
}.onEach { (name, value) ->
27+
ext[name.toString()] = value
28+
}
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 javadocJar by tasks.registering(Jar::class) {
38+
archiveClassifier.set("javadoc")
39+
}
40+
41+
fun getExtraString(name: String) = ext[name]?.toString()
42+
43+
publishing {
44+
// Configure maven central repository
45+
repositories {
46+
maven {
47+
name = "sonatype"
48+
setUrl("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
49+
credentials {
50+
username = getExtraString("ossrhUsername")
51+
password = getExtraString("ossrhPassword")
52+
}
53+
}
54+
}
55+
56+
// Configure all publications
57+
publications.withType<MavenPublication> {
58+
59+
// Stub javadoc.jar artifact
60+
artifact(javadocJar.get())
61+
62+
// Provide artifacts information requited by Maven Central
63+
pom {
64+
name.set("DI Kotlin Multiplatform Library")
65+
description.set("DI Kotlin Multiplatform Library")
66+
url.set("https://github.com/anioutkazharkova/di-multiplatform-lib")
67+
68+
licenses {
69+
license {
70+
name.set("MIT")
71+
url.set("https://opensource.org/licenses/MIT")
72+
}
73+
}
74+
developers {
75+
developer {
76+
id.set("anioutkazharkova")
77+
name.set("Anna Zharkova")
78+
email.set("[email protected]")
79+
}
80+
}
81+
scm {
82+
url.set("https://github.com/anioutkazharkova/di-multiplatform-lib")
83+
}
84+
85+
}
86+
}
87+
}
88+
89+
signing {
90+
sign(publishing.publications)
91+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-milestone-2-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

settings.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
pluginManagement {
22
repositories {
33
google()
4-
jcenter()
54
gradlePluginPortal()
65
mavenCentral()
76
}
87
}
9-
//includeBuild("convention-plugins")
8+
includeBuild("convention-plugins")
109
rootProject.name = "di-multiplatform-lib"
1110

0 commit comments

Comments
 (0)