-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
62 lines (52 loc) · 1 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
apply plugin: 'java'
apply plugin: 'findbugs'
apply plugin: 'checkstyle'
sourceSets {
main {
java {
srcDir 'exercises'
}
}
}
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:deprecation"
}
tasks.withType(FindBugs) {
reports {
xml.enabled = false
html.enabled = true
}
}
tasks.withType(Checkstyle) {
reports {
xml.enabled = false
html.enabled = true
}
}
ext {
wrapper = file('run.sh')
}
dependencies {
compile project(':algs4')
runtime project(':algs4')
repositories {
mavenCentral()
}
}
build {
inputs.files sourceSets.main.runtimeClasspath
outputs.file wrapper
}
build.doLast {
wrapper.withPrintWriter {
it.println '#!/bin/sh'
it.println "time java -cp ${getRuntimeClasspath()} \$@"
}
wrapper.setExecutable(true)
}
clean {
delete wrapper
}
String getRuntimeClasspath() {
sourceSets.main.runtimeClasspath.collect { it.absolutePath }.join(':')
}