-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
230 lines (197 loc) · 10.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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<project name="templatefeather" default="help" basedir=".">
<property environment="ENV"/>
<!-- Global properties...START -->
<!-- Read in the properties file. -->
<property file="build.properties"/>
<property name="fs" value="${file.separator}"/> <!-- Shortcut -->
<property name="project_name_fs" value="${project.name}${fs}"/>
<property name="project_name_with_version" value="${project.name}-${version.number}"/>
<!-- com.github.xbn..., ignoring base directories -->
<property name="com_github_alit" value="com${fs}github${fs}aliteralmind${fs}"/>
<property name="cg_alit_feather" value="${com_github_alit}${project.name}${fs}"/>
<property name="cgx_feather_examples" value="${cg_alit_feather}examples${fs}"/>
<property name="cgx_feather_test" value="${cg_alit_feather}test${fs}"/>
<!-- Using base directories -->
<property name="dir_sandbox_parent" value="${sandbox.dir}${fs}"/>
<property name="dir_sandbox" value="${dir_sandbox_parent}${project_name_fs}"/>
<property name="dir_sandbox_src" value="${dir_sandbox}src${fs}"/>
<property name="dir_src_feather" value="${dir_sandbox_src}${cg_alit_feather}"/>
<property name="dir_sandbox_examples" value="${dir_sandbox}examples${fs}"/>
<property name="dir_sandbox_test" value="${dir_sandbox}test${fs}"/>
<property name="dir_sandbox_parent" value="${sandbox.dir}${fs}"/>
<property name="dir_sandbox" value="${dir_sandbox_parent}${project_name_fs}"/>
<property name="dir_sandbox_src_xbn" value="${dir_sandbox}com${fs}github${fs}aliteralmind${fs}"/>
<property name="dir_sandbox_bldfiles" value="${dir_sandbox}z_build${fs}"/>
<property name="dir_sandbox_src_xbn_ant" value="${dir_sandbox_src_xbn}testdev${fs}ant${fs}"/>
<property name="dir_sandbox_jar_dependencies" value="${dir_sandbox_bldfiles}jar_dependencies${fs}"/>
<property name="dir_build_parent" value="${build.dir}${fs}"/>
<property name="dir_classes_parent" value="${build.class.dir}${fs}"/>
<property name="dir_classes_xbn" value="${dir_classes_parent}com${fs}github${fs}aliteralmind${fs}"/>
<property name="dir_build" value="${dir_build_parent}${project_name_with_version}${fs}"/>
<property name="dir_build_download" value="${dir_build}download${fs}"/>
<property name="dir_build_download_templatefeather_all_jar" value="${dir_build_download}${project_name_with_version}-all.jar"/>
<property name="dir_build_download_templatefeather_core_jar" value="${dir_build_download}${project_name_with_version}.jar"/>
<property name="DIR_bld_src" value="${dir_build}com${fs}github${fs}aliteralmind${fs}"/>
<property name="DIR_bld_docs" value="${dir_build}documentation${fs}"/>
<property name="dir_build_docs_javadoc" value="${DIR_bld_docs}javadoc${fs}"/>
<property name="dir_working" value="${working.dir}${fs}${project_name_fs}"/>
<!-- Global properties...END -->
<!-- See: http://stackoverflow.com/questions/5103384/ant-warning-includeantruntime-was-not-set -->
<property name="includeantruntime" value="false"/>
<!-- CLASSPATH and custom tasks...START -->
<path id="project_classpath_id">
<pathelement location="${build.class.dir}"/>
<fileset dir="${dir_sandbox_jar_dependencies}" includes="*.jar"/>
<!--
<fileset dir="${dir_sandbox_jar_dependencies}">
<include name="commons-collections4-4.0.jar"/>
<include name="commons-io-2.4.jar"/>
<include name="commons-lang3-3.3.2.jar"/>
<include name="junit-4.8.2.jar"/>
<include name="xbnjava_${xbnjava_project_version}.jar"/>
<include name="codelet_${codelet_project_version}.jar"/>
<include name="guava-16.0.1.jar"/>
</fileset>
-->
</path>
<pathconvert pathsep=";" property="project_classpath_str" refid="project_classpath_id"/>
<taskdef name="propfromrplc" classname="com.github.xbn.testdev.ant.ATPropFromRplc" classpathref="project_classpath_id"/>
<!-- CLASSPATH and custom tasks...END -->
<target name="help" description="Getting started information">
<echo>This is the Ant build file for ${project.name}. Try
ant -projecthelp
Installation of the Template Feather build process is done in a single
step: By changing 'base.dir', in build.properties, to your installation
directory.
--To do a full build of XBN-Java--
The *documentation* for Template Feather uses codelets. But Codelet itself
is based on Template Feather. Hence, the rigamarole:
-1- Build Template Feather (part 1 of 2):
-1.a- ant refresh
-1.b- ant pubprecodelet
-2- Build Codelet:
- ant publish
-3- Finish building Template Feather (part 2 of 2):
- ant pubpostcodelet
Documentation for Template Feather can be generated before Codelet is
built. The example codes will be excluded.</echo>
</target>
<!-- <property name="codelet_project_name_and_version" value="codelet-${codelet_project_version}"/>
<target name="copycodeletjar" description="Duplicates Codelet's 'core' jar into the dependency directory">
<copy file="${base.dir}\\build\\${codelet_project_name_and_version}\\download\\${codelet_project_name_and_version}.jar" todir="${dir_sandbox_jar_dependencies}"/>
</target>
<target name="-autocopycodeletjar" if="do.auto.copy.codelet.jar">
<antcall target="copycodeletjar"/>
</target>
-->
<property name="dir_sandbox_ant_subxml" value="${dir_sandbox_bldfiles}ant_sub_files${fs}"/>
<import file="${dir_sandbox_ant_subxml}backup.xml"/>
<import file="${dir_sandbox_ant_subxml}compile_main.xml"/>
<import file="${dir_sandbox_ant_subxml}compile_proper.xml"/>
<import file="${dir_sandbox_ant_subxml}compile_tests.xml"/>
<import file="${dir_sandbox_ant_subxml}compile_examples.xml"/>
<import file="${dir_sandbox_ant_subxml}javadoc.xml"/>
<import file="${dir_sandbox_ant_subxml}refresh.xml"/>
<import file="${dir_sandbox_ant_subxml}zip.xml"/>
<!-- For Jeff Epstein only. Does not exist in published version: -->
<import file="${dir_sandbox_ant_subxml}gitonly_sandbox__execute_from_main_sandbox_only.xml"
optional="true"/>
<target name="publish" description="Full build of Template Featherweight.">
<antcall target="pubprecodelet"/>
<antcall target="pubpostcodelet"/>
</target>
<target name="prc" description="Shortcut for pubprecodelet.">
<antcall target="pubprecodelet"/>
</target>
<target name="pubprecodelet" description="compileprecodelet, pubprecodelet2">
<antcall target="refresh"/>
<record name="${dir_build}build_log_pre_codelet.txt" action="start"/>
<antcall target="compileprecodelet"/>
<antcall target="pubprecodelet2"/>
<record name="${dir_build}build_log_pre_codelet.txt" action="stop"/>
</target>
<target name="pubprecodelet2" description="compileexamples, pubprecodelet3">
<antcall target="compileexamples"/>
<antcall target="pubprecodelet3"/>
</target>
<target name="pubprecodelet3" description="compiletests, jar, unit">
<antcall target="compiletests"/>
<antcall target="jar"/>
<antcall target="unit"/>
</target>
<target name="poc" description="Shortcut for pubpostcodelet.">
<antcall target="pubpostcodelet"/>
</target>
<target name="pubpostcodelet" description="compilepostcodelet, doczip, preppom">
<record name="${dir_build}build_log_post_codelet.txt" action="start"/>
<antcall target="compilepostcodelet"/>
<!-- <antcall target="-autocopycodeletjar"/> -->
<antcall target="doczip"/>
<antcall target="preppom"/>
<record name="${dir_build}build_log_post_codelet.txt" action="stop"/>
</target>
<target name="dz" description="Shortcut for doczip.">
<antcall target="doczip"/>
</target>
<target name="doczip" description="doc, doc2, zip, zip2">
<antcall target="doc"/>
<antcall target="doc2"/>
<antcall target="zip"/>
<antcall target="zip2"/>
</target>
<target name="unit" description="Executes all unit tests">
<java classname="com.github.aliteralmind.templatefeather.test.UnitTestRunner" failonerror="true" classpathref="project_classpath_id"/>
</target>
<target name="pp" description="Shortcut for preppom.">
<antcall target="preppom"/>
</target>
<target name="preppom" description="Moves z_build/pom_source_file.xml to pom.xml, and sets the proper version number.">
<property name="pom_xml_dest" value="${dir_sandbox}pom.xml"/>
<delete file="${pom_xml_dest}"/><!-- Originates in task preppom. Needed by task clean -->
<copy file="${dir_sandbox_bldfiles}other/pom_source_file.xml" tofile="${pom_xml_dest}"/>
<replace file="${pom_xml_dest}" summary="yes"
token="^{project_version_for_jd}" value="${version.number}"/>
<replace file="${pom_xml_dest}" summary="yes"
token="^{project_build_dir}" value="${dir_build_parent}"/>
<replace file="${pom_xml_dest}" summary="yes"
token="^{xbnjava_project_version}" value="${xbnjava_project_version}"/>
</target>
<!-- See http://ant.apache.org/faq.html#propertyvalue-as-name-for-property -->
<macrodef name="propertywithdynamicallynamedvalue">
<attribute name="propname"/>
<attribute name="valuepropname"/>
<sequential>
<property name="@{propname}" value="${@{valuepropname}}"/>
</sequential>
</macrodef>
<!--
<target name="pubprecodeletwithneededxbn" description="cq, pubprecodelet">
<antcall target="pubprecodelet"/>
</target>
-->
<target name="prcj" description="For Jeff Epstein only. Shortcut for pubprecodelet, copyjartoxbnandcodelet.">
<antcall target="pubprecodelet"/>
<antcall target="copyjartoxbnandcodelet"/>
</target>
<target name="jxc" description="Shortcut for copyjartoxbnandcodelet">
<antcall target="copyjartoxbnandcodelet"/>
</target>
<target name="copyjartoxbnandcodelet" description="For Jeff Epstein only: Copies the TemplateFeather 'all' jar to the Codelet sandbox directory, and the 'core' (non-'all') jar to the XBN-Java sandbox. Old jars are deleted.">
<property name="codelet_jar_dependencies_dir" value="${sandbox.dir}/codelet/z_build/jar_dependencies/"/>
<delete quiet="true">
<fileset dir="${codelet_jar_dependencies_dir}">
<include name="${project.name}-*.jar"/>
</fileset>
</delete>
<copy file="${dir_build_download_templatefeather_all_jar}"
todir="${codelet_jar_dependencies_dir}"/>
<property name="xbnjava_jar_dependencies_dir" value="${sandbox.dir}/xbnjava/z_build/jar_dependencies/"/>
<delete quiet="true">
<fileset dir="${xbnjava_jar_dependencies_dir}">
<include name="${project.name}-*.jar"/>
</fileset>
</delete>
<copy file="${dir_build_download_templatefeather_core_jar}"
todir="${xbnjava_jar_dependencies_dir}"/>
</target>
</project>