-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
95 lines (77 loc) · 2.05 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
87
88
89
90
91
92
93
94
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'application'
apply plugin: 'edu.sc.seis.launch4j'
applicationName = 'Digiscope'
version = '1.0'
applicationDefaultJvmArgs = ['-Djava.library.path=MY_APP_HOME/lib']
mainClassName = "Digiscope"
sourceCompatibility = 1.8
targetCompatibility = 1.8
distZip {
into(applicationName + '-' + version + '/lib') {
from './lib'
include '*'
}
archiveName = applicationName + '-' + version + '.zip'
}
task runApp(type: JavaExec, dependsOn: 'classes') {
main = 'Digiscope'
jvmArgs = ['-Djava.library.path=' + projectDir + '/lib']
classpath = sourceSets.main.runtimeClasspath
}
startScripts {
classpath.add(sourceSets.main.runtimeClasspath)
doLast {
unixScript.text = unixScript.text.replace('MY_APP_HOME', '$APP_HOME')
windowsScript.text = windowsScript.text.replace('MY_APP_HOME', '%~dp0..')
}
}
repositories {
mavenCentral()
flatDir {
dirs 'lib'
}
}
buildscript {
repositories {
maven {
url 'https://plugins.gradle.org/m2/'
}
}
}
dependencies {
compile 'org.processing:core:2.2.1'
compile 'com.fathzer:javaluator:3.0.0'
compile 'javax.xml.bind:jaxb-api:2.2.4'
compile 'org.apache.commons:commons-math3:3.0'
compile 'net.sourceforge.jtransforms:jtransforms:2.4.0'
testCompile group: 'junit', name: 'junit', version: '4.11'
}
task fatJar(type: Jar) {
manifest {
attributes 'Implementation-Title': 'Gradle Jar File',
'Implementation-Version': version,
'Main-Class': 'Digiscope'
}
baseName = project.name
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
buildscript {
repositories {
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'gradle.plugin.edu.sc.seis.gradle:launch4j:1.5.1'
}
}
launch4j {
copyConfigurable = project.tasks.fatJar.outputs.files
outfile = 'Digiscope.exe'
mainClassName = 'Digiscope'
jar = "lib/${project.tasks.fatJar.archiveName}"
}