forked from google/ksp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
73 lines (72 loc) · 2.43 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
import com.google.devtools.ksp.configureKtlint
import com.google.devtools.ksp.configureKtlintApplyToIdea
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
if (!extra.has("kspVersion")) {
val kotlinBaseVersion: String by project
val today = LocalDateTime.now().format(DateTimeFormatter.BASIC_ISO_DATE)
extra.set("kspVersion", "$kotlinBaseVersion-dev-experimental-$today")
}
repositories {
mavenCentral()
}
project.configureKtlintApplyToIdea()
subprojects {
group = "com.google.devtools.ksp"
version = rootProject.extra.get("kspVersion") as String
this.configureKtlint()
repositories {
mavenCentral()
google()
maven("https://dl.bintray.com/kotlin/kotlin-eap")
jcenter()
}
tasks.withType<Jar>().configureEach {
manifest.attributes.apply {
put("Implementation-Vendor", "Google")
put("Implementation-Version", project.version)
}
}
pluginManager.withPlugin("maven-publish") {
val publishExtension = extensions.getByType<PublishingExtension>()
publishExtension.repositories {
if (extra.has("outRepo")) {
val outRepo = extra.get("outRepo") as String
maven {
url = File(outRepo).toURI()
}
} else {
mavenLocal()
}
maven {
name = "test"
url = uri("${rootProject.buildDir}/repos/test")
}
}
publishExtension.publications.whenObjectAdded {
check(this is MavenPublication) {
"unexpected publication $this"
}
val publication = this
publication.pom {
url.set("https://goo.gle/ksp")
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("KSP Team")
}
}
scm {
connection.set("scm:git:https://github.com/google/ksp.git")
developerConnection.set("scm:git:https://github.com/google/ksp.git")
url.set("https://github.com/google/ksp")
}
}
}
}
}