forked from RikkaApps/MaterialThemeBuilder
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
87 lines (80 loc) · 3.29 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
task("clean", type = Delete::class) {
delete(buildDir)
}
subprojects {
group = "dev.rikka.tools.materialthemebuilder"
version = "1.4.0"
plugins.withId("java") {
println("- Configuring `java`")
extensions.configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
tasks.register("sourcesJar", type = Jar::class) {
archiveClassifier.set("sources")
from(project.extensions.getByType<SourceSetContainer>().getByName("main").allSource)
}
tasks.register("javadocJar", type = Jar::class) {
archiveClassifier.set("javadoc")
from(tasks["javadoc"])
}
tasks.withType(Javadoc::class) {
isFailOnError = false
}
}
plugins.withId("maven-publish") {
println("- Configuring `publishing`")
afterEvaluate {
extensions.configure<PublishingExtension> {
publications {
withType(MavenPublication::class) {
version = project.version.toString()
group = project.group.toString()
pom {
name.set("MaterialThemeBuilder")
description.set("A gradle plugin that generates Material Design 3 themes for Android projects.")
url.set("https://github.com/RikkaApps/MaterialThemeBuilder/")
licenses {
license {
name.set("MIT License")
url.set("https://raw.githubusercontent.com/RikkaApps/MaterialThemeBuilder/master/LICENSE")
}
}
developers {
developer {
name.set("RikkaW")
}
}
scm {
connection.set("scm:git:https://github.com/RikkaApps/MaterialThemeBuilder.git")
url.set("https://github.com/RikkaApps/MaterialThemeBuilder/")
}
}
}
}
repositories {
mavenLocal()
maven {
name = "ossrh"
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2")
credentials(PasswordCredentials::class.java)
}
}
}
}
plugins.withId("signing") {
println("- Configuring `signing`")
afterEvaluate {
extensions.configure<SigningExtension> {
if (findProperty("signing.gnupg.keyName") != null) {
useGpgCmd()
val signingTasks = sign(extensions.getByType<PublishingExtension>().publications)
tasks.withType(AbstractPublishToMaven::class) {
dependsOn(signingTasks)
}
}
}
}
}
}
}