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 30
/
build.xml
56 lines (46 loc) · 2.7 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="whatsapp" basedir=".">
<dirname property="app.basedir" file="${ant.file.whatsapp}"/>
<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..."/>
<delete file="${build.path}\${papp.folder}\app-${app.version}\squirrel.exe"/>
<echo message="Extracting app.asar..."/>
<exec executable="asar.cmd" failonerror="true" dir="${build.path}\${papp.folder}\app-${app.version}\resources">
<arg value="extract"/>
<arg value="app.asar"/>
<arg value="app"/>
</exec>
<echo message="Replacing in app.asar..."/>
<assertfile file="${build.path}\${papp.folder}\app-${app.version}\resources\app\${electron.appasar.file}"/>
<replace file="${build.path}\${papp.folder}\app-${app.version}\resources\app\${electron.appasar.file}" failOnNoReplacements="true">
<replacefilter token="${electron.appasar.search}" value="${electron.appasar.replace}"/>
</replace>
<assertfile file="${build.path}\${papp.folder}\app-${app.version}\resources\app\${electron.appasar.file1}"/>
<replace file="${build.path}\${papp.folder}\app-${app.version}\resources\app\${electron.appasar.file1}" failOnNoReplacements="true">
<replacefilter token="${electron.appasar.search1}" value="${electron.appasar.replace1}"/>
</replace>
<assertfile file="${build.path}\${papp.folder}\app-${app.version}\resources\app\${electron.appasar.file2}"/>
<replace file="${build.path}\${papp.folder}\app-${app.version}\resources\app\${electron.appasar.file2}" failOnNoReplacements="true">
<replacefilter token="${electron.appasar.search2}" value="${electron.appasar.replace2}"/>
</replace>
<echo message="Removing app.asar..."/>
<delete file="${build.path}\${papp.folder}\app-${app.version}\resources\app.asar"/>
<echo message="Packaging app..."/>
<exec executable="asar.cmd" failonerror="true" dir="${build.path}\${papp.folder}\app-${app.version}\resources">
<arg value="pack"/>
<arg value="app"/>
<arg value="app.asar"/>
</exec>
<delete dir="${build.path}\${papp.folder}\app-${app.version}\resources\app"/>
</target>
</project>