-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
executable file
·98 lines (86 loc) · 4 KB
/
build.xml
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
<project name="goobi-viewer-desktop" default="installer">
<property name="version" value="1.3.0" />
<property name="installer-name" value="Goobi-viewer-Desktop-Client" />
<property name="product-name" value="Goobi-viewer-Desktop-Client" />
<property name="output-dir" value="out" />
<property name="nsisant-path" value="lib-build/nsisant-1.3.jar" />
<property name="nsis-path" value="/usr/bin/" />
<property name="installer-icon" value="assets/icons/app_32.ico" />
<property name="make-result-path" value="out/make/deb/x64/" />
<property name="config-path" value="src/configs" />
<property name="locales-path" value="locales" />
<property name="icons-path" value="assets/icons" />
<property name="nsisfile-path" value="setup.nsi" />
<taskdef name="nsis" classname="com.danielreese.nsisant.Task" classpath="${nsisant-path}" />
<target name="installer-zlb" description="Build windows installer for https://digital.zlb.de/viewer">
<settheme theme="themes/zlb"/>
<echo message="Building NSIS installer for ZLB..." />
<antcall target="installer-windows">
<param name="product" value="Virtueller Lesesaal der Landesbibliothek Berlin"/>
<param name="installer" value="Virtueller Lesesaal der Landesbibliothek Berlin"/>
</antcall>
<antcall target="cleanup"/>
</target>
<target name="installer" description="Build installer for windows and linux systems">
<antcall target="installer-linux"></antcall>
<antcall target="installer-windows">
<param name="product" value="${product-name}"/>
<param name="installer" value="${installer-name}"/>
</antcall>
</target>
<target name="installer-windows" description="Build installer producing a windows executable installer file using nsis" depends="make-windows">
<echo message="Building NSIS installer..." />
<nsis script="setup.nsi" path="${nsis-path}" verbosity="4" noconfig="no">
<define name="PRODUCTPATH" value="${output-dir}/${product}-win32-x64/*" />
<define name="VERSION" value="${version}" />
<define name="PATH_OUTFILE" value="${output-dir}/${installer}_${version}.exe" />
<define name="MUI_ICON" value="${installer-icon}" />
</nsis>
</target>
<target name="installer-linux" description="Build installer producing a Debian-package for Ubuntu systems" depends="make-linux">
<echo message="Copying installer to ${output-dir}" />
<copy todir="${output-dir}" flatten="true">
<fileset dir="${make-result-path}"/>
</copy>
</target>
<target name="npm" description="Install npm dependencies">
<exec executable="npm">
<arg value="install"/>
</exec>
</target>
<target name="make-linux" description="Create product files for linux environment" depends="npm">
<echo message="Building .deb installer..." />
<exec executable="npx">
<arg value="electron-forge"/>
<arg value="make"/>
</exec>
</target>
<target name="make-windows" description="Create product files for windows environment" depends="npm">
<echo message="Packaging windows program files" />
<exec executable="npx">
<arg value="electron-forge"/>
<arg value="package"/>
<arg value="--platform=win32"/>
</exec>
</target>
<target name="cleanup" description="Replaces files changed by another target with the original values">
<settheme theme="themes/default"/>
</target>
<macrodef name="settheme" description="Replaces the default configuration files in 'src/configs' and 'locales' with the files from the folder specified in ${theme}">
<attribute name="theme"/>
<sequential>
<copy todir="${config-path}" flatten="false" overwrite="true" verbose="true">
<fileset dir="@{theme}/config"/>
</copy>
<copy todir="${locales-path}" flatten="false" overwrite="true" verbose="true">
<fileset dir="@{theme}/locales"/>
</copy>
<copy todir="${icons-path}" flatten="false" overwrite="true" verbose="true">
<fileset dir="@{theme}/icons"/>
</copy>
<copy tofile="${nsisfile-path}" flatten="false" overwrite="true" verbose="true">
<fileset file="@{theme}/${nsisfile-path}"/>
</copy>
</sequential>
</macrodef>
</project>