-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle.kts
126 lines (108 loc) · 3.44 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.5.10"
jacoco
`maven-publish`
signing
id("org.jlleitschuh.gradle.ktlint") version "8.2.0"
}
group = "com.johnowl"
version = "1.3." + System.getenv("CIRCLE_BUILD_NUM")
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation("com.github.h0tk3y.betterParse:better-parse-jvm:0.4.1")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.3.1")
testImplementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.3.1")
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
jacoco {
toolVersion = "0.8.2"
}
tasks {
test {
useJUnitPlatform()
}
jacocoTestReport {
isEnabled = true
reports {
html.isEnabled = true
xml.isEnabled = true
}
}
jacocoTestCoverageVerification {
violationRules {
rule { limit { minimum = BigDecimal.valueOf(0.1) } }
}
}
check {
dependsOn(jacocoTestCoverageVerification)
dependsOn(jacocoTestReport)
}
}
val javadocJar by tasks.creating(Jar::class) {
archiveClassifier.value("javadoc")
from(tasks.javadoc.get().destinationDir)
}
val sourcesJar by tasks.creating(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.main.get().allJava)
}
val publicationName = "maven"
publishing {
publications {
create<MavenPublication>(publicationName) {
groupId = group.toString()
artifactId = "owl-rules"
version = version
from(components["java"])
artifact(javadocJar)
artifact(sourcesJar)
pom {
name.set("Owl Rules")
description.set("Rule engine processor with a friendly programming language")
url.set("https://github.com/johnowl/owl-rules")
licenses {
license {
name.set("MIT License")
url.set("https://github.com/git/git-scm.com/blob/main/MIT-LICENSE.txt")
}
}
developers {
developer {
id.set("johnowl")
name.set("João Paulo Gomes")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:git:github.com/johnowl/owl-rules.git")
developerConnection.set("scm:git:ssh:github.com/johnowl/owl-rules.git")
url.set("https://github.com/johnowl/owl-rules")
}
}
}
}
repositories {
maven {
name = "central"
val releasesRepoUrl = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
val snapshotsRepoUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
val mavenUsername: String? by project
val mavenPassword: String? by project
credentials {
username = mavenUsername
password = mavenPassword
}
}
}
}
signing {
sign(publishing.publications[publicationName])
}