-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle.kts
61 lines (50 loc) · 1.53 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
buildscript {
repositories {
mavenLocal()
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.4.2")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.0")
}
}
val versions = mapOf(
"httpclient" to "5.4.1",
"assertj" to "3.26.3"
)
allprojects {
group = "com.github.ok2c.hc5.android"
version = "0.3.1-SNAPSHOT"
repositories {
mavenLocal()
google()
mavenCentral()
}
extra["releaseVersion"] = !version.toString().endsWith("-SNAPSHOT")
extra["versions"] = versions
}
subprojects {
afterEvaluate {
val releaseVersion: Boolean by project.extra
apply<MavenPublishPlugin>()
configure<PublishingExtension> {
repositories {
maven {
val releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
val snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = uri(if (releaseVersion) releasesRepoUrl else snapshotsRepoUrl)
if (project.extra.has("ossrh.user")) {
credentials {
username = project.extra["ossrh.user"] as String
password = project.extra["ossrh.password"] as String
}
}
}
}
}
}
}
tasks.register<Delete>("clean") {
delete(rootProject.buildDir)
}