-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
158 lines (132 loc) · 4.39 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
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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'de.thetaphi:forbiddenapis:3.8'
}
}
plugins {
id 'java-library'
id 'maven-publish'
// https://github.com/researchgate/gradle-release
id 'net.researchgate.release' version '3.0.2'
id 'io.codearte.nexus-staging' version '0.30.0'
// https://gradle-pitest-plugin.solidsoft.info/
id 'info.solidsoft.pitest' version '1.9.11'
}
apply plugin: 'de.thetaphi.forbiddenapis'
apply plugin: 'jacoco'
apply plugin: 'signing'
sourceCompatibility = JavaVersion.VERSION_17
group = 'org.dstadler'
archivesBaseName = 'commons-test'
repositories {
mavenCentral()
}
forbiddenApis {
suppressAnnotations = ['org.dstadler.commons.util.SuppressForbidden']
bundledSignatures = [ 'jdk-reflection', 'commons-io-unsafe-2.15.1', 'jdk-internal' ]
}
forbiddenApisMain {
// 'jdk-unsafe', 'jdk-system-out'
bundledSignatures = [ 'jdk-deprecated', 'jdk-internal', 'jdk-non-portable' ]
}
configurations {
all*.exclude group: 'javax.mail', module:'mail' // not needed here
all*.exclude group: 'javax.activation', module:'activation' // not needed here
}
dependencies {
implementation 'org.apache.commons:commons-lang3:3.17.0'
implementation 'commons-io:commons-io:2.18.0'
implementation 'org.dstadler:commons-dost:1.3.4'
// dumbster is somewhat broken, but we use it in SafeCloseSmtpServer...
// dumbster includes javax.mail-api 1.3.2, but this has no jar?!
// also javax.mail-api 1.6.0-rc1 and newer causes MockSMTPServerTest.testSendEmail() to time out!
// probably because the old version of dumbster and our SafeCloseSmtpServer do not implement something...
api 'javax.mail:javax.mail-api:1.5.6'
api 'dumbster:dumbster:1.6'
// for TestHelpers we need junit during normal compile...
implementation 'org.junit.jupiter:junit-jupiter-engine:5.11.4'
testImplementation 'org.apache.commons:commons-email:1.5'
testImplementation 'com.sun.activation:javax.activation:1.2.0' // needed for JDK 11
}
wrapper {
gradleVersion = '8.5'
}
test {
systemProperties = System.properties as Map<String, ?>
// enable to show standard out and standard error of the test JVM(s) on the console
// testLogging.showStandardStreams = true
// http://forums.gradle.org/gradle/topics/jacoco_related_failure_in_multiproject_build
systemProperties['user.dir'] = workingDir
useJUnitPlatform()
}
jacoco {
toolVersion = '0.8.12'
}
jacocoTestReport {
reports {
xml.required = true
}
}
tasks.register('sourcesJar', Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allJava
}
tasks.register('javadocJar', Jar) {
archiveClassifier = 'javadoc'
from javadoc
}
java {
withJavadocJar()
withSourcesJar()
}
release {
git {
requireBranch.set('master')
}
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = archivesBaseName
from components.java
pom {
name = 'Common Test Utilities'
description = 'Common testing utilities I find useful in many of my projects.'
url = 'https://github.com/centic9/commons-test'
licenses {
license {
name = 'BSD 2-Clause "Simplified" License'
url = 'https://github.com/centic9/commons-test/blob/master/LICENSE.md'
}
}
developers {
developer {
id = 'centic9'
name = 'Dominik Stadler'
}
}
scm {
connection = 'scm:[email protected]:centic9/commons-test'
developerConnection = 'scm:[email protected]:centic9/commons-test'
url = 'https://github.com/centic9/commons-test'
}
}
}
}
repositories {
maven {
// change to point to your repo, e.g. http://my.org/repo
//url = layout.buildDirectory.dir('repo')
url = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
credentials(PasswordCredentials)
//snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots/')
}
}
}
signing {
sign publishing.publications.mavenJava
}
afterReleaseBuild.dependsOn publish