-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.old
162 lines (129 loc) · 3.66 KB
/
build.gradle.old
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
plugins {
id 'java'
id 'maven-publish'
id 'jacoco'
id 'io.freefair.lombok' version '5.1.0'
id 'signing'
id 'io.codearte.nexus-staging' version '0.21.2'
}
group = 'com.kasisoft'
description = 'KCL :: Kasisoft Common Library'
version = '4.2-SNAPSHOT'
def isSnapshot = version.endsWith('-SNAPSHOT')
def isRelease = !isSnapshot;
buildDir = 'target'
sourceCompatibility = '14'
compileJava.options.fork = true
if (isRelease) {
def pw = findProperty('signing.password')
if ((pw == null) || (pw.length() == 0)) {
throw new GradleException('Signing for a release requires as password (signing.password)')
}
def keyId = findProperty('signing.keyId')
if ((keyId == null) || (keyId.length() == 0)) {
throw new GradleException('Signing for a release requires as keyId (signing.keyId)')
}
def ringFile = findProperty('signing.secretKeyRingFile')
if ((ringFile == null) || (ringFile.length() == 0)) {
throw new GradleException('Signing for a release requires as key ring file (signing.secretKeyRingFile; binary version)')
}
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
testImplementation 'com.h2database:h2:1.4.192'
testImplementation 'org.hamcrest:hamcrest-all:1.3'
testImplementation 'org.testng:testng:7.0.0'
testImplementation 'jakarta.validation:jakarta.validation-api:2.0.2'
compileOnly 'jakarta.validation:jakarta.validation-api:2.0.2'
}
configurations.all {
resolutionStrategy {
failOnVersionConflict()
preferProjectModules()
}
}
lombok {
version = '1.18.12'
}
jacoco {
toolVersion = '0.8.5'
reportsDir = file("$buildDir/customJacocoReportDir")
}
java {
withSourcesJar()
withJavadocJar()
}
// https://docs.gradle.org/current/samples/sample_java_modules_multi_project.html [03-JUL-2020]
plugins.withType(JavaPlugin).configureEach {
java {
modularity.inferModulePath = true
}
}
publishing {
publications {
maven(MavenPublication) {
from(components.java)
}
}
repositories {
maven {
name = 'GitHubPackages'
url = 'https://maven.pkg.github.com/kasisoft/kcl'
credentials {
username = System.getenv('GITHUB_ACTOR')
password = System.getenv('GITHUB_TOKEN')
}
}
}
}
generatePomFileForMavenPublication {
pom.name = 'KCL :: Kasisoft Common Library'
pom.description = 'Collection of general purpose functionalities.'
pom.url = 'https://kasisoft.github.io/kcl/'
pom.organization({
name = 'Kasisoft'
url = 'https://kasisoft.com'
})
pom.license({
name = 'MIT License'
url = 'https://choosealicense.com/licenses/mit'
})
pom.developer({
id = 'costamojan'
name = 'Daniel Kasmeroglu'
email = '[email protected]'
})
pom.scm({
connection = 'scm:git:https://github.com/kasisoft/kcl.git'
developerConnection = 'scm:git:https://github.com/kasisoft/kcl.git'
url = 'https://kasisoft.github.io/kcl'
})
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
javadoc.options {
addStringOption('-release', '14')
addStringOption('Xdoclint:none', '-quiet')
}
test {
exclude 'com/kasisoft/libs/common/graphics/**'
useTestNG()
jvmArgs(['-Duser.country=DE', '-Duser.language=de'])
finalizedBy jacocoTestReport
}
jacocoTestReport {
dependsOn test
reports {
xml.enabled false
csv.enabled false
html.destination file("${buildDir}/jacocoHtml")
}
}
signing {
required { isRelease }
sign publishing.publications.maven
}