-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
72 lines (58 loc) · 1.79 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
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
task wrapper(type: Wrapper) {
gradleVersion = '4.5.1'
}
ext {
mainClassName = "StarSUDOKUMain"
}
// Keep this in sync with GV.VERSION
version ='1.0.1'
repositories {
mavenCentral()
}
dependencies {
compile 'itext:itext:1.3.1'
testCompile group: "org.testng", name: "testng", version: "6.14.3"
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
test {
useTestNG()
}
jar {
manifest {
attributes 'Implementation-Title': 'StarSUDOKU',
'Implementation-Version': version,
'Main-Class': "${mainClassName}"
}
// also include other jar dependencies
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
}
// Windows wrapper configuration to generate windows exe file with Launch4J
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/sudoku-icon.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 StarSUDOKU Windows EXE file."
return
}
if (isWindows) {
commandLine 'cmd', '/c', launch4jDir + "/launch4j.exe", launch4jCfg
} else {
commandLine launch4jDir + "/launch4j", launch4jCfg
}
}