forked from oyvindkinsey/easyXDM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
167 lines (146 loc) · 8.4 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<?xml version="1.0" encoding="UTF-8"?>
<project name="easyXDM" default="build" basedir=".">
<property file="build.properties"/>
<property file="build.secret.properties"/>
<property name="project.build.artifactdir" value="./artifacts/"/>
<property name="project.build.publishdir" value="./artifacts/"/>
<property name="project.build.version" value="2.4.10"/>
<!-- Setup classpath for js-build-tools ant tasks -->
<path id="js-build-tasks.classpath">
<pathelement location="."/>
<fileset dir="tools/js-build-tools/lib">
<include name="**/*.jar"/>
</fileset>
</path>
<taskdef name="preprocess" classname="com.moxiecode.ant.tasks.PreProcessTask" classpathref="js-build-tasks.classpath" loaderref="js-build-tasks.classpath.loader" />
<taskdef name="yuicompress" classname="com.moxiecode.ant.tasks.YuiCompressTask" classpathref="js-build-tasks.classpath" loaderref="js-build-tasks.classpath.loader" />
<taskdef name="jslint" classname="com.googlecode.jslint4java.ant.JSLintTask" classpath="tools/jslint4java-1.3.3/jslint4java-1.3.3.jar" />
<path id="githubhuploadtask.classpath">
<pathelement location="."/>
<fileset dir="tools/GitHubUploadTask">
<include name="**/*.jar"/>
</fileset>
</path>
<taskdef name="upload" classname="no.kinsey.ant.GitHubUploadTask" classpathref="githubhuploadtask.classpath" loaderref="githubhuploadtask.classpath.loader" />
<target name="clean" depends="" description="Cleans up the project from temporary files">
<delete dir="work" quiet="true"/>
<delete dir="${project.build.artifactdir}v${project.build.version}" quiet="true"/>
</target>
<target name="jslint">
<jslint>
<formatter type="plain" />
<fileset dir="${project.src.dir}" includes="easyXDM*.js"/>
<fileset dir="${project.src.dir}/stack/" includes="*.js"/>
</jslint>
</target>
<target name="build" depends="clean,jslint">
<buildnumber/>
<mkdir dir="work"/>
<concat destfile="work/easyXDM.combined.js">
<fileset dir="." includes="${project.src.dir}/begin_scope.txt" />
<fileset dir="." includes="${project.src.dir}/Core.js" />
<fileset dir="." includes="${project.src.dir}/Debug.js" />
<fileset dir="." includes="${project.src.dir}/DomHelper.js" />
<fileset dir="." includes="${project.src.dir}/Fn.js" />
<fileset dir="." includes="${project.src.dir}/Socket.js" />
<fileset dir="." includes="${project.src.dir}/Rpc.js" />
<fileset dir="." includes="${project.src.dir}/stack/SameOriginTransport.js" />
<fileset dir="." includes="${project.src.dir}/stack/PostMessageTransport.js" />
<fileset dir="." includes="${project.src.dir}/stack/FrameElementTransport.js" />
<fileset dir="." includes="${project.src.dir}/stack/NixTransport.js" />
<fileset dir="." includes="${project.src.dir}/stack/NameTransport.js" />
<fileset dir="." includes="${project.src.dir}/stack/HashTransport.js" />
<fileset dir="." includes="${project.src.dir}/stack/ReliableBehavior.js" />
<fileset dir="." includes="${project.src.dir}/stack/QueueBehavior.js" />
<fileset dir="." includes="${project.src.dir}/stack/VerifyBehavior.js" />
<fileset dir="." includes="${project.src.dir}/stack/RpcBehavior.js" />
<fileset dir="." includes="${project.src.dir}/end_scope.txt" />
</concat>
<replace file="work/easyXDM.combined.js" token="%%version%%" value="${project.build.version}.${build.number}"/>
<!-- Process pre proccesing instructions like #if/#endif etc -->
<preprocess infile="work/easyXDM.combined.js" outfile="work/easyXDM.js"/>
<preprocess infile="work/easyXDM.combined.js" outfile="work/easyXDM.debug.js" defines="debug"/>
<preprocess infile="${project.src.dir}/name.html" outfile="work/name.html"/>
<preprocess infile="${project.src.dir}/widgets/Widgets.js" outfile="work/easyXDM.Widgets.js"/>
<preprocess infile="${project.src.dir}/widgets/Widgets.js" outfile="work/easyXDM.Widgets.debug.js" defines="debug"/>
<!-- Compress the file using the YUI Compressor -->
<yuicompress infile="work/easyXDM.js" outfile="work/easyXDM.min.js" />
<yuicompress infile="${project.src.dir}/widgets/Widgets.js" outfile="work/easyXDM.Widgets.min.js" />
<!-- concat header files -->
<concat destfile="${project.build.artifactdir}v${project.build.version}/easyXDM.js">
<fileset dir="." includes="${project.src.dir}/header.js" />
<fileset dir="." includes="work/easyXDM.js" />
</concat>
<concat destfile="${project.build.artifactdir}v${project.build.version}/easyXDM.debug.js">
<fileset dir="." includes="${project.src.dir}/header.js" />
<fileset dir="." includes="work/easyXDM.debug.js" />
</concat>
<concat destfile="${project.build.artifactdir}v${project.build.version}/easyXDM.min.js">
<fileset dir="." includes="${project.src.dir}/header.js" />
<fileset dir="." includes="work/easyXDM.min.js" />
</concat>
<concat destfile="${project.build.artifactdir}v${project.build.version}/easyXDM.Widgets.js">
<fileset dir="." includes="${project.src.dir}/header.js" />
<fileset dir="." includes="work/easyXDM.Widgets.js" />
</concat>
<concat destfile="${project.build.artifactdir}v${project.build.version}/easyXDM.Widgets.debug.js">
<fileset dir="." includes="${project.src.dir}/header.js" />
<fileset dir="." includes="work/easyXDM.Widgets.debug.js" />
</concat>
<concat destfile="${project.build.artifactdir}v${project.build.version}/easyXDM.Widgets.min.js">
<fileset dir="." includes="${project.src.dir}/header.js" />
<fileset dir="." includes="work/easyXDM.Widgets.min.js" />
</concat>
<delete file="work/easyXDM.combined.js" quiet="true"/>
<copy todir="${project.build.artifactdir}v${project.build.version}">
<fileset dir="work"/>
<fileset file= "MIT-license.txt"/>
<fileset file= "README.txt"/>
<fileset file= "${project.src.dir}/changes.txt"/>
<fileset file= "tools/json2.js"/>
</copy>
<copy todir="${project.src.dir}/tests">
<fileset file="work/easyXDM.debug.js"/>
</copy>
<copy todir="${project.build.artifactdir}v${project.build.version}/example">
<fileset dir="${project.src.dir}/example"/>
</copy>
<copy todir="${project.build.artifactdir}v${project.build.version}/cors">
<fileset dir="${project.src.dir}/cors"/>
</copy>
<copy todir="${project.build.artifactdir}v${project.build.version}/tests">
<fileset dir="${project.src.dir}/tests"/>
</copy>
</target>
<target name="document">
<delete dir="${project.build.artifactdir}v${project.build.version}-docs" quiet="true"/>
<java jar="tools/ext-doc/ext-doc.jar" fork="true" failonerror="true" maxmemory="128m" >
<arg line="-p docs.xml -o ${project.build.artifactdir}v${project.build.version}-docs -t tools/ext-doc/template/ext/template.xml"/>
</java>
<replace file="${project.build.artifactdir}v${project.build.version}-docs/index.html" token="%%version%%" value="${project.build.version}.${build.number}"/>
</target>
<target name="package" depends="build">
<zip destfile="${project.build.artifactdir}${ant.project.name}-${project.build.version}.${build.number}.zip" basedir="${project.build.artifactdir}v${project.build.version}"/>
</target>
<target name="publish" depends="document, package">
<delete dir="${project.build.publishdir}/" quiet="true" />
<copy todir="${project.build.publishdir}/">
<fileset dir="${project.build.artifactdir}v${project.build.version}"/>
</copy>
<copy todir="${project.build.publishdir}/docs/">
<fileset dir="${project.build.artifactdir}v${project.build.version}-docs"/>
</copy>
<copy file="${project.build.artifactdir}${ant.project.name}-${project.build.version}.${build.number}.zip" tofile="${project.build.publishdir}/source.zip" />
</target>
<target name="publishtoweb" depends="package, document">
<delete dir="${project.build.publishdir}v${project.build.version}" quiet="true" />
<copy todir="${project.build.publishdir}v${project.build.version}">
<fileset dir="${project.build.artifactdir}v${project.build.version}"/>
</copy>
<copy todir="${project.build.publishdir}v${project.build.version}/docs/">
<fileset dir="${project.build.artifactdir}v${project.build.version}-docs"/>
</copy>
<copy file="${project.build.artifactdir}${ant.project.name}-${project.build.version}.${build.number}.zip" tofile="${project.build.publishdir}v${project.build.version}/download.zip" />
<upload user="${github.user}" repo="${github.repo}" username="${github.username}" token="${github.token}" description="just a test" path="${project.build.artifactdir}${ant.project.name}-${project.build.version}.${build.number}.zip" />
</target>
</project>