-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
83 lines (71 loc) · 2.94 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
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="extext" default="build" basedir=".">
<property environment="env" />
<target name="build" depends="compile, copy-to-public" 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 --collapse-inline-tag-whitespace --remove-tag-whitespace --remove-script-type-attributes "/>
<arg line="--use-short-doctype --conservative-collapse --collapse-whitespace --remove-tag-whitespace --decode-entities --minify-css "/>
<arg line="-o ./public/index.html"/>
<arg line="./src/index.html"/>
</exec>
<exec dir="." executable="cmd" >
<arg line="/c cleancss ./src/style.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 WHITESPACE_ONLY"/><!-- ADVANCED_OPTIMIZATIONS, SIMPLE_OPTIMIZATIONS, WHITESPACE_ONLY-->
<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="./src"/>
</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="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>