-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
77 lines (66 loc) · 2.72 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
plugins { // Double quotes evaluate some expressions a-la backticks in JS. Sounds like I should use single quotes by default
id 'java'
id 'application'
}
/*
* Needs this specific name to work with the application
* plugin. Change this property to set the main class for
* running and Jar-ing
*/
mainClassName = 'autocadDrawingChecker.start.Main'
version = '3.0'
sourceCompatibility = '1.8'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
// NetBeans will automatically add "run" and "debug" tasks relying on the
// "mainClass" property. You may however define the property prior executing
// tasks by passing a "-PmainClass=<QUALIFIED_CLASS_NAME>" argument.
//
// Note however, that you may define your own "run" and "debug" task if you
// prefer. In this case NetBeans will not add these tasks but you may rely on
// your own implementation.
if (!hasProperty('mainClass')) {
ext.mainClass = mainClassName
}
jar {
//need to manually set main class, otherwise, it just compiles the JAR as a library
manifest {
attributes(
'Main-Class': mainClassName,
'Implementation-Title': project.name,
'Implementation-Version': project.version
)
}
//include dependencies in JAR file
doFirst {
from {
configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}
/*
* https://stackoverflow.com/questions/999489/invalid-signature-file-when-attempting-to-run-a-jar
* Need to exclude signitures from the Google API files, otherwise this causes errors when attempting
* to run the JAR file.
*/
exclude 'META-INF/*.RSA', 'META-INF/*.SF','META-INF/*.DSA'
}
tasks.withType(JavaCompile) {
options.compilerArgs << '-Xlint:unchecked'
}
repositories {
mavenCentral()
// You may define additional repositories, or even remove "mavenCentral()".
// Read more about repositories here:
// http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:repositories
}
dependencies {
// TODO: Add dependencies here ...
// You can read more about how to add dependency here:
// http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:how_to_declare_your_dependencies
testCompile group: 'junit', name: 'junit', version: '4.10'
// https://mvnrepository.com/artifact/org.apache.commons/commons-csv
compile group: 'org.apache.commons', name: 'commons-csv', version: '1.8'
// https://mvnrepository.com/artifact/org.apache.poi/poi
compile group: 'org.apache.poi', name: 'poi', version: '4.1.2'
// https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml
compile group: 'org.apache.poi', name: 'poi-ooxml', version: '4.1.2'
}