-
Notifications
You must be signed in to change notification settings - Fork 4
/
docgen.xml
76 lines (72 loc) · 3.06 KB
/
docgen.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
<project name="docs" basedir="./" xmlns:antcontrib="antlib:net.sf.antcontrib">
<target name="colddoc.gen">
<mkdir dir="${ext.jenkins.dir}"/>
<colddoc packagenames="" excludepackagenames=""
sourcepath="" destdir=""
title="" />
</target>
<macrodef name="colddoc-get">
<attribute name="packagenames"/>
<attribute name="sourcepath"/>
<attribute name="title"/>
<attribute name="excludepackagenames" default="unsupported"/>
<attribute name="destdir"/>
<attribute name="colddoc.tmp.dir" default="${war.target.dir}/_docgen"/>
<text name="text" optional="true" trim="true"/>
<!-- TODO: something better -->
<sequential>
<abspath path="@{destdir}" property="__doc.dir" />
<abspath path="@{sourcepath}" property="__doc.src" />
<mkdir dir="@{colddoc.tmp.dir}" />
<dependency artifactId="colddoc" version="1.0" mapping="/colddoc" groupId="com.ortussolutions" />
<echo file="@{colddoc.tmp.dir}/Application.cfc">component {
this.name="docgen"; this.mappings["/@{packagenames}"] = "${__doc.src}";
this.mappings["/colddoc"] = "${ext.mappings.dir}/com.ortussolutions/colddoc/1.0/";
}</echo>
<antcontrib:if>
<equals arg1="@{text}" arg2="" />
<then>
<antcontrib:var name="__doc.sources" value='{ inputDir="${__doc.src}", inputMapping="@{packagenames}" }' />
</then>
<else>
<antcontrib:var name="__doc.sources" value='@{text}' />
</else>
</antcontrib:if>
<echo file="@{colddoc.tmp.dir}/colddoc.cfm"><cfscript>
try {
colddoc = createObject("component", "colddoc.ColdDoc").init();
strategy = createObject("component", "colddoc.strategy.api.HTMLAPIStrategy").init("${__doc.dir}", "@{title}");
colddoc.setStrategy(strategy);
source = [${__doc.sources}];
colddoc.generate( source );
} catch (any e) {
writeOutput(e.message);
writeOutput(e.detail);
abort;
}
gendate=now();
</cfscript>
<cfcontent reset="true">@{title} API from ${__doc.src} mapping: @{packagenames}
generated to ${__doc.dir} on <cfset writeOutput(gendate)/>
</echo>
<get dest="@{colddoc.tmp.dir}/colddoc.html" src="https://${server.host}:${server.port.http}${war.contextpath}/_docgen/colddoc.cfm" verbose="true"/>
<antcontrib:var unset="true" name="colddoc.return" />
<loadfile property="colddoc.return" srcfile="@{colddoc.tmp.dir}/colddoc.html"><filterchain><trim/><ignoreblank/></filterchain></loadfile>
<echo message="Colddoc: ${colddoc.return}"></echo>
</sequential>
</macrodef>
<macrodef name="colddoc">
<attribute name="packagenames"/>
<attribute name="sourcepath"/>
<attribute name="title"/>
<attribute name="excludepackagenames" default="unsupported"/>
<attribute name="destdir"/>
<text name="text" optional="true" trim="true"/>
<sequential>
<server-run>
<colddoc-get packagenames="@{packagenames}" excludepackagenames="@{excludepackagenames}"
title="@{title}" sourcepath="@{sourcepath}" destdir="@{destdir}">@{text}</colddoc-get>
</server-run>
</sequential>
</macrodef>
</project>