-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
104 lines (89 loc) · 3.44 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
maven("https://kotlin.bintray.com/kotlinx")
}
dependencies {
classpath("com.android.tools.build:gradle:7.3.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.7.20")
}
}
allprojects {
group = "com.github.eliekarouz.feedbacktree"
version = System.getenv("GITHUB_REF_NAME")?.takeIf { it.isNotEmpty() } ?: "0.16.0"
repositories {
google()
mavenCentral()
maven("https://jitpack.io")
}
val javadocJar by tasks.registering(Jar::class) {
archiveClassifier.set("javadoc")
}
afterEvaluate {
extensions.findByType<PublishingExtension>()?.apply {
repositories {
maven {
name = "sonatype"
setUrl("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = properties["SONATYPE_NEXUS_USERNAME"]?.toString()
password = properties["SONATYPE_NEXUS_PASSWORD"]?.toString()
}
}
}
publications.withType<MavenPublication>().configureEach {
artifact(javadocJar.get())
pom {
name.set("feedbacktree")
description.set("Unidirectional architecture for Android")
url.set("https://github.com/eliekarouz/feedbacktree")
licenses {
license {
name.set("MIT License")
url.set("https://opensource.org/licenses/MIT")
distribution.set("repo")
}
}
developers {
developer {
id.set("eliekarouz")
name.set("Elie Karouz")
}
}
scm {
connection.set("scm:git:https://github.com/eliekarouz/feedbacktree")
developerConnection.set("scm:git:https://github.com/eliekarouz/feedbacktree")
url.set("https://github.com/eliekarouz/feedbacktree")
}
}
}
}
extensions.findByType<SigningExtension>()?.apply {
val publishing = extensions.findByType<PublishingExtension>() ?: return@apply
val key = properties["signingKey"]?.toString()?.replace("\\n", "\n")
println("signing")
useInMemoryPgpKeys(key, "")
sign(publishing.publications)
}
tasks.withType<Sign>().configureEach {
onlyIf { isReleaseBuild }
}
tasks.withType(org.jetbrains.dokka.gradle.DokkaTask::class.java) {
// multiplatform {
// extensions.findByType<org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension>()?.targets?.forEach {
// create(
// it.name
// )
// }
// }
}
}
}
val isReleaseBuild: Boolean
get() = properties.containsKey("signingKey")
tasks.register<Delete>("clean").configure {
delete(rootProject.buildDir)
}