-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
86 lines (72 loc) · 1.94 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
plugins {
id 'java'
id "com.github.spotbugs" version "4.7.3"
}
repositories {
mavenCentral()
}
sourceSets {
main {
java {
srcDirs = ['src']
exclude 'build'
exclude 'bin'
exclude '.gradle'
}
}
}
// Configure spotbugs
// Note: code here is very buggy so we will allow compilation with bugs. A
// report is still saved.
dependencies {
spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.7.1'
spotbugs 'com.github.spotbugs:spotbugs:4.4.0'
}
spotbugsMain {
ignoreFailures = true
showStackTraces = false
reports {
html {
enabled = true
destination = file("$buildDir/reports/spotbugs/spotbugs.html")
}
}
}
//Configure checkstyle
apply plugin: 'checkstyle'
checkstyle {
ignoreFailures = true
toolVersion = '8.11'
configFile = file('checkstyle.xml')
}
task(runStrategy, dependsOn: ['javadoc', 'build'], type: JavaExec) {
mainClass = 'strategy.ListDriver'
classpath = sourceSets.main.runtimeClasspath
}
task(runObserver, dependsOn: ['javadoc', 'build'], type: JavaExec) {
mainClass = 'observer.BookDriver'
classpath = sourceSets.main.runtimeClasspath
}
task(runDecorator, dependsOn: ['javadoc', 'build'], type: JavaExec) {
mainClass = 'decorator.PotatoeDriver'
classpath = sourceSets.main.runtimeClasspath
}
task(runFactory, dependsOn: ['javadoc', 'build'], type: JavaExec) {
mainClass = 'factory.HousePlanDriver'
classpath = sourceSets.main.runtimeClasspath
}
task(runIterator, dependsOn: ['javadoc', 'build'], type: JavaExec) {
mainClass = 'iterator.AirlineDriver'
classpath = sourceSets.main.runtimeClasspath
}
task(runSingleton, dependsOn: ['javadoc', 'build'], type: JavaExec) {
mainClass = 'singleton.GameDriver'
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
}
tasks.withType(Checkstyle) {
reports {
xml.required = false
html.required = true
}
}