-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
264 lines (222 loc) · 12.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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
<project name="xbnjava" default="help" basedir=".">
<property environment="ENV"/>
<!-- Global properties...START -->
<!-- Read in the properties file. -->
<property file="build.properties"/>
<property name="project_name_fs" value="${project.name}/"/>
<property name="project_name_with_version" value="${project.name}-${version.number}"/>
<!-- Ignores base directories -->
<property name="com_github_xbn" value="com/github/xbn/"/>
<!-- Uses base directories -->
<property name="dir_sandbox_parent" value="${sandbox.dir}/"/>
<property name="dir_sandbox" value="${dir_sandbox_parent}${project_name_fs}"/>
<property name="dir_sandbox_src" value="${dir_sandbox}src/"/>
<property name="dir_src_xbn" value="${dir_sandbox_src}${com_github_xbn}"/>
<property name="dir_sandbox_examples" value="${dir_sandbox}examples/"/>
<property name="dir_sandbox_test" value="${dir_sandbox}test/"/>
<property name="dir_sandbox_bldfiles" value="${dir_sandbox}z_build/"/>
<property name="dir_sandbox_jar_dependencies" value="${dir_sandbox_bldfiles}jar_dependencies/"/>
<property name="dir_sandbox_bldfiles_other" value="${dir_sandbox_bldfiles}other/"/>
<property name="dir_classes_xbn" value="${build.class.dir}/${com_github_xbn}"/>
<property name="dir_build_grandparent" value="${build.dir}/"/>
<property name="dir_build_parent" value="${dir_build_grandparent}${project_name_with_version}/"/>
<property name="dir_build" value="${dir_build_parent}${project_name_with_version}/"/>
<property name="dir_build_logs" value="${dir_build}logs/"/>
<property name="dir_build_download" value="${dir_build}download/"/>
<property name="download_zip_source_name" value="${project_name_with_version}-sources.jar"/>
<property name="download_zip_docs_name" value="${project_name_with_version}-javadoc.jar"/>
<property name="download_zip_docs" value="${dir_build_download}${download_zip_docs_name}"/>
<property name="download_zip_source" value="${dir_build_download}${download_zip_source_name}"/>
<property name="project_all_jar" value="${dir_build_download}${project_name_with_version}-all.jar"/>
<property name="project_core_jar" value="${dir_build_download}${project_name_with_version}.jar"/>
<property name="dir_build_docs" value="${dir_build}documentation/"/>
<property name="dir_build_docs_javadoc" value="${dir_build_docs}javadoc/"/>
<property name="curr_redir_dir" value="${dir_build_parent}/redir_file_for_QcurrentQ_directory/"/>
<property name="curr_redir_file" value="${curr_redir_dir}index.html"/>
<property name="dir_working" value="${working.dir}/${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_bldfiles}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.11.jar"/>
<include name="codelet_0p1p0-all.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 XBN-Java 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 both XBN-Java and Template Feather use Codelet. But
Codelet *code* is based on both XBN-Java and Template Feather. Hence, the
rigamarole:
-1- Build XBN-Java proper (part 1 of 2): pubprecodelet (prc)
-2- Build Template Feather (part 1 of 2): pubprecodelet
-3- Build Codelet: cleanpublish
-4- Finish building XBN-Java proper (part 2 of 2): pubpostcodelet (poc)
-5- Finish building Template Feather (part 2 of 2): pubpostcodelet
Actually, to avoid JavaDoc errors, the following steps should be taken instead of the above step 5.
-5- Upload XBN-Java to aliteralmind.com
-6- Finish building Template Feather (part 2 of 2): pubpostcodelet
-7- Upload Template Feather to aliteralmind.com
-8- Rerun "ant doczip" in Codelet
-9- Upload Codelet to aliteralmind.com
Documentation for both XBN-Java and Template Feather can be generated before Codelet is built. The example codes will be excluded.</echo>
</target>
<property name="dir_sandbox_ant_subxml" value="${dir_sandbox_bldfiles}ant_sub_files/"/>
<import file="${dir_sandbox_ant_subxml}backup.xml"/>
<import file="${dir_sandbox_ant_subxml}compile_examples.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}javadoc.xml"/>
<import file="${dir_sandbox_ant_subxml}refresh.xml"/>
<import file="${dir_sandbox_ant_subxml}zip.xml"/>
<target name="pubprecodelet" description="compileproper, pubprecodelet2">
<antcall target="refresh"/>
<record name="${dir_build_logs}build_log_pre_codelet.txt" action="start"/>
<antcall target="compileproper"/>
<antcall target="pubprecodelet2"/>
<record name="${dir_build_logs}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="compilebuild"/>
<antcall target="jar"/>
<antcall target="unit"/>
</target>
<target name="poc" description="Shortcut for pubpostcodelet">
<antcall target="pubpostcodelet"/>
</target>
<target name="pubpostcodelet"
description="compilepostcodelet, doczip, preppoms">
<record name="${dir_build_logs}build_log_post_codelet.txt"
action="start"/>
<!-- <antcall target="-autocopycodeletjars"/> -->
<antcall target="compilepostcodelet"/>
<antcall target="doczip"/>
<antcall target="preppoms"/>
<antcall target="currversionredirfile"/>
<record name="${dir_build_logs}build_log_post_codelet.txt"
action="stop"/>
</target>
<target name="currversionredirfile"
description="Copies the 'current' directory redirect page to build, and updates its version number to the current.">
<delete quiet="true" dir="${curr_redir_dir}"/>
<mkdir dir="${curr_redir_dir}"/>
<copy file="${dir_sandbox_bldfiles_other}redir_for_QcurrentQ_directory_on_aliteralmind_com.html" tofile="${curr_redir_file}"/>
<replace file="${curr_redir_file}" summary="yes"
token="^{current_project_version}" value="${version.number}"/>
</target>
<target name="pocnd" description="Shortcut for pubpostcodeletnodoc">
<antcall target="pubpostcodeletnodoc"/>
</target>
<target name="pubpostcodeletnodoc" description="Same as pubpostcodelet, without doc">
<record name="${dir_build_logs}build_log_post_codelet.txt" action="start"/>
<!-- <antcall target="-autocopycodeletjars"/> -->
<antcall target="compilepostcodelet"/>
<antcall target="zip"/>
<antcall target="zip2"/>
<antcall target="preppoms"/>
<antcall target="currversionredirfile"/>
<record name="${dir_build_logs}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">
<record name="${dir_build_logs}javadoc_and_zip_log.txt" action="start"/>
<antcall target="doc"/>
<antcall target="doc2"/>
<antcall target="zip"/>
<antcall target="zip2"/>
<record name="${dir_build_logs}javadoc_and_zip_log.txt" action="stop"/>
</target>
<target name="unit" description="Executes com.github.xbn.test.UnitTestRunner">
<java classname="com.github.xbn.test.UnitTestRunner" failonerror="true" classpathref="project_classpath_id"/>
</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="pp" description="Shortcut for preppoms.">
<antcall target="preppoms"/>
</target>
<target name="preppoms" 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 preppoms. 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_grandparent}"/>
</target>
<target name="pot" description="Shortcut for pubposttabs.">
<antcall target="pubposttabs"/>
</target>
<target name="linkchecker"
description="Find and log all broken links in the generated JavaDoc. For manual calling only. Tested only on Windows, but the application is cross-platform.">
<property name="output_file" value="${dir_build_grandparent}${project_name_with_version}-brokenlinks.txt"/>
<delete quiet="true" file="${output_file}"/>
<echo>Writing output to ${output_file}...</echo>
<exec executable="${link.checker.install.dir}linkchecker.exe"
output="${output_file}">
<arg value="--config=${dir_sandbox_bldfiles_other}linkchecker_config.txt"/>
<arg value="${dir_build_docs_javadoc}overview-summary.html"/>
</exec>
<echo>Duplicating log to ${dir_build_logs}</echo>
<copy overwrite="true"
file="${output_file}" todir="${dir_build_logs}"/>
<echo>(If you want the log on aliteralmind, re-run 'dupbuildtoalit'.)</echo>
</target>
<!-- FOR JEFF EPSTEIN'S USE ONLY...start -->
<import file="${dir_sandbox_ant_subxml}for_jeff_epstein_only.xml"
optional="true"/>
<target name="pubposttabs"
description="FOR JEFF EPSTEIN'S USE ONLY. Replacement for pubprecodelet2. Do not use. See 'compilehelp'.">
<record name="${dir_build_logs}build_log_post_tabs_pre_codelet.txt"
action="start"/>
<antcall target="pubprecodelet2"/>
<record name="${dir_build_logs}build_log_post_tabs_pre_codelet.txt"
action="stop"/>
</target>
<property name="alit_dir" value="C:\data_jeffy\jeffyepstein_com\jeffyepstein_com\docs\computer\programming\${project.name}\"/>
<target name="pocj"
description="FOR JEFF EPSTEIN'S USE ONLY. Shortcut for pubpostcodelet, dupbuildtoalit">
<antcall target="pubpostcodelet"/>
<antcall target="dupbuildtoalit"/>
</target>
<target name="dupbuildtoalit"
description="FOR JEFF EPSTEIN'S USE ONLY. Copy all files to local aliteralmind.com directory">
<echo>Copying current-version redirect</echo>
<copy file="${curr_redir_file}" todir="${alit_dir}current"
overwrite="true"/>
<echo>Copying entire build directory</echo>
<delete quiet="true" dir="${alit_dir}${project_name_with_version}"/>
<copy todir="${alit_dir}">
<fileset dir="${dir_build_parent}"
includes="${project_name_with_version}/**"/>
</copy>
</target>
<!-- FOR JEFF EPSTEIN'S USE ONLY...start -->
</project>