forked from filebot/filebot-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
153 lines (126 loc) · 5.84 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
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<project name="filebot-node" default="tar" xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:syno="antlib:net.filebot.ant.spk">
<property file="profile.properties" />
<property file="package.properties" />
<!-- define source dirs -->
<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="sencha" dir="${dir.build}/client">
<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.dist}/${package}-${version}-generic.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" 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="http://www.filebot.net/" />
<info name="distributor" value="FileBot" />
<info name="distributor_url" value="http://www.filebot.net/" />
<info name="support_url" value="https://github.com/filebot/filebot-node/issues" />
<info name="helpurl" value="http://www.filebot.net/syno/support.html" />
<info name="startable" value="yes" />
<info name="silent_install" value="yes" />
<info name="silent_upgrade" value="yes" />
<info name="silent_uninstall" value="yes" />
<info name="thirdparty" value="yes" />
<info name="dsmappname" value="net.filebot.NodeClient" />
<info name="dsmuidir" value="client" />
<info name="firmware" value="6.0" />
<!-- Dependencies are troublesome for some users because they cannot be skipped or ignored (i.e. DSM does not support optional or recommended dependencies) -->
<!-- <info name="install_dep_packages" value="filebot:Node.js_v4" /> -->
<info name="install_dep_packages" value="filebot" />
<icon size="72" file="${dir.package}/synology/package/client/images/filebot_node_72.png" />
<icon size="256" file="${dir.package}/synology/package/client/images/filebot_node_256.png" />
<!-- override generic server/start.sh with synology-specific configuration -->
<package dir="${dir.dist}/generic" />
<package dir="${dir.package}/synology/bin" filemode="755" />
<package dir="${dir.package}/synology/package" />
<scripts dir="${dir.package}/synology/scripts" filemode="755" />
<codesign secring="${dir.package}/gpg/secring.gpg" keyid="${gpg.key}" password="${gpg.pwd}" />
</syno:spk>
</target>
<target name="package-source" description="Update Synology Package Source">
<syno:package-source file="${basedir}/spksrc.json">
<keyring file="${dir.package}/gpg/FileBot.pub" />
<spk file="${dir.dist}/${package}-${version}-noarch.spk">
<info name="link" value="http://downloads.sourceforge.net/project/filebot/${package}/${package}-${version}/${package}-${version}-noarch.spk" />
<thumbnail url="http://app.filebot.net/syno/filebot-node-thumbnail.png" />
<snapshot url="http://app.filebot.net/syno/filebot-node-snapshot.png" />
</spk>
</syno:package-source>
</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="deploy" depends="tar, spk" description="Upload Synology Package">
<!-- prepare release packages -->
<copy todir="${dir.release}/${package}-${version}" verbose="yes">
<fileset dir="${dir.dist}">
<include name="*.tar.*" />
<include name="*.spk" />
</fileset>
</copy>
<!-- upload -->
<scp todir="${deploy.release}" trust="yes" verbose="true" sftp="true" keyfile="${deploy.keyfile}">
<fileset dir="${dir.release}">
<include name="**/*" />
</fileset>
</scp>
</target>
</project>