-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
118 lines (99 loc) · 3.11 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
plugins {
kotlin("jvm")
id("org.jetbrains.dokka") version "1.9.20"
`maven-publish`
signing
java
}
subprojects {
apply(plugin = "org.jetbrains.dokka")
apply(plugin = "maven-publish")
apply(plugin = "signing")
apply(plugin = "java")
}
repositories {
mavenCentral()
}
dependencies {
compileOnly(kotlin("compiler"))
}
kotlin {
compilerOptions {
optIn.add("org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi")
}
}
tasks.test {
useJUnitPlatform()
}
allprojects {
group = "com.sschr15.aoc"
if (System.getenv("VERSION") != null) {
version = System.getenv("VERSION")
}
val dokkaJar by tasks.registering(Jar::class) {
archiveClassifier.set("javadoc")
from(tasks.dokkaHtml)
}
val sourcesJar by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.getByName("main").allSource)
}
signing {
val signingKey = System.getenv("SIGNING_KEY")
val signingPassword = System.getenv("SIGNING_PASSWORD")
if (signingKey != null && signingPassword != null) {
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications)
}
}
tasks.withType<PublishToMavenRepository> {
mustRunAfter(tasks.withType<Sign>())
}
publishing {
val publication by publications.registering(MavenPublication::class) {
from(components["java"])
artifact(dokkaJar) {
classifier = "javadoc"
}
artifact(sourcesJar) {
classifier = "sources"
}
pom {
licenses {
license {
name.set("MIT License")
url.set("https://opensource.org/licenses/MIT")
}
}
name = "AoC Utility Kotlin Compiler Plugin"
description = "Adds some utilities to code, developed originally for Advent of Code solving"
url = "https://github.com/sschr15/advent-of-code/"
developers {
developer {
name = "sschr15"
email = "[email protected]"
url = "https://sschr15.com"
timezone = "America/Chicago"
}
}
scm {
connection = [email protected]().replace("https", "scm:git:git")
developerConnection = connection.get().replace("git://", "ssh://")
url = [email protected]
}
}
}
repositories {
if (System.getenv("MAVEN_URL") != null) {
maven(System.getenv("MAVEN_URL")) {
if (System.getenv("MAVEN_USERNAME") != null) {
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
}
}
}
}