-
-
Notifications
You must be signed in to change notification settings - Fork 129
/
build.xml
executable file
·247 lines (186 loc) · 7.86 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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<?xml version="1.0"?>
<project name="Processing Video Library" default="build">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<property environment="env"/>
<property file="local.properties" />
<condition property="props.present">
<available file="local.properties" />
</condition>
<fail unless="processing.dir"
message="To make the build work, create a file named local.properties, with a line that reads:
${line.separator}processing.dir=/path/to/processing-git
${line.separator}with the path to where you have the code for Processing 4 checked out. ${line.separator}(This script will look for the 'core' directory inside that folder.)" />
<subant buildpath="${processing.dir}/core" />
<property name="core.dir" value="${processing.dir}/core/library" />
<condition property="processing.built">
<available file="${core.dir}/core.jar" />
</condition>
<fail unless="processing.built"
message="Please first build Processing so that we have a usable core.jar to bundle with the app." />
<property name="core.classpath.location" value="${processing.dir}/core/library/" />
<property name="compiler.classpath.location" value="${processing.dir}/java/mode/" />
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<target name="clean" description="Clean the build directories">
<delete dir="bin" />
<delete file="library/video.jar" />
</target>
<target name="compile" description="Compile sources">
<condition property="core-built">
<available file="${core.classpath.location}/core.jar" />
</condition>
<fail unless="core-built" message="Please build the core library first and make sure it sits in ${core.classpath.location}/core.jar" />
<mkdir dir="bin" />
<javac source="1.8"
target="1.8"
srcdir="src" destdir="bin"
encoding="UTF-8"
includeAntRuntime="false"
classpath="${core.classpath.location}/core.jar;
library/gst1-java-core-1.4.0.jar;
library/jna.jar"
nowarn="true">
<compilerclasspath path="${compiler.classpath.location}/org.eclipse.jdt.core.jar;
${compiler.classpath.location}/jdtCompilerAdapter.jar" />
</javac>
</target>
<target name="build" depends="compile" description="Build video library">
<jar basedir="bin" destfile="library/video.jar" />
<delete dir="bin" />
</target>
<target name="macosx-dist-sign" if="env.APPLE_DEV_COMMON_NAME">
<echo>
Code signing will only work if you have a $99/yr Apple developer ID.
With a proper ID, if code signing fails, you may need to use:
export CODESIGN_ALLOCATE="/Applications/Xcode.app/Contents/Developer/usr/bin/codesign_allocate"
</echo>
<!-- Need to create a Developer ID Application certificate />-->
<!-- https://developer.apple.com/account/resources/certificates/list -->
<apply executable="/usr/bin/codesign" dir="library" failonerror="true">
<arg value="--sign" />
<arg value="${env.APPLE_DEV_COMMON_NAME}" />
<!-- remove all other signatures -->
<arg value="--force" />
<arg value="--entitlements" />
<arg value="../ffs.entitlements" />
<!-- recursively sign everything -->
<arg value="--deep" />
<!-- enable the "hardened runtime" -->
<arg value="--options" />
<arg value="runtime" />
<multirootfileset basedirs="library/macos-aarch64,library/macos-x86_64">
<patternset>
<include name="**/*.dylib" />
</patternset>
</multirootfileset>
</apply>
<!-- Verify that the signature will pass Gatekeeper checks
https://developer.apple.com/library/mac/technotes/tn2206 -->
<!--
<exec executable="/usr/bin/codesign" dir="macosx/work">
<arg value="- -verify" />
<arg value="- -deep" />
<arg value="- -verbose=2" />
<arg value="Processing.app" />
</exec>
-->
<!-- Disabling since it's a lot of gunk but not that useful. -->
<echo>
Signed Gstreamer libraries
</echo>
</target>
<target name="macosx-dist-notarize" if="env.APPLE_ID">
<!-- xcrun: error: unable to find utility "altool", not a developer tool or in PATH -->
<!-- fix with 'sudo xcode-select -r' -->
<!-- when it's time to sign/update documents or make an app password: -->
<!-- https://appleid.apple.com/account/manage -->
<exec executable="/usr/bin/xcrun" dir="dist" failonerror="true">
<arg value="altool" />
<arg value="--notarize-app" />
<!-- spew a bunch of useless garbage that has nothing to do with success/failure -->
<!-- <arg value="- -verbose" /> -->
<arg value="--primary-bundle-id" />
<arg value="processing.video" />
<arg value="--username" />
<arg value="${env.APPLE_ID}" />
<arg value="--password" />
<arg value="${env.VIDEO_LIB_PASSWORD}" />
<arg value="--asc-provider" />
<arg value="${env.PROVIDER_SHORT_NAME}" />
<arg value="--file" />
<arg value="video.zip" />
</exec>
<echo>
Check on notarization status with:
xcrun altool -u $APPLE_ID -p $VIDEO_LIB_PASSWORD --notarization-info [the RequestUUID above]
</echo>
</target>
<target name="dist" depends="build" description="Creates distribution package">
<mkdir dir="dist/tmp/video" />
<antcall target="macosx-dist-sign" />
<!-- copy library files (jar and gstreamer natives) -->
<exec executable="cp">
<arg value="-R"/>
<arg line="library dist/tmp/video"/>
</exec>
<!-- copy examples -->
<copy todir="dist/tmp/video/examples">
<fileset dir="examples" />
</copy>
<!-- copy source -->
<copy todir="dist/tmp/video/src">
<fileset dir="src" />
</copy>
<!-- copy properties -->
<copy file="library.properties" tofile="dist/tmp/video/library.properties" />
<!-- create the java reference of the library -->
<mkdir dir="dist/tmp/video/reference" />
<javadoc bottom="Processing video library by The Processing Foundation. (c) 2011-22"
classpath="${core.classpath.location}/core.jar;
library/gst1-java-core-1.4.0.jar;
library/jna.jar;
bin"
destdir="dist/tmp/video/reference"
verbose="false"
stylesheetfile="resources/stylesheet.css"
public="true" version="false"
doctitle="Javadocs: Video"
windowtitle="Javadocs: Video">
<link href="https://docs.oracle.com/en/java/javase/11/docs/api/" />
<tag name="webref" enabled="false" />
<tag name="nowebref" enabled="false" />
<tag name="generate" enabled="false" />
<tag name="instanceName" enabled="false" />
<tag name="see_external" enabled="false" />
<tag name="brief" description="In brief:" />
<tag name="usage" />
<arg value="-Xdoclint:reference,accessibility" />
<packageset dir="dist/tmp/video/src">
<include name="**/*" />
</packageset>
</javadoc>
<!-- create zip package -->
<delete file="dist/video.zip"/>
<echo>
Creating zip package...
</echo>
<exec executable="find" dir="dist">
<arg line="tmp -name '.DS_Store' -type f -delete" />
</exec>
<exec executable="ditto" dir="dist">
<arg line="-c -k -rsrc tmp video.zip" />
</exec>
<echo>
Done!
</echo>
<!-- copy properties to use by download manager -->
<copy file="library.properties" tofile="dist/video.txt" />
<delete dir="dist/tmp" />
<antcall target="macosx-dist-notarize" />
<echo>
=======================================================
Processing Video Library was built. Grab it from
dist/video.zip
=======================================================
</echo>
</target>
</project>