-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
111 lines (98 loc) · 2.69 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
106
107
108
109
110
111
apply plugin: 'java'
apply plugin: 'distribution'
apply plugin: 'idea'
apply plugin: 'macAppBundle'
version = new File('VERSION').text
def exeVersion = '2.0.0.0'
def mainClass = 'uk.co.pbellchambers.winebrewdb.MainApp'
sourceCompatibility = 1.8
targetCompatibility = 1.8
buildscript {
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
dependencies {
classpath 'edu.sc.seis.gradle:macappbundle:2.0.0'
}
}
repositories {
mavenCentral()
}
dependencies {
compile 'org.ini4j:ini4j:0.5.4'
compile 'com.itextpdf:itextpdf:5.5.5'
compile 'joda-time:joda-time:2.7'
compile 'com.miglayout:miglayout-swing:4.2'
compile 'org.xerial:sqlite-jdbc:3.8.7'
}
jar {
archiveName = 'WineBrewDB.jar'
manifest {
attributes 'Implementation-Version' : version
attributes 'Main-Class' : mainClass
}
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
}
task exe << {
new File('build/exe').mkdir()
ant.taskdef(name: 'launch4j',
classname: 'net.sf.launch4j.ant.Launch4jTask') {
classpath {
fileset(dir: 'launch4j', includes: 'launch4j.jar')
fileset(dir: 'launch4j/lib', includes: 'xstream.jar')
}
}
ant.launch4j(
configFile: 'launch4j.cfg.xml',
fileVersion: exeVersion,
txtFileVersion: version,
productVersion: exeVersion,
txtProductVersion: version) {
}
}
distributions {
jar {
baseName = 'WineBrewDB_OS-All'
contents {
from { 'build/libs' }
from { 'distribution' }
}
}
exe {
baseName = 'WineBrewDB_OS-Windows'
contents {
from { 'build/exe' }
from { 'distribution' }
}
}
}
macAppBundle {
mainClassName = mainClass
icon = 'src/main/resources/images/winebrewdb.icns'
javaProperties.put('apple.laf.useScreenMenuBar', 'true')
dmgName = 'WineBrewDB_' + version + '_OS-Mac'
}
task renameFiles {
doLast {
file('build/distributions/WineBrewDB_OS-All-' + version + '.zip').renameTo(file('build/distributions/WineBrewDB_' + version + '_OS-All.zip'))
file('build/distributions/WineBrewDB_OS-Windows-' + version + '.zip').renameTo(file('build/distributions/WineBrewDB_' + version + '_OS-Windows.zip'))
}
}
task copyFiles(type: Sync) {
file('shippable').mkdir()
from 'build/distributions'
into 'shippable'
include '**/*.zip'
}
jarDistTar.dependsOn 'jar'
jarDistZip.dependsOn 'jar'
exe.dependsOn 'jar'
exeDistTar.dependsOn 'exe'
exeDistZip.dependsOn 'exe'
createAppZip.dependsOn 'createApp'
createDmg.enabled = false
copyFiles.dependsOn 'renameFiles'