-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
106 lines (93 loc) · 2.65 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
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
signing
java
`maven-publish`
kotlin("jvm")
id("org.jetbrains.dokka")
id("io.github.gradle-nexus.publish-plugin")
id("io.gitlab.arturbosch.detekt")
}
group = "tel.schich"
version = "1.0.0-SNAPSHOT"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}
repositories {
mavenCentral()
}
dependencies {
implementation("tel.schich:parser-kombinator:0.3.1")
testImplementation(kotlin("test"))
}
tasks.withType<Test> {
useJUnitPlatform()
val traceProperty = "tel.schich.parser-kombinator.trace"
systemProperties[traceProperty] = System.getProperty(traceProperty)
}
tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget = JvmTarget.JVM_1_8
}
}
val sourcesJar by tasks.creating(Jar::class) {
dependsOn(JavaPlugin.CLASSES_TASK_NAME)
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)
}
val javadocJar by tasks.creating(Jar::class) {
dependsOn(tasks.dokkaJavadoc)
archiveClassifier.set("javadoc")
from(tasks.dokkaJavadoc)
}
fun isSnapshot() = version.toString().endsWith("-SNAPSHOT")
publishing {
repositories {
maven {
name = "cubyte"
url = uri("https://maven.cubyte.org/repository/${if (isSnapshot()) "snapshots" else "releases"}/")
}
}
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
artifact(sourcesJar)
artifact(javadocJar)
pom {
name.set("rfc5988")
description.set("A simple RFC 5988 parser.")
url.set("https://github.com/pschichtel/rfc5988")
licenses {
license {
name.set("MIT")
url.set("https://opensource.org/licenses/MIT")
}
}
developers {
developer {
id.set("pschichtel")
name.set("Phillip Schichtel")
email.set("phillip@schich.tel")
}
}
scm {
url.set("https://github.com/pschichtel/rfc5988")
connection.set("scm:git:https://github.com/pschichtel/rfc5988")
developerConnection.set("scm:git:git@github.com:pschichtel/rfc5988")
}
}
}
}
}
signing {
useGpgCmd()
sign(publishing.publications["mavenJava"])
}
nexusPublishing {
repositories {
sonatype()
}
}