-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
executable file
·280 lines (232 loc) · 9.6 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
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
import java.nio.file.Paths
/*
* Copyright (c) 2017 German Cancer Research Center (DKFZ).
*
* Distributed under the MIT License (license terms are at https://www.github.com/theroddywms/Roddy/LICENSE.txt).
*/
// TODO Put git short hash into manifests
// TODO How to compile plugins? Can this be done with gradle as well?
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
mavenLocal()
mavenCentral()
}
dependencies {
classpath group: 'kr.motd.gradle', name: 'sphinx-gradle-plugin', version: '2.2.0'
}
}
plugins {
id 'org.ajoberstar.grgit' version '1.7.2' // Apache 2.0
id 'idea'
}
group = "com.github.theroddywms"
/**
* -PignoreFailedTests Continue despite failed tests.
* -PallowDirtyRepo=true Continue release despite dirty repo.
* -Pchecked=false Turn off -F Xlint:unchecked
*/
ext.allowDirtyRepo = (project.hasProperty("allowDirty") && project.allowDirty == "true")
// apply plugin: "java"
apply plugin: 'application'
apply plugin: 'distribution'
apply plugin: 'groovy'
apply plugin: 'kr.motd.sphinx' // Apache 2.0
//apply plugin: 'codenarc'
// Java settings
ext.langLevel = "1.8"
sourceCompatibility = langLevel
targetCompatibility = langLevel
compileJava.options.fork = true
// Set -Pchecked={true,false} on the command line to change this compiler parameter. Default: unchecked
if (project.hasProperty("checked") && !project.checked) {
compileJava.options.compilerArgs = ["-Xlint:unchecked"]
compileGroovy.options.compilerArgs = ["-Xlint:unchecked"]
}
// The following keeps the Gradle build files separate from the ones build by IntelliJ (usually in build/).
buildDir = "${projectDir}/gradleBuild"
/*
* Gets the version name from the current Git tag. If the current commit is not tagged,
* this returned string will indicate that. Also if the repository is dirty
*/
def getVersionName() {
def dirtySuffix = grgit.status().isClean() ? '' : '-dirty'
return grgit.describe() + dirtySuffix
}
rootProject.version = getVersionName()
test {
workingDir = projectDir
ignoreFailures = project.hasProperty("ignoreFailedTests")
testLogging {
debug {
events "started", "skipped", "failed"
exceptionFormat "full"
}
events "failed"
exceptionFormat "full"
setShowStandardStreams true
}
}
repositories {
mavenCentral() // Most dependencies
maven { url 'https://jitpack.io' } // Github: RoddyToolLib, BatchEuphoria
maven { url "https://repo1.maven.org/maven2/" } // Some of the remaining dependencies
}
ext.roddyToolLibVersion = "2.4.0"
ext.batchEuphoriaVersion = "0.1.1"
configurations.all {
resolutionStrategy.cacheChangingModulesFor(0, 'seconds')
resolutionStrategy.cacheDynamicVersionsFor(0, 'seconds')
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
// details.useVersion is null, if Roddy is build in a multi-project build with dependency substitution.
// In this situation the substituted version-less development version has higher priority than the
// version configured via roddyToolLibVersion.
if (details.requested.name == "RoddyToolLib" && details.useVersion != null) {
details.useVersion roddyToolLibVersion
details.because "BatchEuphoria not affected by RoddyToolLib ${roddyToolLibVersion} API changes."
}
}
}
dependencies {
compile "com.github.theroddywms:RoddyToolLib:${roddyToolLibVersion}" // MIT
compile "com.github.theroddywms:BatchEuphoria:${batchEuphoriaVersion}" // MIT
compile 'org.codehaus.groovy:groovy-all:2.4.21' // Apache 2.0
// Note: When updating SSHJ, check the BC version in its dependencies! E.g.
// https://github.com/hierynomus/sshj/blob/master/build-publishing.gradle
compile 'org.bouncycastle:bcpg-jdk15on:1.51' // MIT
compile 'org.bouncycastle:bcpkix-jdk15on:1.51' // MIT
compile 'org.bouncycastle:bcprov-ext-jdk15on:1.51' // MIT
compile 'org.bouncycastle:bcprov-jdk15on:1.51' // MIT
compile 'com.google.guava:guava:31.1-jre' // Apache 2.0
compile 'org.apache.commons:commons-csv:1.9.0' // Apache 2.0
compile 'commons-cli:commons-cli:1.5.0' // Apache 2.0
compile 'commons-codec:commons-codec:1.15' // Apache 2.0
compile 'commons-io:commons-io:2.11.0' // Apache 2.0
compile 'commons-logging:commons-logging:1.2' // Apache 2.0
compile 'com.jcraft:jzlib:1.1.3' // BSD
compile 'com.github.markusbernhardt:proxy-vole:1.0.5' // Apache 2.0
compile 'org.reflections:reflections:0.10.2'
compile 'org.slf4j:slf4j-api:2.0.3' // MIT
compile 'org.slf4j:slf4j-nop:2.0.3' // MIT
compile 'com.hierynomus:sshj:0.34.0' // Apache 2.0
compile 'net.vrallev.ecc:ecc-25519-java:1.0.3'
// Apache 2.0; elliptic curve cryptography (ECC) with Curve25519
compile 'net.i2p.crypto:eddsa:0.3.0' // CC0 1.0 Universal; Ed25519
compile 'com.jcraft:jsch.agentproxy.jsch:0.0.9' // BSD-style, http://www.jcraft.com/jsch-agent-proxy/LICENSE.txt
compile 'com.jcraft:jsch.agentproxy.pageant:0.0.9' // BSD-style, http://www.jcraft.com/jsch-agent-proxy/LICENSE.txt
compile 'com.jcraft:jsch.agentproxy.sshj:0.0.9' // BSD-style, http://www.jcraft.com/jsch-agent-proxy/LICENSE.txt
compile 'com.jcraft:jsch.agentproxy.usocket-nc:0.0.9' // BSD-style, http://www.jcraft.com/jsch-agent-proxy/LICENSE.txt
compile 'com.jcraft:jsch.agentproxy.usocket-jna:0.0.9' // BSD-style, http://www.jcraft.com/jsch-agent-proxy/LICENSE.txt
compile 'com.jcraft:jsch.agentproxy.connector-factory:0.0.9' // BSD-style, http://www.jcraft.com/jsch-agent-proxy/LICENSE.txt
compile 'com.jcraft:jsch.agentproxy.sshagent:0.0.9' // BSD-style, http://www.jcraft.com/jsch-agent-proxy/LICENSE.txt
compile 'com.github.petitparser.java-petitparser:petitparser-core:2.2.0' // MIT
// Testing libraries
testCompile 'junit:junit:4.13.2' // EPL 1.0
testCompile 'org.spockframework:spock-core:1.3-groovy-2.4' // Apache 2.0
}
project.ext.developmentDistributionDir = new File(rootProject.projectDir, "dist/bin/develop")
convention.add("releaseDir", new File(project.ext.developmentDistributionDir, "../" + rootProject.version).absoluteFile)
sourceSets {
main {
groovy {
srcDirs = ["${projectDir}/RoddyCore/src"]
}
}
test {
groovy {
srcDirs = ["${projectDir}/RoddyCore/test/src"]
}
resources {
srcDirs = ["${projectDir}/RoddyCore/test/resources"]
}
}
}
mainClassName = "de.dkfz.roddy.Roddy"
project.ext.librariesDirectory = new File(project.ext.developmentDistributionDir, "lib")
task cleanRuntimeLibs(type: Delete) {
delete fileTree(dir: librariesDirectory, exclude: ".keep")
}
clean.dependsOn(cleanRuntimeLibs)
task copyRuntimeLibs(type: Copy, dependsOn: cleanRuntimeLibs) {
into librariesDirectory
from configurations.runtime
}
jar {
setArchivesBaseName("Roddy")
setArchiveClassifier(null)
setArchiveVersion(null)
setDestinationDirectory(project.ext.developmentDistributionDir)
archiveFile
manifest {
attributes("Implementation-Vendor": "German Cancer Research Center (DKFZ)")
attributes 'Main-Class': mainClassName
attributes("Implementation-Title": archivesBaseName)
attributes 'Implementation-Version': rootProject.version
}
dependsOn copyRuntimeLibs
}
/** Produce 2 distribution packages:
*
* * Roddy-*.zip with everything that belongs into the dist/bin/develop directory & some other smaller files.
* * RoddyEnv-*.zip with the runtime environment, starter script, etc.
*/
distributions {
roddy {
baseName = "Roddy"
contents {
into(rootProject.version)
from(project.ext.developmentDistributionDir) {
include("**")
}
from("./") {
include("LICENSE")
include("CONTRIBUTING.md")
include("CONTRIBUTORS.md")
include("3RDPARTY_LICENSES")
include("CHANGELIST.md")
}
from ("RoddyCore/") {
include("buildversion.txt")
}
}
}
roddyEnvironment {
baseName = "RoddyEnv"
contents {
from("./") {
include("roddy.sh")
include("README.md")
include("LICENSE")
include("CONTRIBUTING.md")
include("CONTRIBUTORS.md")
include("3RDPARTY_LICENSES")
include("CHANGELIST.md")
include("dist/bin")
include("dist/runtime")
include("dist/plugins")
}
}
}
}
roddyDistTar.dependsOn(jar)
roddyDistZip.dependsOn(jar)
sphinx {
sourceDirectory = "${project.projectDir}/docs/"
outputDirectory = "${project.buildDir}/site/"
warningsAsErrors = true
}
//codenarc {
// toolVersion = "1.2.1"
// ignoreFailures = true
//}
//
//codenarcMain {
// configFile = project.file("config/codenarc/codenarc.groovy")
//}
//
//codenarcTest {
// configFile = project.file("config/codenarc/codenarc.groovy")
//}
// end of build.gradle