forked from digitalpetri/strict-machine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
127 lines (103 loc) · 3.37 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
119
120
121
122
123
124
125
126
127
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
`java-library`
kotlin("jvm") version "1.4.30"
`maven-publish`
signing
}
group = "com.digitalpetri.fsm"
version = "0.6-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
// BYO SLF4J
compileOnly("org.slf4j:slf4j-api:1.7.+")
testImplementation(kotlin("stdlib", "1.4.30"))
testImplementation("org.junit.jupiter:junit-jupiter-api:5.3.1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.3.1")
testRuntimeOnly("org.slf4j:slf4j-simple:1.7.25")
}
tasks {
withType<JavaCompile> {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
}
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
withType<Test> {
useJUnitPlatform()
testLogging {
events("PASSED", "FAILED", "SKIPPED")
}
}
}
task<Jar>("sourcesJar") {
from(sourceSets.main.get().allJava)
classifier = "sources"
}
task<Jar>("javadocJar") {
from(tasks.javadoc)
classifier = "javadoc"
}
tasks.withType<Jar> {
manifest {
attributes("Automatic-Module-Name" to "com.digitalpetri.strictmachine")
}
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
artifactId = "strict-machine"
from(components["java"])
artifact(tasks["sourcesJar"])
artifact(tasks["javadocJar"])
pom {
name.set("Strict Machine")
description.set("A declarative DSL for building asynchronously evaluated Finite State Machines on the JVM")
url.set("https://github.com/digitalpetri/strict-machine")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("kevinherron")
name.set("Kevin Herron")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:git://github.com.com/digitalpetri/strict-machine.git")
developerConnection.set("scm:git:ssh://github.com.com/digitalpetri/strict-machine.git")
url.set("https://github.com/digitalpetri/strict-machine")
}
}
}
}
repositories {
maven {
credentials {
username = project.findProperty("ossrhUsername") as String?
password = project.findProperty("ossrhPassword") as String?
}
// change URLs to point to your repos, e.g. http://my.org/repo
val releasesRepoUrl = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
val snapshotsRepoUrl = uri("https://oss.sonatype.org/content/repositories/snapshots/")
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
}
mavenLocal()
}
}
signing {
useGpgCmd()
sign(publishing.publications["mavenJava"])
}
tasks.javadoc {
if (JavaVersion.current().isJava9Compatible) {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
}
}