Repository navigation
Expand file tree
/
Copy pathproject.gradle
More file actions
209 lines (179 loc) · 6.17 KB
/
Copy pathproject.gradle
File metadata and controls
209 lines (179 loc) · 6.17 KB
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
// Common configuration applied to all projects
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.gradle.ext.JUnit
import java.nio.file.Files
import java.nio.file.Paths
import java.nio.file.attribute.PosixFileAttributes
import java.nio.file.attribute.PosixFilePermission
import java.util.stream.Collectors
import java.util.stream.StreamSupport
import static org.apache.tools.ant.taskdefs.condition.Os.FAMILY_WINDOWS
import static org.apache.tools.ant.taskdefs.condition.Os.isFamily
import static org.jetbrains.gradle.ext.ShortenCommandLine.MANIFEST
import org.jetbrains.gradle.ext.Application
import org.jetbrains.gradle.ext.JUnit
// Configure versions in gradle.properties (putting a gradle.properties file
// in a subproject only overrides root properties of same name for the actual
// subproject, not for its children!)
configurations.all {
resolutionStrategy {
// check for changing (i.e. SNAPSHOT) updates every build
cacheChangingModulesFor 0, 'seconds'
//failOnVersionConflict()
// This has been replaced with eclipse angus implementation
exclude group: "com.sun.activation", module: "jakarta.activation"
// This has been replaced with org.bouncycastle bcpkix-jdk18on
exclude group: "org.bouncycastle", module: "bcpkix-jdk15on"
// This has been replaced with org.bouncycastle bcprov-jdk18on
exclude group: "org.bouncycastle", module: "bcprov-jdk15on"
eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'org.eclipse.angus' && details.requested.name == 'angus-activation' && details.requested.version == '1.0.0') {
details.useVersion '2.0.0'
}
if (details.requested.group == 'commons-io' && details.requested.name == 'commons-io') {
details.useVersion '2.14.0'
}
}
}
}
subprojects {
// Give test tasks more memory (Gradle 5 reduced this to 512MB)
tasks.withType(Test) {
maxHeapSize = "2g"
}
// Give compiler tasks more memory
tasks.withType(GroovyCompile) {
groovyOptions.forkOptions.memoryMaximumSize = '2g' // Set max heap to 2 GB
}
}
tasks.configureEach { task ->
if (task.name in [
'findSonatypeStagingRepository',
'closeSonatypeStagingRepository',
'releaseSonatypeStagingRepository',
'closeAndReleaseSonatypeStagingRepository'
]) {
// See: https://github.com/gradle-nexus/publish-plugin/issues/221
task.notCompatibleWithConfigurationCache("Gradle Nexus Publish plugin task keeps Gradle Task/Project state")
}
}
// Default repositories for dependency resolution
repositories {
mavenLocal()
// Needs to be above central due to org.geotools:gt-main issues
maven {
url = "https://repo.osgeo.org/repository/release/"
content {
includeGroup "it.geosolutions.jgridshift"
includeGroup "org.eclipse.imagen"
includeGroupByRegex "org\\.geotools.*"
}
}
mavenCentral()
maven {
url = "https://pkgs.dev.azure.com/OpenRemote/OpenRemote/_packaging/OpenRemote/maven/v1"
}
maven {
url = "https://central.sonatype.com/repository/maven-snapshots"
}
maven {
url = "https://repo.jenkins-ci.org/releases/"
}
maven {
url = 'https://jitpack.io'
}
maven {
url = 'https://plugins.gradle.org/m2'
}
}
// Eclipse needs help
pluginManager.apply('eclipse')
// Intellij needs help
pluginManager.apply('idea')
// Use the same output directories in IDE as in gradle
idea {
module {
outputDir = file('build/classes/main')
testOutputDir = file('build/classes/test')
excludeDirs += file(".node")
excludeDirs += file("node_modules")
excludeDirs += file("dist")
excludeDirs += file("lib")
excludeDirs += file("build")
}
}
def getYarnInstallTask() {
tasks.getByPath(":yarnInstall")
}
ext {
getYarnInstallTask = this.&getYarnInstallTask
}
// Add UI tasks
ext.npmCommand = { cmd ->
isFamily(FAMILY_WINDOWS) ? "${cmd}.cmd" : cmd
}
// Add yarn tasks
tasks.register('yarnInstall', Exec) {
commandLine npmCommand("yarn"), "install"
}
tasks.register('yarnInstallForce', Exec) {
commandLine npmCommand("yarn"), "install", "--force"
}
// Configure Java build
plugins.withType(JavaPlugin).whenPluginAdded {
// Use Java 21
tasks.withType(JavaCompile) {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
def warnLogFile = file("$buildDir/${name}Warnings.log")
logging.addStandardErrorListener(new StandardOutputListener() {
void onOutput(CharSequence output) {
warnLogFile << output
}
})
options.compilerArgs += ["-Xlint:unchecked", "-Xlint:deprecation", "-parameters"]
options.encoding = 'UTF-8'
}
// Allow dependencyInsight checks across all projects
tasks.register('allDependencyInsight', DependencyInsightReportTask) {}
base {
// JAR/ZIP base name is the fully qualified subproject name
archivesName = "${rootProject.name}${path.replaceAll(":", "-")}"
}
pluginManager.apply(libs.plugins.testLogger.get().pluginId)
test {
workingDir = rootProject.projectDir
// Extension-only repos don't ship the manager UI tree expected by ManagerWebService.
// Point tests at a minimal placeholder docroot so container startup still succeeds.
environment "OR_APP_DOCROOT", rootProject.file("test-support/manager-app").absolutePath
useJUnitPlatform()
testLogging {
// set options for log level LIFECYCLE
events = [TestLogEvent.FAILED, TestLogEvent.PASSED, TestLogEvent.SKIPPED]
exceptionFormat = TestExceptionFormat.FULL
showExceptions = true
showCauses = true
showStackTraces = true
// set options for log level DEBUG and INFO
debug {
events = [
TestLogEvent.STARTED,
TestLogEvent.FAILED,
TestLogEvent.PASSED,
TestLogEvent.SKIPPED,
TestLogEvent.STANDARD_ERROR
]
exceptionFormat = TestExceptionFormat.FULL
}
info.events = debug.events
info.exceptionFormat = debug.exceptionFormat
}
addTestListener(new TestSummaryListener())
}
}
// Configure Spotless
if (project == rootProject) {
apply from: "${rootDir}/spotless.gradle"
}
// POM generator