-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
87 lines (78 loc) · 2.58 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "7.4.1" apply false
id("com.android.library") version "7.4.1" apply false
id("org.jetbrains.kotlin.android") version "1.7.20" apply false
id("org.jetbrains.dokka") version "1.7.20" apply false
}
buildscript {
dependencies {
classpath("io.github.porum:safe-kotlinx-coroutines-plugin:0.0.6")
}
}
configurations.configureEach {
resolutionStrategy.cacheChangingModulesFor(0, TimeUnit.SECONDS)
}
subprojects {
configurations.configureEach {
resolutionStrategy.cacheChangingModulesFor(0, TimeUnit.SECONDS)
}
if (name.startsWith("safe-kotlinx-coroutines")) {
pluginManager.withPlugin("maven-publish") {
val GROUP: String by project
val VERSION: String by project
val sonatypeUserName: String by project
val sonatypePassword: String by project
val publishExtension = extensions.getByType<PublishingExtension>()
publishExtension.repositories {
mavenLocal()
maven {
val url = if (VERSION.endsWith("-SNAPSHOT")) {
"https://s01.oss.sonatype.org/content/repositories/snapshots/"
} else {
"https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
}
setUrl(url)
credentials {
username = sonatypeUserName
password = sonatypePassword
}
}
}
publishExtension.publications.whenObjectAdded {
check(this is MavenPublication) {
"unexpected publication $this"
}
groupId = GROUP
version = VERSION
pom {
url.set("https://github.com/porum/safe-kotlinx-coroutines")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("porum")
name.set("guobao.sun")
email.set("sunguobao12@gmail.com")
}
}
scm {
url.set("https://github.com/porum/safe-kotlinx-coroutines.git")
}
}
}
}
}
tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = JavaVersion.VERSION_11.toString()
targetCompatibility = JavaVersion.VERSION_11.toString()
}
}
tasks.register<Delete>("clean") {
delete(rootProject.buildDir)
}