-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.gradle
80 lines (65 loc) · 1.83 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
apply plugin: 'application'
group 'linkifier'
version '3.2.8'
sourceCompatibility = 1.8
mainClassName = 'controller.MainApp'
// Source code is in UTF-8 (important because of comments in org.simmetrics package)
compileJava {options.encoding = 'UTF-8'}
// Repository
repositories {
mavenCentral()
}
// Dependencies
dependencies {
compile fileTree(dir: 'lib', include: '*.jar') // The search is not recursive -> list all directories
compile fileTree(dir: 'lib/mssql', include: '*.jar')
compile fileTree(dir: 'lib/mysql', include: '*.jar')
compile fileTree(dir: 'lib/oracle', include: '*.jar')
compile fileTree(dir: 'lib/postgresql', include: '*.jar')
compileOnly 'com.google.code.findbugs:jsr305:3.0.2' // Used only for @Nullable annotation; requires Gradle ≥ 2.12
testCompile 'junit:junit:4.12'
}
// Directory structure
sourceSets {
main {
java {
srcDirs = ['src', 'gui']
}
resources {
srcDirs = ['gui/resources']
}
}
test {
java {
srcDir 'test'
}
}
}
// How to build the jar file
jar {
manifest {
attributes(
'Class-Path': configurations.runtime.collect { "lib/$it.name" }.join(' '), // Where to look for .jars
'Main-Class': 'controller.MainApp', // What to execute
'Implementation-Version': version // To be able to read it during the runtime
)
}
}
// Deployment task
task deploy(dependsOn: 'jar') {
doFirst {
copy {
from "$buildDir/$libsDirName"
into "$buildDir/output"
}
copy {
from configurations.runtime + configurations.compile
into "$buildDir/output/lib"
}
}
}
// Make a zip file
task zip(type: Zip, dependsOn: 'deploy') {
from "$buildDir/output"
version = null
}