-
Notifications
You must be signed in to change notification settings - Fork 83
/
common.gradle
110 lines (99 loc) · 3.57 KB
/
common.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
apply plugin: libs.plugins.taskInfo.get().pluginId
allprojects {
apply plugin: 'maven-publish'
group = 'org.bonitasoft.engine'
tasks.withType(Copy).configureEach {
setDuplicatesStrategy(DuplicatesStrategy.INCLUDE)
}
publishing {
repositories {
if (project.hasProperty("altDeploymentRepository")) {
def repoProperties = project.getProperties()."altDeploymentRepository".split("::")
maven {
name = repoProperties.first()
url = repoProperties.last()
//those credentials can be given using -P<repo_name>Username and -P<repo_name>Password see README.md
credentials(PasswordCredentials)
}
}
}
}
}
subprojects {
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'com.adarshr.test-logger'
repositories {
mavenCentral()
if (project.hasProperty("extraRepositories")) {
def extraRepositories = project.getProperties().get("extraRepositories")
extraRepositories.split(",").each { repo ->
def repoProperties = repo.split("::")
maven {
name = repoProperties.first()
url = repoProperties.last()
//those credentials can be given using -P<repo_name>Username and -P<repo_name>Password see README.md
credentials(PasswordCredentials)
}
}
}
// related to ehcache-core 2.x - must be challenged when upgrading to ehcache 3.x
// needed to get org.terracotta.internal:statistics:1.0.5 (required by ehcache-core jar)
maven {
url 'https://repo.terracotta.org/maven2/'
}
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
mavenContent {
snapshotsOnly()
}
}
mavenLocal()
}
dependencies {
testImplementation libs.junit5api
testCompileOnly libs.junit4
testRuntimeOnly libs.junitJupiterEngine
// to support junit4 tests
testRuntimeOnly libs.junitVintageEngine
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
afterEvaluate {
tasks.withType(AbstractCompile).configureEach { options.encoding = 'UTF-8' }
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.fork = true
}
tasks.withType(Javadoc).configureEach {
options.addStringOption('Xdoclint:none', '-quiet')
options.encoding = 'UTF-8'
}
tasks.withType(DependencyReportTask).configureEach {
group "Documentation"
description "List runtime dependencies for a specified configuration"
configurations = [project.configurations.runtimeClasspath]
}
// Configure all test tasks (test, integrationTest, httpIT, databaseTest)
tasks.withType(Test).configureEach {
useJUnitPlatform {
includeEngines 'junit-jupiter', 'junit-vintage'
}
jvmArgs += ['--add-opens', 'java.base/java.util=ALL-UNNAMED', '--add-opens', 'java.base/java.lang=ALL-UNNAMED', '-Dfile.encoding=UTF-8']
if (!project.hasProperty("createTestReports")) {
reports.html.required = false
reports.junitXml.required = false
}
}
testlogger {
showFullStackTraces false
showCauses true
showPassed false
showSkipped true
showSummary false
}
}