-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
94 lines (81 loc) · 3.42 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
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="pixmoji" default="build" basedir=".">
<property environment="env" />
<target name="build" depends="compile, copy-to-public, remove-includes" description="Build"/>
<target name="build-clean" depends="clean, init, build" description="Clean Build"/>
<target name="clean">
<delete dir="./public" />
<delete dir="./www" />
</target>
<target name="init">
<mkdir dir="./public" />
<mkdir dir="./www" />
</target>
<!-- overwrite="true" -->
<target name="copy-to-public">
<copy todir="./public" includeEmptyDirs="false">
<fileset dir="./src" excludes="**/*.html,**/*.css,**/script.js,**/emojis.js"/>
</copy>
</target>
<target name="compile" depends="init, compile-index"/>
<target name="genkey">
<exec dir="." executable="cmd" >
<arg line="/c keytool -genkey -alias ${ant.project.name} -keyalg RSA -keypass AllTerrainScoutTransport -storepass AllTerrainScoutTransport -keystore keytool.keystore"/>
</exec>
</target>
<target name="compile-index">
<exec dir="." executable="cmd" >
<arg line="/c html-minifier"/>
<arg line="--remove-comments --minify-css true --collapse-inline-tag-whitespace --remove-script-type-attributes "/>
<arg line="--use-short-doctype --collapse-whitespace --decode-entities "/>
<arg line="-o ./public/index.html"/>
<arg line="./src/index.html"/>
</exec>
<!-- <exec dir="." executable="cmd" >
<arg line="/c cleancss ./src/style.css ./src/assets/css-modal.css ./src/assets/bootstrap.min.css -o ./public/style.css"/>
</exec> -->
<exec dir="." executable="cmd" >
<arg line="/c npx google-closure-compiler"/>
<arg line="--charset UTF-8"/>
<arg line="--compilation_level ADVANCED_OPTIMIZATIONS"/> <!-- WHITESPACE_ONLY, SIMPLE_OPTIMIZATIONS, ADVANCED_OPTIMIZATIONS -->
<arg line="--js ./src/script.js"/>
<arg line="--js_output_file ./public/script.js"/>
</exec>
</target>
<!-- copy over not-compiled "src" to github -->
<target name="github-src">
<delete dir="../lewdev.github.io/apps/${ant.project.name}"/>
<mkdir dir="../lewdev.github.io/apps/${ant.project.name}" />
<copy todir="../lewdev.github.io/apps/${ant.project.name}">
<fileset dir="./public"/>
</copy>
</target>
<!-- copy over compiled "public" to github -->
<target name="github" depends="build-clean">
<delete dir="../lewdev.github.io/apps/${ant.project.name}"/>
<mkdir dir="../lewdev.github.io/apps/${ant.project.name}" />
<copy todir="../lewdev.github.io/apps/${ant.project.name}">
<fileset dir="./public"/>
</copy>
</target>
<target name="remove-includes">
<replace dir="./public" value="">
<include name="index.html"/>
<replacetoken><script src="assets/emojis.js"></script></replacetoken>
</replace>
<replace dir="./public" value="">
<include name="index.html"/>
<replacetoken><link rel="stylesheet"href="assets/bootstrap.min.css"><link rel="stylesheet"href="assets/css-modal.css"></replacetoken>
</replace>
</target>
<target name="zipBuild">
<zip destfile="${ant.project.name}.zip">
<zipfileset dir="./" includes="www/** config.xml" />
</zip>
</target>
<target name="install-compilers">
<exec dir="." executable="cmd" >
<arg line="/c npm i -g html-minifier clean-css-cli npx google-closure-compiler"/>
</exec>
</target>
</project>