-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.gradle
61 lines (51 loc) · 1.67 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
plugins {
id 'java'
id "edu.sc.seis.macAppBundle" version "2.1.1"
id 'eclipse'
id 'idea'
}
task wrapper(type: Wrapper) {
gradleVersion = '2.5'
}
// Keep this in sync with GV.VERSION
version='1.2'
sourceCompatibility = 1.7
targetCompatibility = 1.7
jar {
manifest {
attributes 'Implementation-Title': 'JETRIS',
'Implementation-Version': version,
'Main-Class': "JetrisMain"
}
}
macAppBundle {
mainClassName = "JetrisMain"
icon = "src/main/resources/osx/jetris.icns"
bundleJRE = false
javaProperties.put("apple.laf.useScreenMenuBar", "true")
}
// Windows wrapper configuration to generate "jetris.exe"
task launch4jConfig(type: Copy) {
from 'src/main/resources/launch4j/launch4j.xml'
into 'build/launch4j'
expand(
JAR_FILE: project.jar.archivePath,
VERSION: project.version,
ICON: file('src/main/resources/launch4j/jetris.ico')
)
}
task launch4j(type: Exec, dependsOn: [':jar', ':launch4jConfig']) {
def launch4jCfg = file('build/launch4j/launch4j.xml')
def isWindows = System.properties['os.name'].startsWith('Windows')
def launch4jDir = System.getenv('LAUNCH4J_HOME')
if (launch4jDir == null || !(new File(launch4jDir).exists())) {
print "WARN: 'LAUNCH4J_HOME' not defined or invalid. Launch4j (http://launch4j.sourceforge.net) is required to generare the JETRIS Windows EXE file."
return
}
if (isWindows) {
commandLine 'cmd', '/c', launch4jDir + "/launch4j.exe", launch4jCfg
} else {
commandLine launch4jDir + "/launch4j", launch4jCfg
}
}
createDmg.onlyIf { System.properties['os.name'].startsWith('Mac') }