-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
155 lines (125 loc) · 4.94 KB
/
build.gradle
File metadata and controls
155 lines (125 loc) · 4.94 KB
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
/*
* This build file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* user guide available at https://docs.gradle.org/4.1/userguide/tutorial_java_projects.html
*/
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1'
}
}
apply plugin: 'com.github.johnrengelman.shadow'
// Apply the java plugin to add support for Java
apply plugin: 'java'
// Apply the application plugin to add support for building an application
apply plugin: 'application'
// jacoco
apply plugin: 'jacoco'
// In this section you declare where to find the dependencies of your project
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
dependencies {
// This dependency is found on compile classpath of this component and consumers.
compile 'com.google.guava:guava:22.0'
// Use JUnit test framework
testCompile 'junit:junit:4.12'
// sqlite jdbc
compile 'org.xerial:sqlite-jdbc:3.20.1'
//mockito
testCompile 'org.mockito:mockito-core:1.10.19'
compile 'org.mockito:mockito-core:1.10.19'
// CTC graph libs
compile 'org.graphstream:gs-core:1.3'
compile 'org.graphstream:gs-ui:1.3'
compile 'org.graphstream:gs-algo:1.3'
}
// show unchecked operations
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Werror"
}
// show a more verbose output when tests fail
test {
testLogging {
exceptionFormat = 'full'
}
}
tasks.withType(Test) { // run tests in parallel
maxParallelForks = Runtime.runtime.availableProcessors() / 2
}
// Define the main class for the application
mainClassName = 'App'
// setup jacoco/code coverage tests
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
afterEvaluate {
classDirectories = files(classDirectories.files.collect {
fileTree(dir: it,
exclude: ['**/*GUI**', // exclude GUI code
'**/*RunTrackModel**']) // exclude track model runner wrapper
})
}
}
check.dependsOn jacocoTestReport
// setup jar generation
// see https://stackoverflow.com/questions/20045744/java-lang-securityexception-no-manifest-section-for-signature-file-entry
// for more info on the exclude statements below
task trackModelJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
archiveName = 'TrackModel.jar'
from sourceSets.main.output //tells the task to include the project code
configurations = [ project.configurations.runtime ] //tells the task to shadow in the jars files in the 'runtime' scope
exclude 'META-INF/.RSA', 'META-INF/.SF','META-INF/*.DSA' //exclude security files from jars
manifest {
attributes 'Main-Class': 'trackmodel.RunTrackModel'
}
}
jar.dependsOn trackModelJar
task CTCModelJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
archiveName = 'CTCModel.jar'
from sourceSets.main.output //tells the task to include the project code
configurations = [ project.configurations.runtime ] //tells the task to shadow in the jars files in the 'runtime' scope
exclude 'META-INF/.RSA', 'META-INF/.SF','META-INF/*.DSA' //exclude security files from jars
manifest {
attributes 'Main-Class': 'CTCModel.UseGUI'
}
}
jar.dependsOn CTCModelJar
task waysideJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
archiveName = 'Wayside.jar'
from sourceSets.main.output //tells the task to include the project code
configurations = [ project.configurations.runtime ] //tells the task to shadow in the jars files in the 'runtime' scope
exclude 'META-INF/.RSA', 'META-INF/.SF','META-INF/*.DSA' //exclude security files from jars
manifest {
attributes 'Main-Class': 'wayside.Runner'
}
}
jar.dependsOn waysideJar
task trainModelJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
archiveName = 'TrainModel.jar'
from sourceSets.main.output //tells the task to include the project code
configurations = [ project.configurations.runtime ] //tells the task to shadow in the jars files in the 'runtime' scope
manifest {
attributes 'Main-Class': 'trainmodel.TrainTracker'
}
}
jar.dependsOn trainModelJar
task combinedJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
archiveName = 'Combined.jar'
from sourceSets.main.output //tells the task to include the project code
configurations = [ project.configurations.runtime ] //tells the task to shadow in the jars files in the 'runtime' scope
exclude 'META-INF/.RSA', 'META-INF/.SF','META-INF/*.DSA' //exclude security files from jars
manifest {
attributes 'Main-Class': 'App'
}
}
jar.dependsOn combinedJar