forked from ahmadnassri/app-restconsole
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
114 lines (97 loc) · 4.18 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
110
111
112
113
114
<?xml version="1.0" encoding="iso-8859-1"?>
<project name="REST Console" default="build.dev" basedir=".">
<property name="version" value="3.0.8"/>
<property name="id" value="rest-console"/>
<property name="package" value="${id}-${version}"/>
<property name="name" value="REST Console"/>
<property name="description" value="'${name}' is a REST Client for Google Chrome to visualize and construct custom HTTP requests to test with any web service."/>
<property name="src" location="src"/>
<property name="lib" location="lib"/>
<property name="build" location="build"/>
<filterset id="filters">
<filter token="NAME" value="${name}"/>
<filter token="DESCRIPTION" value="${description}"/>
<filter token="VERSION" value="${version}"/>
</filterset>
<target name="clean" description="clean up">
<delete dir="${build}" quiet="true"/>
</target>
<target name="init" depends="clean">
<mkdir dir="${build}"/>
<mkdir dir="${build}/${id}"/>
<copy todir="${build}/${id}">
<filterset refid="filters"/>
<fileset dir="${src}" includes="**/*.js"/>
<fileset dir="${src}" includes="**/*.css"/>
<fileset dir="${src}" includes="**/*.html"/>
</copy>
<copy todir="${build}/${id}">
<fileset dir="${src}" includes="**/*.png"/>
</copy>
</target>
<target name="compress-js" depends="init">
<apply executable="java" parallel="false" dest="${build}/${id}">
<fileset dir="${build}/${id}" includes="**/*.js"/>
<arg line="-jar"/>
<arg path="${lib}/yuicompressor-2.4.2.jar"/>
<srcfile/>
<arg line="-o"/>
<targetfile/>
<mapper type="glob" from="*.js" to="*-min.js"/>
</apply>
<move todir="${build}/${id}" overwrite="true">
<fileset dir="${build}/${id}"/>
<mapper type="glob" from="*-min.js" to="*.js"/>
</move>
</target>
<target name="compress-css" depends="init">
<apply executable="java" parallel="false" dest="${build}/${id}">
<fileset dir="${build}/${id}" includes="**/*.css"/>
<arg line="-jar"/>
<arg path="${lib}/yuicompressor-2.4.2.jar"/>
<arg line="--line-break 0"/>
<srcfile/>
<arg line="-o"/>
<targetfile/>
<mapper type="glob" from="*.css" to="*-min.css"/>
</apply>
<move todir="${build}/${id}" overwrite="true">
<fileset dir="${build}/${id}"/>
<mapper type="glob" from="*-min.css" to="*.css"/>
</move>
</target>
<target name="compress-html" depends="init">
<apply executable="java" parallel="false" dest="${build}/${id}">
<fileset dir="${build}/${id}" includes="**/*.html"/>
<arg line="-jar"/>
<arg path="${lib}/htmlcompressor-1.4.jar"/>
<arg value="--remove-intertag-spaces"/>
<arg value="--compress-js"/>
<arg value="--compress-css"/>
<srcfile/>
<arg line="-o"/>
<targetfile/>
<mapper type="glob" from="*.html" to="*-min.html"/>
</apply>
<move todir="${build}/${id}" overwrite="true">
<fileset dir="${build}/${id}"/>
<mapper type="glob" from="*-min.html" to="*.html"/>
</move>
</target>
<target name="app_dev" depends="init">
<copy file="${src}/manifest.app.json" tofile="${build}/${id}/manifest.json">
<filterset refid="filters"/>
</copy>
</target>
<target name="ext_dev" depends="init">
<copy file="${src}/manifest.extension.json" tofile="${build}/${id}/manifest.json">
<filterset refid="filters"/>
</copy>
</target>
<target name="app_dist" depends="init, compress-js, compress-css, compress-html, app_dev">
<zip destfile="${build}/${package}.zip" basedir="${build}/${id}" includes="**/*"/>
</target>
<target name="ext_dist" depends="init, compress-js, compress-css, compress-html, ext_dev">
<zip destfile="${build}/${package}.zip" basedir="${build}/${id}" includes="**/*"/>
</target>
</project>