REVERT because app store rejects build for no reason / crashes silently

This commit is contained in:
Reinhard Pointner 2016-11-14 05:00:02 +08:00
parent b8f0729e24
commit bc60354b7b
1 changed files with 54 additions and 62 deletions

116
build.xml
View File

@ -380,29 +380,11 @@
<target name="appbundle-maspkg" depends="revision">
<property name="path.app" location="${dir.dist}/${application.name}.app" />
<property name="path.pkg" location="${dir.dist}/${application.name}_${version}_r${revision}.pkg" />
<property name="path.app" value="${application.name}.app" />
<property name="path.pkg" value="${application.identifier}_${version}_r${revision}.pkg" />
<property name="path.app.jre" location="${path.app}/Contents/PlugIns/jre1.${jre.major}.0_${jre.build}.jre" />
<property name="jre.path" location="${dir.cache}/jre1.${jre.major}.0_${jre.build}.jre/Contents/Home" />
<!-- fetch latest JRE -->
<exec executable="get-java.sh" dir="${dir.cache}" failonerror="yes" />
<copy todir="${dir.cache}">
<tarfileset>
<gzipresource>
<file file="${dir.cache}/jre-${jre.major}u${jre.build}-macosx-x64.tar.gz" />
</gzipresource>
<exclude name="**/bin/**" />
<exclude name="**/man/**" />
<!-- webkit uses deprecate font libraries which is not allowed in the app store -->
<exclude name="**/libjfxmedia_qtkit.dylib" />
<exclude name="**/libjfxwebkit.dylib" />
</tarfileset>
</copy>
<property name="jre.version" value="jdk1.${jre.major}.0_${jre.build}.jdk" />
<property name="jre.path" value="/Library/Java/JavaVirtualMachines/${jre.version}/Contents/Home" />
<bundleapp jvmrequired="${jvm.version}" minimumsystemversion="${mac.version}" outputdirectory="${dir.dist}" executablename="${application.executable}" name="${application.name}" displayname="${application.name}" version="${revision}" shortversion="${version}" identifier="${application.identifier}" mainclassname="${main.class}" icon="${application.icon}" copyright="${tstamp.year} ${package.company}" applicationcategory="${mac.application.category}" highresolutioncapable="true" supportsautomaticgraphicsswitching="true" debug="true">
<classpath file="${path.fatjar}" />
@ -416,15 +398,16 @@
<argument value="${application.mode}" />
<!-- WORKING_DIR is sandbox data folder -->
<option value="-Dapplication.dir=Library/Application Support/User Data" />
<option value="-Dapplication.cache=Library/Caches/ehcache.disk.store" />
<option value="-Djava.io.tmpdir=Library/Caches/java.io.tmpdir" />
<option value="-Dapplication.dir=./Library/Application Support/User Data" />
<option value="-Dapplication.cache=./Library/Caches/ehcache.disk.store" />
<option value="-Djava.io.tmpdir=./Library/Caches/java.io.tmpdir" />
<option value="-Dnet.filebot.UserFiles.fileChooser=COCOA" />
<option value="-Dapplication.name=${application.name}" />
<option value="-Dapplication.help=${application.help}" />
<option value="-Dapplication.deployment=mas" />
<option value="-Dapplication.update=skip" />
<option value="-Dunixfs=false" />
<option value="-DuseExtendedFileAttributes=true" />
<option value="-DuseCreationDate=false" />
@ -435,7 +418,6 @@
<option value="-Djna.nounpack=true" />
<option value="-Djna.boot.library.name=jnidispatch" />
<option value="-Djna.boot.library.path=$APP_ROOT/Contents/MacOS" />
<option value="-Djna.library.path=$APP_ROOT/Contents/MacOS" />
<option value="-Djava.library.path=$APP_ROOT/Contents/MacOS" />
<option value="-Dnet.filebot.AcoustID.fpcalc=$APP_ROOT/Contents/MacOS/fpcalc" />
@ -447,69 +429,79 @@
<bundledocument role="viewer" handlerRank="none" contentTypes="public.folder" name="Media folder" />
</bundleapp>
<!-- remove unused language resources -->
<!-- fix code signing and submission issues -->
<delete verbose="yes" includeEmptyDirs="yes">
<fileset dir="${path.app}/Contents/Resources">
<include name="**.lproj/**" />
<fileset dir="${dir.dist}/${path.app}/Contents/PlugIns">
<include name="**/libjfxmedia_qtkit.dylib" />
<include name="**/libjfxwebkit.dylib" />
<include name="**/Contents/Info.plist" />
<include name="**/Contents/MacOS/libjli.dylib" />
</fileset>
<fileset dir="${dir.dist}/${path.app}/Contents/Resources">
<exclude name="en.lproj/**" />
<exclude name="*.icns" />
</fileset>
</delete>
<copy verbose="yes" failonerror="yes" overwrite="yes" file="/Library/Java/JavaVirtualMachines/${jre.version}/Contents/Info.plist" tofile="${dir.dist}/${path.app}/Contents/PlugIns/${jre.version}/Contents/Info.plist" />
<copy verbose="yes" failonerror="yes" overwrite="yes" file="/Library/Java/JavaVirtualMachines/${jre.version}/Contents/MacOS/libjli.dylib" tofile="${dir.dist}/${path.app}/Contents/PlugIns/${jre.version}/Contents/MacOS/libjli.dylib" />
<!-- fix broken symlink -->
<copy file="${jre.path}/lib/jli/libjli.dylib" tofile="${path.app.jre}/Contents/MacOS/libjli.dylib" overwrite="yes" verbose="yes" failonerror="yes" />
<!-- fix permissions (fpcalc and jspawnhelper be executable and signed with inherit entitlements) -->
<chmod perm="+x">
<fileset dir="${path.app}">
<include name="**/jspawnhelper" />
<include name="**/fpcalc" />
<include name="**/*.sh" />
</fileset>
</chmod>
<!-- fix permissions -->
<chmod verbose="yes" dir="${dir.dist}" includes="**/fpcalc" perm="+x" />
<chmod verbose="yes" dir="${dir.dist}" includes="**/*.sh" perm="+x" />
<chmod verbose="yes" dir="${dir.dist}/${path.app}/Contents/PlugIns" perm="+rw" />
<!-- JRE sign all jars, dylibs and executables -->
<property name="codesign.opts" value="--verbose --force --sign '${application.cert.appbundle}'" />
<property name="codesign.opts" value="--verbose=4 --force --sign '${application.cert.appbundle}'" />
<property name="codesign.entitlements" value="--entitlements '${dir.installer}/appbundle/FileBot.entitlements'" />
<property name="codesign.entitlements.inherit" value="--entitlements '${dir.installer}/appbundle/inherit.entitlements'" />
<!-- sign helper tools with inherit entitlements -->
<apply executable="codesign" failonerror="yes">
<apply executable="codesign">
<arg line="${codesign.opts} ${codesign.entitlements.inherit}" />
<fileset dir="${path.app}">
<srcfile />
<fileset dir="${dir.dist}/${path.app}/Contents/PlugIns">
<include name="**/jspawnhelper" />
<include name="**/fpcalc" />
<include name="**/*.dylib" />
<include name="**/*.jar" />
</fileset>
</apply>
<!-- sign frameworks -->
<apply executable="codesign" parallel="yes" failonerror="yes">
<arg line="${codesign.opts}" />
<fileset dir="${path.app}">
<include name="**/*.dylib" />
<include name="**/*.sh" />
<!-- sign cmdline tool first -->
<exec dir="${dir.dist}/${path.app}" executable="codesign">
<arg line="${codesign.opts} ${codesign.entitlements.inherit} Contents/MacOS/fpcalc" />
</exec>
<!-- APP sign all jars, dylibs and executables -->
<apply executable="codesign">
<arg line="${codesign.opts} ${codesign.entitlements}" />
<srcfile />
<fileset dir="${dir.dist}/${path.app}/Contents">
<include name="MacOS/*.dylib" />
<include name="MacOS/*.sh" />
<include name="Java/*.jar" />
</fileset>
</apply>
<!-- sign app with entitlements -->
<exec executable="codesign" failonerror="yes">
<arg line="${codesign.opts} '${path.app.jre}'" />
<exec dir="${dir.dist}" executable="codesign">
<arg line="${codesign.opts} ${codesign.entitlements} '${path.app}/Contents/PlugIns/${jre.version}'" />
</exec>
<exec executable="codesign" failonerror="yes">
<exec dir="${dir.dist}" executable="codesign">
<arg line="${codesign.opts} ${codesign.entitlements} '${path.app}'" />
</exec>
<!-- verify signature -->
<exec executable="codesign" failonerror="yes">
<arg line="--verify --deep '${path.app}'" />
<!-- verify signature & build pkg -->
<exec dir="${dir.dist}" executable="codesign" failonerror="on">
<arg line="--verify '${path.app}/Contents/PlugIns/${jre.version}'" />
</exec>
<!-- build package -->
<exec executable="productbuild" failonerror="yes">
<arg line="--component '${path.app}' /Applications '${path.pkg}' --sign '${application.cert.installer}' --identifier '${application.identifier}' --version '${application.version}'" />
<exec dir="${dir.dist}" executable="codesign" failonerror="on">
<arg line="--verify '${path.app}'" />
</exec>
<exec dir="${dir.dist}" executable="productbuild" failonerror="on">
<arg line="--component '${path.app}' /Applications --sign '${application.cert.installer}' '${path.pkg}'" />
</exec>
<!-- store as release build-->
<copy todir="${dir.release}" file="${path.pkg}" verbose="yes" />
<copy todir="${dir.release}" file="${dir.dist}/${path.pkg}" verbose="yes" />
</target>