-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
146 lines (111 loc) · 4.11 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<project name="PostMessageMiddleware" default="package" basedir="./">
<!--- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
A window.postMessage() middleware
https://github.com/fjenett/postmessenger-js
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SETTINGS
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -->
<property name="absolute.path" location="${basedir}"/>
<property name="src" value="src" />
<property name="bin" value="bin" />
<property name="dist" value="dist" />
<property name="docs" value="docs" />
<property name="product" value="postmessenger" />
<property name="author" value="Florian Jenett" />
<property name="version" value="0.0.10" />
<taskdef name="jscomp" classname="com.google.javascript.jscomp.ant.CompileTask"
classpath="resources/closure-compiler-v20170806.jar"/>
<property name="doccoPath" value="/Users/fjenett/.nvm/versions/node/v8.2.1/bin/docco" />
<!--- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
HELP
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -->
<target name="help">
<echo>
See readme for time being please.
</echo>
</target>
<!--- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BUILD
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -->
<target name="build">
<buildnumber file="resources/build_number"/>
<delete dir="${bin}" />
<mkdir dir="${bin}" />
<concat destfile="${bin}/${product}.js">
<fileset file="${src}/*.js" />
</concat>
<jscomp compilationLevel="simple"
warning="default"
debug="false"
output="${bin}/${product}-compiled.js">
<sources dir="${bin}">
<file name="${product}.js" />
</sources>
</jscomp>
</target>
<!--- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PACK
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -->
<target name="package" depends="build">
<delete dir="${dist}" />
<mkdir dir="${dist}" />
<concat destfile="${dist}/${product}.js">
<fileset file="resources/js-header.js" />
<fileset file="${bin}/${product}-compiled.js" />
</concat>
<replaceregexp file="${dist}/${product}.js" flags="g"
match="##build##" replace="${build.number}" />
<replaceregexp file="${dist}/${product}.js" flags="g"
match="##version##" replace="${version}" />
<!-- DOCUMENTATION -->
<copy todir="${dist}/docs">
<fileset dir="resources/docco-template" />
</copy>
<!-- <mkdir dir="${dist}/docs" /> -->
<!-- <exec executable="${doccoPath}">
<env key="PATH" path="${env.PATH}:/usr/local/bin"/>
<arg value="-o" />
<arg value="${absolute.path}/${dist}/docs" />
<arg value="${absolute.path}/${src}/${product}.js" />
</exec>
<move file="${dist}/docs/${product}.html"
tofile="${dist}/docs/index.html"/> -->
<!-- package.json -->
<delete file="package.json" />
<copy todir=".">
<fileset file="resources/package.json" />
</copy>
<replaceregexp file="package.json" flags="g"
match="##version##" replace="${version}" />
<!-- bower.json -->
<delete file="bower.json" />
<copy tofile="bower.json">
<fileset file="package.json" />
</copy>
<!-- directly useable version -->
<copy tofile="releases/${product}-current.js">
<fileset file="${dist}/${product}.js" />
</copy>
</target>
<!--- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
INSTALL
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -->
<target name="release" depends="package" >
<zip destfile="releases/${product}-${version}.zip"
basedir="${dist}"
excludes="**/_DS.Store"
/>
</target>
<!--- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CLEAN
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -->
<target name="clean" >
<delete dir="${dist}" />
<delete dir="${bin}" />
</target>
<!--- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TEST
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -->
<target name="test" depends="build">
</target>
</project>