-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
118 lines (103 loc) · 3.65 KB
/
build.gradle
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 {
id 'java-library'
id 'org.jetbrains.kotlin.jvm' version '1.4.32'
id 'maven-publish'
id 'signing'
id 'io.gitlab.arturbosch.detekt' version '1.16.0'
}
group 'com.mthaler'
version '0.3'
repositories {
mavenCentral()
jcenter {
content {
// just allow to include kotlinx projects
// detekt needs 'kotlinx-html' for the html report
includeGroup "org.jetbrains.kotlinx"
}
}
}
test {
useJUnitPlatform()
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "1.8"
}
}
java {
withJavadocJar()
withSourcesJar()
}
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'history'
from components.java
pom {
name = 'History'
description = 'A simple class to store history and implement undo / redo functionality'
url = 'https://github.com/mthaler/history'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'm_t'
name = 'Michael Thaler'
url = 'https://github.com/mthaler/'
}
}
scm {
connection = 'scm:git:https://github.com/mthaler/history.git'
developerConnection = 'scm:git:https://github.com/mthaler/history.git'
url = 'https://github.com/mthaler/history'
}
}
}
}
repositories {
maven {
def releaseRepo = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotRepo = "https://oss.sonatype.org/content/repositories/snapshots/"
url = isReleaseVersion ? releaseRepo : snapshotRepo
credentials {
username = project.hasProperty('ossrhUsername') ? ossrhUsername : "Unknown user"
password = project.hasProperty('ossrhPassword') ? ossrhPassword : "Unknown password"
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
tasks.withType(Sign) {
onlyIf { isReleaseVersion }
}
javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
detekt {
buildUponDefaultConfig = true // preconfigure defaults
allRules = false // activate all available (even unstable) rules.
config = files("$projectDir/config/detekt.yml") // point to your custom config defining rules to run, overwriting default behavior
baseline = file("$projectDir/config/baseline.xml") // a way of suppressing issues before introducing detekt
reports {
html.enabled = true // observe findings in your browser with structure and code snippets
xml.enabled = true // checkstyle like format mainly for integrations like Jenkins
txt.enabled = true // similar to the console output, contains issue signature to manually edit baseline files
sarif.enabled = true // standardized SARIF format (https://sarifweb.azurewebsites.net/) to support integrations with Github Code Scanning
}
}
tasks.detekt.jvmTarget = "1.8"
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib'
testImplementation 'io.kotest:kotest-runner-junit5:4.3.2'
testImplementation 'io.kotest:kotest-assertions-core:4.3.2'
}