forked from scriptella/scriptella-etl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-docs.xml
142 lines (135 loc) · 6.38 KB
/
build-docs.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
<project name="Scriptella Documentation Build" default="codereports">
<property file="custom.build.properties"/>
<property file="build.properties"/>
<property name="docs.dir" value="${basedir}/build/docs"/>
<property name="dtd.dest.dir" value="${docs.dir}/dtd"/>
<property name="javadoc.dest.dir" value="${docs.dir}/api"/>
<property name="site.dir" value="${basedir}/forrest/src/documentation/content"/>
<path id="class.path">
<fileset dir="lib" includes="**/*.jar"/>
</path>
<target name="codereports" depends="dtd, javadoc"/>
<target name="dtd" depends="clean">
<description>Generates DTD using DTDDoc</description>
<!--Validation-->
<fail message="DTDDoc is required to build DTD documentation. Set dtddoc.dir property.
DTDDoc URL: http://dtddoc.sourceforge.net" unless="dtddoc.dir"/>
<condition property="no_dtddoc">
<available file="${dtddoc.dir}"/>
</condition>
<fail message="DTDDoc not found in ${dtddoc.dir}" unless="no_dtddoc"/>
<!--End Validation-->
<taskdef name="DTDDoc"
classname="DTDDoc.DTDDocTask">
<classpath>
<fileset dir="${dtddoc.dir}" includes="*.jar"/>
</classpath>
</taskdef>
<mkdir dir="${dtd.dest.dir}"/>
<DTDDoc showHiddenTags="true"
showFixmeTags="false"
sourceDir="core/src/conf"
destDir="${dtd.dest.dir}"
docTitle="DTD Documentation">
<include name="**/*.dtd"/>
</DTDDoc>
<copy todir="${dtd.dest.dir}" flatten="true">
<fileset dir="${basedir}/core/src/conf" includes="**/*.dtd"/>
</copy>
</target>
<target name="javadoc" depends="clean">
<mkdir dir="${javadoc.dest.dir}"/>
<javadoc destdir="${javadoc.dest.dir}" includenosourcepackages="true"
use="true" windowtitle="Scriptella API Documentation">
<classpath refid="class.path"/>
<classpath path="${ant.jar}"/>
<packageset dir="core/src/java"/>
<packageset dir="drivers/src/java"/>
<packageset dir="tools/src/java"/>
<doctitle><![CDATA[<h1>Scriptella API Documentation</h1>]]></doctitle>
<bottom>
<![CDATA[<i>Copyright © Copyright 2006-2012 The <a href="http://scriptella.javaforge.com">Scriptella Project</a> Team.</i>]]></bottom>
</javadoc>
</target>
<target name="clean" unless="noclean">
<delete dir="${dtd.dest.dir}" failonerror="no"/>
<delete dir="${javadoc.dest.dir}" failonerror="no"/>
<delete failonerror="no">
<fileset dir="${site.dir}" includes="docs/** dtd/**"/>
</delete>
</target>
<target name="site" description="Prepares site" depends="codereports">
<!-- Copy generate docs to forrest site-->
<copy todir="${site.dir}/docs">
<fileset dir="${docs.dir}"/>
</copy>
<!--Copy DTDs to site dtd directory. Registered URLs for DTDs -->
<copy todir="${site.dir}/dtd">
<fileset dir="${dtd.dest.dir}" includes="*.dtd"/>
</copy>
<antcall target="forrest"/>
</target>
<target name="forrest">
<!--Validation-->
<condition property="no_forrest">
<available file="${forrest.dir}"/>
</condition>
<fail message="Forrest is required to build a site. Set forrest.dir property.
Forrest URL: http://forrest.apache.org" unless="no_forrest"/>
<!--End Validation-->
<!--<ant antfile="${forrest.home}/main/forrest.build.xml" dir="forrest"/>-->
<!--Forrest needs a patched ant ;), so let's call sh/bat file instead -->
<condition property="ext" value=".bat">
<os family="windows"/>
</condition>
<property name="ext" value=""/>
<exec dir="forrest" executable="${forrest.dir}/bin/forrest${ext}"/>
</target>
<target name="site_postprocess" description="Additional postprocessing for statistics and other HTML changes">
<!-- StatCounter -->
<replace dir="${basedir}/forrest/build/site">
<include name="**/*.html"/>
<exclude name="docs/** dtd/**"/>
<replacetoken><![CDATA[</div>
</body>
</html>
]]></replacetoken>
<replacevalue>
<![CDATA[</div>
<!-- Start of StatCounter Code for Default Guide -->
<script type="text/javascript">
var sc_project=10775960;
var sc_invisible=1;
var sc_security="53eaed1c";
var scJsHost = (("https:" == document.location.protocol) ?
"https://secure." : "http://www.");
document.write("<sc"+"ript type='text/javascript' src='" +
scJsHost+
"statcounter.com/counter/counter.js'></"+"script>");
</script>
<!-- End of StatCounter Code for Default Guide -->
</body>
</html>]]></replacevalue>
</replace>
<!-- Bookmarks + PayPal -->
<replace dir="${basedir}/forrest/build/site">
<include name="**/*.html"/>
<exclude name="docs/** dtd/**"/>
<replacetoken><![CDATA[<div id="credit"></div>]]></replacetoken>
<replacevalue><![CDATA[<div id="credit">
<!-- AddThis Bookmark Button BEGIN -->
<a href="http://www.addthis.com/bookmark.php" onclick="window.open('http://www.addthis.com/bookmark.php?pub=ejboy&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title), 'addthis', 'scrollbars=yes,menubar=no,width=620,height=520,resizable=yes,toolbar=no,location=no,status=no'); return false;" title="Bookmark using any bookmark manager!" target="_blank"><img src="http://www.addthis.com/images/button1-bm.gif" width="125" height="16" border="0" alt="AddThis Social Bookmark Button" /></a>
<!-- AddThis Bookmark Button END -->
<br>
<br>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="8BN6JLVEU6PGQ">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
</div>]]>
</replacevalue>
</replace>
</target>
</project>