-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle
131 lines (113 loc) · 4.22 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
buildscript {
repositories {
mavenCentral()
}
ext {
logbackVersion = '1.2.13'
}
}
plugins {
id 'pl.allegro.tech.build.axion-release' version '1.7.1'
// to be able to build Gradle task graph:
// Run 'taskTree' to activate it.
// Eg. './gradlew :bonita-update-tool:testUpdate_7_8_1 :bonita-update-tool:taskTree -Ddb.vendor=oracle'
id 'com.dorongold.task-tree' version '4.0.0'
}
repositories {
mavenLocal()
mavenCentral()
}
apply plugin: 'groovy'
apply plugin: 'application'
apply plugin: 'update-dist'
apply plugin: 'update'
configurations {
inDistrib
}
group 'org.bonitasoft.update'
artifacts { archives distZip }
distTar.configure { enabled = false }
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}
project.tasks.withType(JavaCompile).configureEach {
javaCompiler.set(javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(17)
})
}
dependencies {
implementation "org.codehaus.groovy:groovy-all:3.0.19"
implementation "com.github.zafarkhaja:java-semver:0.9.0"
implementation group: 'org.apache.commons', name: 'commons-dbcp2', version: '2.9.0'
implementation "ch.qos.logback:logback-classic:$logbackVersion"
implementation "commons-cli:commons-cli:1.4"
implementation "com.sun.activation:jakarta.activation:1.2.2"
implementation "com.fasterxml.jackson.core:jackson-databind:2.17.1"
runtimeOnly 'javax.activation:activation:1.1'
testRuntimeOnly "cglib:cglib-nodep:2.2"
testRuntimeOnly 'org.objenesis:objenesis:1.2'
testImplementation 'org.assertj:assertj-core:3.24.2'
testImplementation "org.spockframework:spock-core:2.3-groovy-3.0"
testImplementation 'xmlunit:xmlunit:1.5'
// TODO should be fillerRuntime (require changed in tasks)
fillerImplementation "ch.qos.logback:logback-classic:$logbackVersion"
fillerImplementation 'junit:junit:4.13.1'
fillerImplementation "org.codehaus.groovy:groovy-all:3.0.19"
fillerImplementation 'org.awaitility:awaitility:4.2.0'
fillerImplementation 'org.assertj:assertj-core:3.24.2'
enginetestImplementation 'org.awaitility:awaitility:4.2.0'
enginetestImplementation 'org.assertj:assertj-core:3.24.2'
enginetestImplementation("org.spockframework:spock-junit4:2.3-groovy-3.0")
enginetestImplementation("org.spockframework:spock-core:2.3-groovy-3.0")
enginetestImplementation "org.codehaus.groovy:groovy-all:3.0.19"
enginetestImplementation 'javax.xml.bind:jaxb-api:2.3.1'
enginetestImplementation 'org.glassfish.jaxb:jaxb-runtime:2.3.1'
// TODO should be enginetestRuntime (require changed in tasks)
enginetestImplementation "ch.qos.logback:logback-classic:$logbackVersion"
}
startScripts {
// Fail on windows OS
// classpath = files('$APP_HOME/lib/*')
// Workaround inspired of https://gist.github.com/jlmelville/2bfe9277e9e2c0ff79b6
// and http://stackoverflow.com/questions/25227198/how-to-pass-a-reference-to-distribution-home-directory-using-gradle-application
doLast {
windowsScript.text = windowsScript.text.replaceFirst('(set CLASSPATH=%APP_HOME%\\\\lib\\\\).*', '$1*')
unixScript.text = unixScript.text.replaceFirst('(CLASSPATH=\\$APP_HOME/lib/).*', '$1*')
}
}
sourceSets {
intTest {
compileClasspath += sourceSets.test.compileClasspath
}
}
test {
useJUnitPlatform()
}
tasks.register("testJar", Jar) {
archiveClassifier = 'tests'
from sourceSets.test.output + sourceSets.intTest.output
}
processResources {
filesMatching('**/bonita-update-info.properties') {
expand('project_version': project.property('version'))
}
}
distributions {
main {
contents {
includeEmptyDirs = false
configurations.inDistrib.resolvedConfiguration.resolvedArtifacts.each {
from(zipTree(it.file)) {
include '**'
eachFile { fcp ->
//unzip each artifact and put them in subfolder 'tools'
fcp.path = fcp.path.replaceAll("([^/]*)/([^/]*)-${project.version}/", "\$1/tools/\$2/")
}
}
}
}
}
}
tasks.named("distZip").configure { dependsOn configurations.inDistrib }