-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
105 lines (87 loc) · 2.24 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
95
96
97
98
99
100
101
102
103
104
105
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'application'
apply plugin: 'edu.sc.seis.launch4j'
applicationName = 'MIDIBlocks'
version = '1.0'
applicationDefaultJvmArgs = ['-Djava.library.path=MY_APP_HOME/lib']
mainClassName = "midiblocks.MidiBlock"
sourceCompatibility = 1.8 //Use Java 8
targetCompatibility = 1.8
distZip {
into(applicationName + '-' + version + '/lib') {
from './lib'
include '*'
}
archiveName = applicationName + '-' + version + '.zip'
}
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 {
jcenter()
}
dependencies {
classpath 'eu.appsatori:gradle-fatjar-plugin:0.3'
}
}
buildscript {
repositories {
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'gradle.plugin.edu.sc.seis.gradle:launch4j:1.5.1'
}
}
dependencies {
compile 'org.processing:core:2.2.1'
compile name: 'jfugue-5.0.3'
compile 'com.fazecast:jSerialComm:1.3.7'
testCompile group: 'junit', name: 'junit', version: '4.11'
}
task runApp(type: JavaExec, dependsOn: 'classes') {
main = 'midiblocks.MidiBlock'
jvmArgs = ['-Djava.library.path=' + projectDir + '/lib']
classpath = sourceSets.main.runtimeClasspath
}
task fatJar(type: Jar) {
manifest {
attributes 'Implementation-Title': 'Gradle Jar File',
'Implementation-Version': version,
'Main-Class': 'midiblocks.MidiBlock'
}
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'
}
}
copyL4jLib.dependsOn fatJar
launch4j {
copyConfigurable = project.tasks.fatJar.outputs.files
outfile = 'MIDIBlocks.exe'
mainClassName = 'midiblocks.MidiBlock'
jar = "lib/${project.tasks.fatJar.archiveName}"
}