-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
107 lines (89 loc) · 3 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
plugins {
id 'java'
id 'application'
id 'com.github.johnrengelman.shadow' version '5.0.0'
id 'edu.sc.seis.launch4j' version '2.4.4'
}
def getVersionName = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--tags'
standardOutput = stdout
}
return stdout.toString().trim()
}
mainClassName = 'com.proxy.kiwi.app.Kiwi'
version = getVersionName()
repositories {
mavenCentral()
jcenter()
}
jar {
manifest {
attributes 'Main-Class': project.mainClassName
}
}
dependencies {
compile group: "com.google.code.gson", name: "gson", version: "2.3.1"
compile group: "com.github.junrar", name: "junrar", version: "3.1.0"
compile group: "commons-io", name: "commons-io", version: "1.3.2"
compile group: "com.drewnoakes", name: "metadata-extractor", version: "2.9.1"
compile group: "org.imgscalr", name: "imgscalr-lib", version: "4.2"
compile group: "org.apache.ant", name: "ant", version: "1.8.1"
compile group: "com.twelvemonkeys.imageio", name: "imageio-jpeg", version: "3.3"
compile group: "com.twelvemonkeys.imageio", name: "imageio-tiff", version: "3.3"
compile group: "com.dorkbox", name: "SystemTray", version: "3.1"
compile group: "net.java.dev.jna", name: "jna", version: "4.3.0"
}
launch4j {
outfile = 'Kiwi.exe'
mainClassName = project.mainClassName
copyConfigurable = project.tasks.shadowJar.outputs.files
icon = "${projectDir}/src/main/resources/image/kiwi.ico"
jar = "lib/${project.tasks.shadowJar.archiveName}"
fileDescription = 'Portable and Lighting fast image viewer'
}
task debugExecutable(type: edu.sc.seis.launch4j.tasks.Launch4jLibraryTask) {
outfile = 'Kiwi-debug.exe'
fileDescription = 'With STDOUT'
stayAlive = true
headerType = "console"
}
import org.apache.tools.ant.filters.ReplaceTokens
task createInstaller() {
def innoSetupDir = new File("${buildDir}/innosetup")
def deployFiles = "${rootProject.projectDir}/src/main/resources/windows"
delete innoSetupDir
innoSetupDir.mkdir();
copy {
from(deployFiles) {
exclude("**/*.iss")
}
from(deployFiles) {
include("**/*.iss")
filter(ReplaceTokens, tokens: [
name: 'Kiwi',
version: ""+project.version,
description: "Kiwi - A lightweight Image Viewer",
author: "Daniel Koudouna"
])
}
into(innoSetupDir)
}
copy {
from("${buildDir}/launch4j")
into("${buildDir}/innosetup/Kiwi")
}
exec {
workingDir rootProject.projectDir
String iscc = "C:\\Program Files (x86)\\Inno Setup 5\\iscc.exe"
String setupFile = "${buildDir}/innosetup/Kiwi.iss"
commandLine "cmd", "/c", iscc, setupFile
}
copy {
from("${buildDir}/innosetup/Output")
into("${buildDir}/dist")
}
delete "${buildDir}/innosetup/Output"
}
createAllExecutables.finalizedBy(createInstaller)