Skip to content

Commit 3c4132b

Browse files
committed
Merge remote-tracking branch 'arduino/macosx-sign-build' into ide-1.5.x
2 parents 6658d2a + 9b16f7b commit 3c4132b

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

build/build.xml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,52 @@
276276
</exec>
277277
</target>
278278

279+
<!-- - - - - - - - - - - - - - - - -->
280+
<!-- Sign application for MacOSX. -->
281+
<!-- - - - - - - - - - - - - - - - -->
282+
<target name="macosx-signed-dist" if="macosx" depends="macosx-singed-dist-check, dist"
283+
description="Create a downloadable and signed .zip for the Mac OS X version">
284+
<fail unless="version" message="Please set the property 'version' to correctly sign distribution file" />
285+
286+
<!-- Remove everything from working folder -->
287+
<delete dir="macosx/work/Arduino.app" />
288+
289+
<!-- Unzip unsigned app into working dir -->
290+
<unzip dest="macosx/work" src="macosx/arduino-${version}-${platform}.zip" overwrite="false"/>
291+
292+
<!-- Unlock keychain file -->
293+
<exec executable="security" dir="macosx/work">
294+
<arg line="unlock-keychain -p &quot;${macosx-sign-keychain-pass}&quot; &quot;${macosx-sign-keychain}&quot;" />
295+
</exec>
296+
297+
<!-- Sign app -->
298+
<exec executable="codesign" dir="macosx/work" failonerror="true">
299+
<arg line="--keychain &quot;${macosx-sign-keychain}&quot; -s &quot;${macosx-sign-id}&quot; -v Arduino.app/" />
300+
</exec>
301+
302+
<!-- Create signed zip file -->
303+
<exec executable="zip" dir="macosx/work">
304+
<arg line="-q -r ../arduino-${version}-${platform}-signed.zip ." />
305+
</exec>
306+
307+
<echo>
308+
=======================================================
309+
Arduino for Mac OS X built and signed.
310+
311+
macosx/arduino-${version}-${platform}-signed.zip
312+
=======================================================
313+
</echo>
314+
</target>
315+
316+
<target name="macosx-singed-dist-check">
317+
<fail unless="macosx-sign-keychain" message="Please set the property 'macosx-sign-keychain' to the correct keychain file" />
318+
<fail unless="macosx-sign-keychain-pass" message="Please set the property 'macosx-sign-keychain-pass' with the password to unlock the keychain" />
319+
<fail unless="macosx-sign-id" message="Please set the property 'macosx-sign-id' to the correct cert identifier" />
320+
</target>
321+
322+
<!-- - - - - - - - - - - - - - - - - - - -->
323+
<!-- Build distribution file for MacOSX. -->
324+
<!-- - - - - - - - - - - - - - - - - - - -->
279325
<target name="macosx-dist" if="macosx" depends="macosx-build" description="Create a downloadable .zip for the Mac OS X version">
280326
<!-- The ant copy command does not preserve permissions. -->
281327
<chmod file="macosx/work/Arduino.app/Contents/MacOS/JavaApplicationStub" perm="+x" />

0 commit comments

Comments
 (0)