forked from pniederw/algs4partI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
74 lines (54 loc) · 1.61 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
allprojects {
apply plugin: "idea"
}
subprojects {
apply plugin: "java"
apply plugin: "checkstyle"
apply plugin: "findbugs"
apply plugin: "eclipse"
sourceCompatibility = 1.6
repositories {
mavenCentral()
}
def libDir = "$rootProject.projectDir/lib"
dependencies {
compile files("$libDir/classes", "$libDir/algs4.jar", "$libDir/stdlib.jar")
testCompile "junit:junit:4.10"
}
sourceSets {
main.java.srcDirs = ["src"]
test.java.srcDirs = ["test"]
}
def configDir = "$rootProject.projectDir/config"
checkstyle {
toolVersion = "5.5"
configFile = file("$configDir/checkstyle.xml")
}
findbugs {
toolVersion = "2.0.1"
// Gradle 1.1 does not have support for declaring FindBugs filters
// configFile = file("$configDir/findbugs.xml")
}
// some of the provided test classes fail these checks
checkstyleTest.enabled = false
findbugsTest.enabled = false
test {
testLogging.showExceptions = true
}
task zip(type: Zip) {
from sourceSets.main.java
}
tasks.addRule("Pattern: run<ClassName>") { taskName ->
if (taskName.startsWith("run")) {
task(taskName, type: JavaExec) {
main = taskName.substring(3)
if (System.getProperty("args")) {
gradle.projectsEvaluated {
args = System.getProperty("args").split(",") as List
}
}
classpath = sourceSets.test.runtimeClasspath
}
}
}
}