-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.xml
164 lines (134 loc) · 7.06 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
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<project name="filebot-website" default="website" xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:groovy="antlib:org.codehaus.groovy" xmlns:syno="antlib:net.filebot.ant.spk">
<!-- define source dirs -->
<property name="www.dist" location="dist/filebot.net" />
<property name="www.src" location="www.filebot.net" />
<!-- import property files -->
<property file="${basedir}/app.properties" />
<!-- define release files -->
<property name="release" value="${application.name}_${application.version}" />
<property name="link.release.prefix" value="${link.release.index}/${release}/${release}" />
<property name="repo.release" location="get.filebot.net/filebot/${release}" />
<property name="repo.deb" location="get.filebot.net/deb" />
<property name="repo.rpm" location="get.filebot.net/rpm" />
<property name="repo.syno" location="get.filebot.net/syno" />
<property name="repo.qnap" location="get.filebot.net/qnap" />
<property name="dist.deb.main" location="dist/deb/main" />
<property name="dist.deb.universal" location="dist/deb/universal" />
<property name="dist.deb.universal-jdk8" location="dist/deb/universal-jdk8" />
<property name="dist.rpm.main" location="dist/rpm/main" />
<property name="gpg.home" location="gpg" />
<!-- timestamp variables -->
<tstamp prefix="tstamp">
<format property="year" pattern="yyyy" />
</tstamp>
<target name="website" description="Build website">
<!-- copy static website resources -->
<copy todir="${www.dist}" preservelastmodified="yes" verbose="yes">
<fileset dir="${www.src}" />
</copy>
<!-- copy text files and replace ant variables -->
<copy-replace todir="${www.dist}">
<fileset dir="${www.src}">
<include name="**/*.htaccess" />
<include name="**/*.html" />
<include name="**/*.php" />
</fileset>
</copy-replace>
</target>
<!-- @require https://github.com/rednoah/prm -->
<target name="deb" description="Update DEB Package Repository">
<delete dir="${repo.deb}/dists" verbose="yes" />
<!-- fix permissions -->
<exec executable="docker" failonerror="yes">
<arg line="run --rm -v GNUPG:/root/.gnupg -v ${gpg.home}:/gpg --entrypoint sh rednoah/prm-build -c" />
<arg value="cp -rvf /gpg/* /root/.gnupg; find /root/.gnupg -type f -exec chmod 600 {} +; find /root/.gnupg -type d -exec chmod 700 {} +" />
</exec>
<!-- main -->
<copy todir="${dist.deb.main}" flatten="yes" preservelastmodified="yes" verbose="yes">
<fileset dir="${repo.release}" includes="*_amd64.deb" />
</copy>
<exec executable="docker" failonerror="yes">
<arg line="run --rm -v ${dist.deb.main}:/dist -v ${repo.deb}:/repo -v GNUPG:/root/.gnupg rednoah/prm-build" />
<arg line="--directory /dist --type deb --release stable --component main --arch amd64 --path /repo --gpg ${package.maintainer} --gpg_sign_algorithm SHA256" />
</exec>
<!-- universal -->
<copy todir="${dist.deb.universal}" flatten="yes" preservelastmodified="yes" verbose="yes">
<fileset dir="${repo.release}" includes="*_universal.deb" />
</copy>
<exec executable="docker" failonerror="yes">
<arg line="run --rm -v ${dist.deb.universal}:/dist -v ${repo.deb}:/repo -v GNUPG:/root/.gnupg rednoah/prm-build" />
<arg line="--directory /dist --type deb --release universal --component main --arch all --path /repo --gpg ${package.maintainer} --gpg_sign_algorithm SHA256" />
</exec>
<!-- universal-jdk8 -->
<copy todir="${dist.deb.universal-jdk8}" flatten="yes" preservelastmodified="yes" verbose="yes">
<fileset dir="${repo.release}" includes="*_universal-jdk8.deb" />
</copy>
<exec executable="docker" failonerror="yes">
<arg line="run --rm -v ${dist.deb.universal-jdk8}:/dist -v ${repo.deb}:/repo -v GNUPG:/root/.gnupg rednoah/prm-build" />
<arg line="--directory /dist --type deb --release universal-jdk8 --component main --arch all --path /repo --gpg ${package.maintainer} --gpg_sign_algorithm SHA256" />
</exec>
</target>
<!-- @require https://github.com/rednoah/prm -->
<target name="rpm" description="Update RPM Package Repository">
<delete dir="${repo.rpm}/main" verbose="yes" />
<!-- fix permissions -->
<exec executable="docker" failonerror="yes">
<arg line="run --rm -v GNUPG:/root/.gnupg -v ${gpg.home}:/gpg --entrypoint sh rednoah/prm-build -c" />
<arg value="cp -rvf /gpg/* /root/.gnupg; find /root/.gnupg -type f -exec chmod 600 {} +; find /root/.gnupg -type d -exec chmod 700 {} +" />
</exec>
<!-- main -->
<copy todir="${dist.rpm.main}" flatten="yes" preservelastmodified="yes" verbose="yes">
<fileset dir="${repo.release}" includes="*_amd64.rpm" />
</copy>
<exec executable="docker" failonerror="yes">
<arg line="run --rm -v ${dist.rpm.main}:/dist -v ${repo.rpm}:/repo -v GNUPG:/root/.gnupg rednoah/prm-build" />
<arg line="--directory /dist --type rpm --release main --arch x86_64 --path /repo --gpg ${package.maintainer} --gpg_sign_algorithm SHA256" />
</exec>
</target>
<target name="syno" description="Update Synology Package Source">
<!-- DSM 7 -->
<syno:package-source file="${repo.syno}/index.json">
<spk file="${repo.release}/${release}.spk">
<info name="link" value="${link.release.prefix}.spk" />
<thumbnail url="https://www.filebot.net/syno/filebot-thumbnail.png" />
<snapshot url="https://www.filebot.net/syno/filebot-snapshot.png" />
</spk>
<source url="https://raw.githubusercontent.com/filebot/filebot-node/master/syno.json" />
<source url="https://raw.githubusercontent.com/rednoah/java-installer/latest/syno.json" />
</syno:package-source>
<!-- DSM 6.2.4 -->
<syno:package-source file="${repo.syno}/dsm6.json">
<spk file="${repo.release}/${release}-dsm6.spk">
<info name="link" value="${link.release.prefix}-dsm6.spk" />
<thumbnail url="https://www.filebot.net/syno/filebot-thumbnail.png" />
<snapshot url="https://www.filebot.net/syno/filebot-snapshot.png" />
</spk>
<source url="https://raw.githubusercontent.com/filebot/filebot-node/master/syno-dsm6.json" />
<source url="https://raw.githubusercontent.com/rednoah/java-installer/latest/syno-dsm6.json" />
</syno:package-source>
</target>
<target name="qnap" description="Update QNAP App Repository">
<property prefix="filebot-node" url="https://raw.githubusercontent.com/filebot/filebot-node/master/package.properties" />
<property prefix="java-installer" url="https://raw.githubusercontent.com/rednoah/java-installer/latest/package.properties" />
<groovy:groovy src="build-qnap.groovy" />
</target>
<target name="resolve" description="Retrieve dependencies with Apache Ivy">
<delete dir="lib" />
<ivy:retrieve pattern="lib/[artifact]-[type].[ext]" />
</target>
<macrodef name="copy-replace" description="Copy text files and replace ant variables">
<attribute name="todir" />
<element name="filesets" implicit="yes" />
<sequential>
<copy todir="@{todir}" verbose="yes" encoding="utf-8" overwrite="yes" preservelastmodified="no">
<filesets />
<filterset begintoken="@{" endtoken="}">
<propertyset>
<propertyref builtin="all" />
</propertyset>
</filterset>
</copy>
</sequential>
</macrodef>
</project>