forked from nbauernfeind/deephaven-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
104 lines (92 loc) · 3.99 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
plugins {
id 'base'
id 'io.deephaven.project.register'
}
import org.gradle.internal.jvm.Jvm
import java.util.concurrent.TimeUnit
def isCi = System.getenv().getOrDefault("CI", "false") == "true"
def gradleJvmVersion = Jvm.current().getJavaVersion()
if (isCi) {
if (gradleJvmVersion != JavaVersion.VERSION_11) {
throw new IllegalStateException("JDK 11 is currently required for CI builds")
}
} else {
if (!gradleJvmVersion.isCompatibleWith(JavaVersion.VERSION_11)) {
throw new IllegalStateException("JDK 11+ is currently required for development builds. For help installing, see https://deephaven.io/core/docs/how-to-guides/launch-build")
}
}
(tasks.clean as Delete).delete(
// Only the build rpm task outputs to the $rootDir/target directory. Add it to the clean task.
'target',
'buildSrc/out',
// Some tests pollute the root directory; add them to clean
"$rootDir/tmp",
"$rootDir/test",
"$rootDir/test.*",
// TODO: find the tests polluting root directory and fix them
)
clean.doLast {
delete "$rootDir/test"
delete "$rootDir/test.*"
// TODO: find the tests polluting root directory and fix them
}
project.tasks.register('outputVersion') {task ->
def versionFile = project.layout.buildDirectory.file('version')
task.inputs.property('version', project.version)
task.outputs.file(versionFile)
task.doLast {
versionFile.get().asFile.text = project.version
}
}
project.tasks.register('printVersion') {task ->
task.doLast {
println(project.version)
}
}
tasks.register('nightly') {
it.group 'Deephaven lifecycle'
it.description 'A lifecycle task that defines the nightly tasks to be run in CI, see .github/workflows/nighty-check-ci.yml'
it.dependsOn allprojects.collect {
allprojects.collect { it.tasks.matching { it.name == LifecycleBasePlugin.CHECK_TASK_NAME } } +\
allprojects.collect { it.tasks.matching { it.name == 'testOutOfBand' } } +\
allprojects.collect { it.tasks.matching { it.name == 'testSerial' } } +\
allprojects.collect { it.tasks.matching { it.name == 'testParallel' } }
}
}
tasks.register('prepareCompose') {
it.group 'Deephaven lifecycle'
it.description 'A lifecycle task that prepares prerequisites for local docker compose builds'
it.dependsOn project(':docker-server-jetty').tasks.findByName('buildDocker-server-jetty')
}
tasks.register('smoke') {
it.group 'Deephaven lifecycle'
it.description 'A lifecycle task for a local-development workflow to make sure things are looking "OK"'
it.dependsOn allprojects.collect {
allprojects.collect { it.tasks.matching { it.name == 'gwtCompile' } } +\
allprojects.collect { it.tasks.matching { it.name == 'compileTestJava' } } +\
allprojects.collect { it.tasks.matching { it.name == 'spotlessCheck' } }
}
it.dependsOn project(':server').tasks.findByName(LifecycleBasePlugin.CHECK_TASK_NAME)
it.dependsOn project(':docker-server-slim').tasks.findByName('prepareDocker')
it.dependsOn project(':docker-server').tasks.findByName('prepareDocker')
it.dependsOn project(':docker-server-jetty').tasks.findByName('prepareDocker')
it.dependsOn project(':web').tasks.findByName(LifecycleBasePlugin.ASSEMBLE_TASK_NAME)
it.dependsOn project(':Generators').tasks.findByName(LifecycleBasePlugin.CHECK_TASK_NAME)
}
tasks.wrapper {
Wrapper w ->
w.distributionType = 'ALL'
w.gradleVersion = '7.5'
// if you wish to update the gradleVersion, copy-paste the correct SHA from https://gradle.org/release-checksums
w.distributionSha256Sum = '97a52d145762adc241bad7fd18289bf7f6801e08ece6badf80402fe2b9f250b1'
}
if (findProperty('debugCI') == 'true') {
gradle.buildFinished {
BuildResult result ->
if (result.failure) {
result.failure.printStackTrace()
println "Pausing the build so errors can be diagnosed"
Thread.sleep(TimeUnit.HOURS.toMillis(3))
}
}
}