forked from qzind/tray
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
145 lines (126 loc) · 5.94 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?xml version="1.0" encoding="UTF-8"?>
<project name="qz" default="distribute" basedir=".">
<property file="ant/project.properties"/>
<import file="ant/javafx.xml"/>
<import file="ant/signing.xml"/>
<import file="ant/apple/installer.xml"/>
<import file="ant/linux/installer.xml"/>
<import file="ant/windows/installer.xml"/>
<target name="distribute" depends="init,clean,download-javafx,build-jar,override-authcert,include-assets,whitelist-certs">
<antcall target="tidy-javafx-dist"/>
<echo level="info">Process complete</echo>
</target>
<target name="init">
<condition property="codesign.windows" value="true">
<and>
<isset property="target.platform.windows"/>
<isset property="signing.tsaurl"/>
</and>
</condition>
<condition property="codesign.linux" value="true">
<and>
<isset property="target.platform.linux"/>
<isset property="signing.tsaurl"/>
</and>
</condition>
<condition property="codesign.mac" value="true">
<and>
<isset property="target.platform.mac"/>
<isset property="signing.tsaurl"/>
</and>
</condition>
<echo message="Building ${project.filename} using JDK ${ant.java.version}"/>
</target>
<target name="clean" depends="init">
<delete dir="${out.dir}"/>
</target>
<target name="compile-socket" depends="init">
<mkdir dir="${build.dir}/${project.filename}"/>
<!-- find the pdfbox jar -->
<path id="pdfbox.found">
<first>
<fileset dir="lib/printing/">
<include name="pdfbox*.jar"/>
</fileset>
</first>
</path>
<pathconvert property="pdfbox.path" refid="pdfbox.found"/>
<javac destdir="${build.dir}/${project.filename}" source="${javac.source}" target="${javac.target}" includeantruntime="false" encoding="UTF-8">
<src path="${src.dir}"/>
<classpath>
<!-- prefer bouncycastle from pdfbox over simplersa -->
<path id="plugin.override">
<pathelement path="${pdfbox.path}"/>
</path>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${java.home}">
<include name="**/*.jar"/>
</fileset>
</classpath>
<compilerarg value="-Xlint:-options"/>
</javac>
<!-- Include non-class files from src in build directory -->
<copy todir="${build.dir}/${project.filename}">
<fileset dir="${src.dir}" excludes="**/*.java"/>
</copy>
<copy todir="${dist.dir}">
<fileset file="LICENSE.txt"/>
</copy>
</target>
<target name="build-jar" depends="compile-socket">
<!-- Apple: Extract, sign, repackage all nested native libs for notarization -->
<antcall target="apple-installer.codesign-jars"/>
<echo level="info">Building Jar for Socket use</echo>
<mkdir dir="${sign.lib.dir}"/>
<jar compress="${jar.compress}" index="${jar.index}" destfile="${dist.dir}/${project.filename}.jar" duplicate="preserve">
<fileset dir="${build.dir}/${project.filename}"/>
<zipgroupfileset dir="${sign.lib.dir}" includes="**/*.jar" erroronmissingdir="false"/>
<zipgroupfileset dir="lib">
<include name="**/*.jar"/>
<exclude name="**/jfxrt.jar"/>
<exclude name="**/jssc-*.jar" if="codesign.mac"/>
</zipgroupfileset>
<manifest>
<attribute name="Application-Name" value="${project.name}"/>
<attribute name="Main-Class" value="qz.ws.PrintSocketServer"/>
<attribute name="Permissions" value="all-permissions"/>
</manifest>
</jar>
<antcall target="sign-jar">
<param name="sign.jar.file" value="${dist.dir}/${project.filename}.jar"/>
</antcall>
</target>
<!-- install override.crt for "community" branded builds -->
<target name="override-authcert" if="authcert.use">
<echo level="info">Bundling with manual cert for signing auth: ${authcert.use}</echo>
<!-- See also: Constants.OVERRIDE_CERT -->
<property description="suppress-property-warning" name="authcert.use" value="override.crt"/>
<copy file="${authcert.use}" tofile="${dist.dir}/override.crt" overwrite="true"/>
</target>
<!-- install certs to "whitelist" directory for whitelabel builds -->
<target name="whitelist-certs" depends="include-assets" if="whitelist.use">
<echo level="info">Copying certificate(s) to dist/whitelist: ${whitelist.use}</echo>
<!-- See also: Constants.WHITELIST_CERT_DIR -->
<mkdir dir="${dist.dir}/whitelist"/>
<property description="suppress property warning" name="whitelist.use" value=""/>
<copy file="${whitelist.use}" todir="${dist.dir}/whitelist" overwrite="true"/>
</target>
<target name="include-assets" depends="init" unless="dist.minimal">
<echo level="info">Copying resource files to output</echo>
<!-- Create the demo folder -->
<copy todir="${dist.dir}/demo">
<fileset file="sample.html"/>
<fileset dir="${basedir}" includes="css/**"/>
<fileset dir="${basedir}" includes="fonts/**"/>
<fileset dir="${basedir}" includes="js/**/*.js"/>
<fileset dir="${basedir}" includes="assets/**">
<exclude name="**/branding/"/>
</fileset>
</copy>
</target>
<target name="nsis" depends="nsis-preflight,distribute,build-exe"/>
<target name="pkgbuild" depends="pkgbuild-preflight,distribute,build-pkg"/>
<target name="makeself" depends="makeself-preflight,distribute,build-run"/>
</project>