-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.gradle.kts
107 lines (92 loc) · 3.34 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
import org.jetbrains.kotlin.cli.common.toBooleanLenient
val isSnapshotUpload = System.getProperty("snapshot").toBooleanLenient() ?: false
val libVersion = "1.0.2"
val gitName = "abc-${project.name}"
group = "com.linecorp.abc"
version = if (isSnapshotUpload) "$libVersion-SNAPSHOT" else libVersion
buildscript {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
val kotlinVersion: String by project
val agpVersion: String by project
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
classpath("com.android.tools.build:gradle:$agpVersion")
}
}
allprojects {
ext {
set("compileSdkVersion", 30)
set("minSdkVersion", 21)
set("targetSdkVersion", 30)
}
repositories {
google()
mavenCentral()
}
}
subprojects {
group = rootProject.group
version = rootProject.version
repositories {
mavenCentral()
google()
}
pluginManager.withPlugin("maven-publish") {
val publishExtension = extensions.getByType<PublishingExtension>()
publishExtension.repositories {
maven {
url = if (isSnapshotUpload) {
uri("https://oss.sonatype.org/content/repositories/snapshots/")
} else {
uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
}
val sonatypeUsername: String? by project
val sonatypePassword: String? by project
println("sonatypeUsername, sonatypePassword -> $sonatypeUsername, ${sonatypePassword?.map { "*" }?.joinToString("")}")
credentials {
username = sonatypeUsername ?: ""
password = sonatypePassword ?: ""
}
}
}
publishExtension.publications.whenObjectAdded {
check(this is MavenPublication) {
"unexpected publication $this"
}
groupId = rootProject.group.toString()
version = rootProject.version.toString()
pom {
name.set(artifactId)
description.set("A local storage management library for Kotlin Multiplatform Mobile iOS and android")
url.set("https://github.com/line/$gitName")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
name.set("LINE Corporation")
email.set("[email protected]")
url.set("https://engineering.linecorp.com/en/")
}
developer {
id.set("pisces")
name.set("Steve Kim")
email.set("[email protected]")
}
}
scm {
connection.set("scm:[email protected]:line/$gitName.git")
developerConnection.set("scm:git:ssh://github.com:line/$gitName.git")
url.set("http://github.com/line/$gitName")
}
}
}
}
}