-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.xml
213 lines (173 loc) · 8.56 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<project name="filebot-node" default="tar" xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:groovy="antlib:org.codehaus.groovy" xmlns:syno="antlib:net.filebot.ant.spk">
<property file="profile.properties" />
<property file="package.properties" />
<property name="release" value="${package}_${version}" />
<property name="dir.client" location="${basedir}/client-extjs" />
<property name="dir.server" location="${basedir}/server-nodejs" />
<property name="dir.package" location="${basedir}/package" />
<property name="dir.build" location="${basedir}/build" />
<property name="dir.lib" location="${basedir}/lib" />
<property name="dir.dist" location="${basedir}/dist" />
<property name="dir.release" location="${basedir}/release" />
<target name="build" description="Build">
<copy todir="${dir.build}/client" includeEmptyDirs="no">
<fileset dir="${dir.client}">
<exclude name="build/**" />
<exclude name="bootstrap.*" />
</fileset>
</copy>
<copy todir="${dir.build}/server" includeEmptyDirs="no">
<fileset dir="${dir.server}">
<exclude name="**/*.log" />
<exclude name="**/test/**" />
</fileset>
</copy>
<replace dir="${dir.build}" encoding="utf-8" summary="yes">
<include name="client/app.json" />
<include name="server/package.json" />
<replacefilter token="0.0.0" value="${version}" />
</replace>
<!-- run sencha app build -->
<exec executable="docker" failonerror="yes">
<arg line="run --rm -v '${dir.build}/client:/src' rednoah/sencha-build" />
<arg line="app build production" />
</exec>
<copy todir="${dir.dist}/generic/client">
<fileset dir="${dir.build}/client/build/production/FileBot">
<include name="**/*.html" />
<include name="**/*.css" />
<include name="**/*.js" />
<include name="**/*.json" />
<include name="**/*.png" />
<include name="**/*.gif" />
<include name="**/*.svg" />
</fileset>
</copy>
<copy todir="${dir.dist}/generic/server">
<fileset dir="${dir.build}/server">
<include name="**/*.js" />
<include name="**/*.json" />
</fileset>
</copy>
</target>
<target name="tar" description="Build Generic Package">
<tar destfile="${dir.release}/${release}.tar.xz" compression="xz" longfile="posix" encoding="utf-8">
<tarfileset dir="${dir.dist}/generic" />
<tarfileset dir="${dir.package}/generic" includes="*" filemode="755" />
</tar>
</target>
<target name="spk-dsm6" description="Build Synology Package (DSM 6.2.4)">
<syno:spk destdir="${dir.dist}" name="${package}" version="${version}" arch="noarch" compression="xz">
<info name="displayname" value="FileBot Node" />
<info name="description" value="FileBot Node allows you to execute and schedule filebot calls via Synology DSM. FileBot Node requires Node.js and FileBot." />
<info name="maintainer" value="FileBot" />
<info name="maintainer_url" value="https://www.filebot.net/" />
<info name="distributor" value="FileBot" />
<info name="distributor_url" value="https://www.filebot.net/" />
<info name="support_url" value="https://github.com/filebot/filebot-node/issues" />
<info name="helpurl" value="https://www.filebot.net/syno/support.html" />
<info name="ctl_stop" value="yes" />
<info name="silent_install" value="yes" />
<info name="silent_upgrade" value="yes" />
<info name="silent_uninstall" value="yes" />
<info name="dsmappname" value="FileBot.NodeClient" />
<info name="dsmuidir" value="client" />
<info name="thirdparty" value="yes" />
<info name="os_min_ver" value="6.2.4" />
<icon file="${dir.package}/synology/target/client/images/filebot_node_64.png" />
<icon size="256" file="${dir.package}/synology/target/client/images/filebot_node_256.png" />
<conf dir="${dir.package}/synology/conf" />
<scripts dir="${dir.package}/synology/scripts" filemode="755" />
<package dir="${dir.package}/synology/target" includes="bin/*, client/*.cgi" filemode="755" />
<package dir="${dir.package}/synology/target" excludes="bin/*, client/*.cgi" />
<package dir="${dir.dist}/generic" />
</syno:spk>
<copy file="${dir.dist}/${package}-${version}-noarch.spk" tofile="${dir.release}/${release}-dsm6.spk" />
</target>
<target name="syno-repo-dsm6" description="Update Synology Package Source (DSM 6.2.4)" depends="stats">
<syno:package-source file="${basedir}/syno-dsm6.json">
<spk file="${dir.release}/${release}-dsm6.spk">
<info name="link" value="https://github.com/filebot/filebot-node/releases/download/${version}/${release}-dsm6.spk" />
<info name="download_count" value="${download_count}" />
<thumbnail url="https://www.filebot.net/syno/filebot-node-thumbnail.png" />
<snapshot url="https://www.filebot.net/syno/filebot-node-snapshot.png" />
</spk>
</syno:package-source>
</target>
<target name="spk" description="Build Synology Package">
<syno:spk destdir="${dir.dist}" name="${package}" version="${version}" arch="noarch" compression="xz">
<info name="displayname" value="FileBot Node" />
<info name="description" value="FileBot Node allows you to execute and schedule filebot calls via Synology DSM. FileBot Node requires Node.js and FileBot." />
<info name="maintainer" value="FileBot" />
<info name="maintainer_url" value="https://www.filebot.net/" />
<info name="distributor" value="FileBot" />
<info name="distributor_url" value="https://www.filebot.net/" />
<info name="support_url" value="https://github.com/filebot/filebot-node/issues" />
<info name="helpurl" value="https://www.filebot.net/syno/support.html" />
<info name="ctl_stop" value="yes" />
<info name="silent_install" value="yes" />
<info name="silent_upgrade" value="yes" />
<info name="silent_uninstall" value="yes" />
<info name="dsmappname" value="FileBot.NodeClient.AppInstance" />
<info name="dsmuidir" value="client" />
<info name="thirdparty" value="yes" />
<info name="os_min_ver" value="7.0-41890" />
<icon file="${dir.package}/synology-dsm7/target/client/images/filebot_node_64.png" />
<icon size="256" file="${dir.package}/synology-dsm7/target/client/images/filebot_node_256.png" />
<conf dir="${dir.package}/synology-dsm7/conf" />
<scripts dir="${dir.package}/synology-dsm7/scripts" filemode="755" />
<package dir="${dir.package}/synology-dsm7/target" includes="bin/*, client/*.cgi" filemode="755" />
<package dir="${dir.package}/synology-dsm7/target" excludes="bin/*, client/*.cgi" />
<package dir="${dir.dist}/generic" />
</syno:spk>
<copy file="${dir.dist}/${package}-${version}-noarch.spk" tofile="${dir.release}/${release}.spk" />
</target>
<target name="syno-repo" description="Update Synology Package Source" depends="stats">
<syno:package-source file="${basedir}/syno.json">
<spk file="${dir.release}/${release}.spk">
<info name="link" value="https://github.com/filebot/filebot-node/releases/download/${version}/${release}.spk" />
<info name="download_count" value="${download_count}" />
<thumbnail url="https://www.filebot.net/syno/filebot-node-thumbnail.png" />
<snapshot url="https://www.filebot.net/syno/filebot-node-snapshot.png" />
</spk>
</syno:package-source>
</target>
<target name="qpkg" description="Build QNAP Package">
<property name="dir.staging" location="${dir.dist}/qpkg" />
<property name="dir.base" location="${dir.dist}/qpkg/shared" />
<copy todir="${dir.staging}">
<fileset dir="${dir.package}/qnap" />
</copy>
<copy todir="${dir.base}">
<fileset dir="${dir.dist}/generic" />
</copy>
<!-- fix execute permissions -->
<chmod verbose="yes" perm="+x">
<fileset dir="${dir.base}" includes="*" />
</chmod>
<exec executable="docker" failonerror="yes">
<arg line="run --rm -v ${dir.staging}:/src rednoah/qpkg-build --7zip --build-version ${version}" />
</exec>
<copy file="${dir.staging}/build/${package}_${version}.qpkg" tofile="${dir.release}/${release}.qpkg" />
</target>
<target name="checksum" description="Compute SHA-256 hashes">
<checksum algorithm="SHA-256" pattern="{0}" fileext=".sha256">
<fileset dir="${dir.release}" />
</checksum>
</target>
<target name="clean">
<delete includeEmptyDirs="true" failonerror="false">
<fileset defaultexcludes="false" dir="${dir.build}" />
<fileset defaultexcludes="false" dir="${dir.dist}" />
<fileset defaultexcludes="false" dir="${dir.release}" />
</delete>
</target>
<target name="resolve" description="Retrieve dependencies with Apache Ivy">
<delete dir="${dir.lib}" />
<ivy:retrieve pattern="${dir.lib}/[artifact]-[type].[ext]" />
</target>
<target name="stats">
<groovy:groovy src="build-stats.groovy" />
</target>
</project>