forked from glow/gloader1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
executable file
·109 lines (91 loc) · 3.05 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?xml version="1.0" encoding="UTF-8"?>
<project name="gloader" default="all" basedir=".">
<!-- Build -->
<property file="build.properties" />
<property name="NAME" value="gloader" />
<property name="ROOT_DIR" value="." />
<property name="SRC_DIR" value="${ROOT_DIR}/src" />
<property name="TEMP_DIR" value="${ROOT_DIR}/temp" />
<property name="TEMP_PKG_DIR" value="${TEMP_DIR}/${NAME}/${VERSION}" />
<property name="DIST_DIR" value="${ROOT_DIR}/dist" />
<property name="DIST_PKG_DIR" value="${DIST_DIR}/${NAME}/${VERSION}" />
<property name="DIST_ZIP" value="${ROOT_DIR}/${NAME}-${VERSION}.zip" />
<property name="DIST_TGZ" value="${ROOT_DIR}/${NAME}-${VERSION}.tgz" />
<!-- Files -->
<property name="GLOADER" value="${SRC_DIR}/gloader.js" />
<property name="HEADER" value="${SRC_DIR}/header.js" />
<filelist id="FILES_PROJECT"
dir="${ROOT_DIR}">
<file name="CONTRIBUTORS" />
<file name="LICENCE" />
<file name="README" />
</filelist>
<!-- Filterchains -->
<filterchain id="FILTER_HEADER">
<concatfilter prepend="${HEADER}" />
</filterchain>
<!-- Targets -->
<target name="clean">
<delete dir="${TEMP_DIR}" />
<delete dir="${DIST_DIR}" />
<delete file="${DIST_ZIP}" />
<delete file="${DIST_TGZ}" />
</target>
<target name="setup" depends="clean">
<mkdir dir="${TEMP_PKG_DIR}" />
<mkdir dir="${DIST_PKG_DIR}" />
</target>
<target name="temp" depends="setup">
<echo message="Creating temp files"/>
<copy todir="${TEMP_PKG_DIR}" file="${GLOADER}" />
<copy todir="${TEMP_DIR}">
<filelist refid="FILES_PROJECT" />
</copy>
</target>
<target name="debug" depends="temp">
<echo message="Creating debug files"/>
<copy todir="${DIST_DIR}">
<fileset dir="${TEMP_DIR}">
<include name="**/*.js" />
</fileset>
<filterchain refid="FILTER_HEADER" />
<globmapper from="*.js" to="*.debug.js" />
</copy>
</target>
<target name="min" depends="temp">
<echo message="Creating minified files"/>
<apply executable="java" parallel="false" failonerror="true">
<arg line="-jar"/>
<arg path="${YUI_JAR}"/>
<arg value="--preserve-semi" />
<srcfile/>
<fileset dir="${TEMP_DIR}" includes="**/*.js"/>
<redirector>
<outputmapper type="glob" from="*" to="${DIST_DIR}/*" />
<outputfilterchain refid="FILTER_HEADER" />
</redirector>
</apply>
</target>
<target name="meta" depends="temp">
<echo message="Creating project files"/>
<copy todir="${DIST_DIR}">
<fileset dir="${TEMP_DIR}" includes="CONTRIBUTORS,LICENCE,README" />
</copy>
</target>
<target name="dist" depends="debug,min,meta">
<!--<delete dir="${TEMP_DIR}" />-->
<echo message="Creating dist files" />
<zip destfile="${DIST_ZIP}"
basedir="${DIST_DIR}" />
<tar destfile="${DIST_TGZ}"
basedir="${DIST_DIR}"
compression="gzip" />
</target>
<target name="all" depends="dist">
<echo message="" />
<echo message="*****************************************" />
<echo message="Gloader version ${VERSION} build complete" />
<echo message="*****************************************" />
<echo message="" />
</target>
</project>