forked from freeplane/freeplane
-
Notifications
You must be signed in to change notification settings - Fork 0
/
win.dist.gradle
100 lines (81 loc) · 3 KB
/
win.dist.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
import groovy.io.FileType
import org.apache.tools.ant.taskdefs.condition.Os
task windowsInstaller(type: Exec) {
onlyIf { Os.isFamily(Os.FAMILY_WINDOWS) }
ignoreExitValue = true
workingDir = rootDir.path + '/freeplane_framework/windows-installer'
commandLine 'cmd.exe', '/c', 'ISCC.exe /Q Freeplane_without_Java.iss'
doLast {
new File(workingDir, 'Freeplane-Setup.exe').renameTo(new File(globalDist, "Freeplane-Setup-${distVersion}.exe"))
}
for (p in subprojects) {
dependsOn p.tasks.getByPath("build")
}
}
def portableInstallerDir = new File(globalDist, 'FreeplanePortable').path
task copyWindowsPortableInstallerBasicFiles(type: Copy) {
onlyIf { Os.isFamily(Os.FAMILY_WINDOWS) }
// copy windows-portable files
from(rootDir.path + '/freeplane_framework/windows-portable') {
include('**')
}
into(portableInstallerDir)
}
task copyWindowsPortableInstallerLicense(type: Copy) {
onlyIf { Os.isFamily(Os.FAMILY_WINDOWS) }
// copy license
from(rootDir.path + '/freeplane/resources/') {
include('license.txt')
rename('license.txt', 'EULA.txt')
}
into(portableInstallerDir + '/Other/Source/')
}
task copyWindowsPortableInstallerIcon(type: Copy) {
onlyIf { Os.isFamily(Os.FAMILY_WINDOWS) }
// copy icon
from(rootDir.path + '/freeplane_framework/launch4j') {
include('Freeplane_app.ico')
rename('Freeplane_app.ico', 'appicon.ico')
}
into(portableInstallerDir + '/App/AppInfo/')
}
task copyWindowsPortableInstallerFiles(type: Copy) {
onlyIf { Os.isFamily(Os.FAMILY_WINDOWS) }
// copy INI I
from(rootDir.path + '/freeplane_framework/portableApps') {
include('portable.ini')
rename('portable.ini', 'freeplane.l4j.ini')
}
// copy INI II
from(rootDir.path + '/freeplane_framework/portableApps') {
include('portable.ini')
rename('portable.ini', 'freeplaneConsole.l4j.ini')
}
// copy all other files
from (globalBin) {
exclude('*.bat', '*.ini', '*.sh')
exclude('doc/api/**')
}
into(portableInstallerDir + '/App/Freeplane/')
for (p in subprojects) {
dependsOn p.tasks.getByPath("build")
}
dependsOn copyWindowsPortableInstallerBasicFiles
dependsOn copyWindowsPortableInstallerLicense
dependsOn copyWindowsPortableInstallerIcon
}
task windowsPortableInstaller(type: Exec) {
onlyIf { Os.isFamily(Os.FAMILY_WINDOWS) }
// continue the build when running windows but PortableApps.comInstaller.exe is not installed?
ignoreExitValue = true
workingDir = rootDir.path + '/freeplane_framework'
commandLine 'cmd.exe', '/c', 'PortableApps.comInstaller.exe', portableInstallerDir
dependsOn copyWindowsPortableInstallerFiles
doLast {
new File(portableInstallerDir).deleteDir()
new File(globalDist).eachFileMatch(FileType.FILES, ~/FreeplanePortable_.*\.paf\.exe/) {
f ->
f.renameTo(new File(globalDist, "FreeplanePortable-${distVersion}.paf.exe"))
}
}
}