This repository has been archived by the owner on Nov 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
68 lines (58 loc) · 2.99 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="franz" basedir=".">
<dirname property="app.basedir" file="${ant.file.franz}"/>
<property name="build.properties" value="${app.basedir}/build.properties"/>
<property file="${build.properties}"/>
<!-- Load Portapps core build -->
<property name="core.basedir" location="${app.basedir}\${core.dir}"/>
<fail unless="core.basedir" message="Core directory '${core.basedir}' not found in ${core.basedir}"/>
<echo message="Core found in ${core.basedir}" level="debug"/>
<!-- Import build-app.xml -->
<import file="${core.basedir}\.build\build-app.xml"/>
<!-- Targets -->
<target name="release" depends="release.app" description="Release"/>
<target name="prepare" depends="load.lib.asar">
<echo message="Preparing release..."/>
<echo message="Extracting embedded ${atf.arch} archive"/>
<property name="extract.path2" value="${tmp.path}\extract2"/>
<if>
<equals arg1="${atf.arch}" arg2="win32"/>
<then>
<sevenzip-ax src="${extract.path}\$PLUGINSDIR\app-32.7z" dest="${extract.path2}"/>
</then>
<else>
<sevenzip-ax src="${extract.path}\$PLUGINSDIR\app-64.7z" dest="${extract.path2}"/>
</else>
</if>
<delete dir="${extract.path}"/>
<move todir="${extract.path}">
<fileset dir="${extract.path2}" defaultexcludes="no"/>
</move>
<echo message="Extracting app.asar..."/>
<exec executable="asar.cmd" failonerror="true" dir="${extract.path}\resources">
<arg value="extract"/>
<arg value="app.asar"/>
<arg value="app"/>
</exec>
<echo message="Replacing in app.asar..."/>
<assertfile file="${extract.path}\resources\app\${electron.appasar.file}"/>
<replace file="${extract.path}\resources\app\${electron.appasar.file}" failOnNoReplacements="true">
<replacefilter token="${electron.appasar.search}" value="${electron.appasar.replace}"/>
<replacefilter token="${electron.appasar.search2}" value="${electron.appasar.replace2}"/>
</replace>
<assertfile file="${extract.path}\resources\app\${electron.appasar2.file}"/>
<replace file="${extract.path}\resources\app\${electron.appasar2.file}" failOnNoReplacements="true">
<replacefilter token="${electron.appasar2.search}" value="${electron.appasar2.replace}"/>
</replace>
<assertfile file="${extract.path}\resources\app\${electron.appasar3.file}"/>
<replace file="${extract.path}\resources\app\${electron.appasar3.file}" failOnNoReplacements="true">
<replacefilter token="${electron.appasar3.search}" value="${electron.appasar3.replace}"/>
</replace>
<assertfile file="${extract.path}\resources\app\${electron.appasar4.file}"/>
<replace file="${extract.path}\resources\app\${electron.appasar4.file}" failOnNoReplacements="true">
<replacefilter token="${electron.appasar4.search}" value="${electron.appasar4.replace}"/>
</replace>
<echo message="Removing app.asar..."/>
<delete file="${extract.path}\resources\app.asar"/>
</target>
</project>