-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathdocs.xmli
268 lines (243 loc) · 12.7 KB
/
docs.xmli
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
265
266
267
268
<?xml version="1.0"?>
<project name="doc" default="doc" basedir=".">
<description>
Build documentation - XDocs and Javadoc.
For building XDocs, edit xdocs/**/*.xml first.
XXX for no apparent reason, your CWD must be the main Ant source dir, or this will fail:
.../docs.xml:64: org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource './site.vsl'
</description>
<property name="velocity.dir" location="lib/ext"/>
<!-- Initialization properties -->
<property name="project.name" value="ejbca"/>
<property name="docs.tools.dest" location="tmp/docs-tools"/>
<property name="docs.src" location="doc/xdocs/docs"/>
<property name="docs.dest" location="tmp/htdocs/docs"/>
<property name="docs.dist" location="doc/dist"/>
<property name="docs.nojs.dest" location="tmp/htdocs/docsnojs"/>
<property name="docs.dest.ws" location="tmp/htdocs/docs/ws"/>
<property name="docs.dest.rest" location="tmp/htdocs/docs/rest"/>
<property name="docs.dest.acme" location="tmp/htdocs/docs/acme"/>
<property name="docs.dest.logtypes" location="tmp/htdocs/docs/logtypes"/>
<property name="site.src" location="doc/xdocs/site"/>
<property name="site.dest" location="tmp/htdocs"/>
<property name="jdocs.ws.tmp" location="tmp/jdocswstmp"/>
<property name="ws.client.gen.relative-path" value="org/ejbca/core/protocol/ws/client/gen"/>
<property name="client.ws.class" value="EjbcaWS"/>
<property name="es.iface.dir" location="modules/edition-specific/src-interface/org/ejbca/core/protocol/ws/objects"/>
<property name="ws.objects.dir" location="modules/ejbca-ws/src/org/ejbca/core/protocol/ws/objects"/>
<property name="ws.common.dir" location="modules/ejbca-ws/src/org/ejbca/core/protocol/ws/common"/>
<property name="ws.client.gen.src" location="modules/ejbca-ws-cli/src-gen"/>
<property name="ws.master.file" location="${ws.common.dir}/IEjbcaWS.java"/>
<property name="project.file" value="stylesheets/project.xml" />
<property name="docs.templ.path" location="${docs.src}/stylesheets" />
<property name="site.templ.path" location="${site.src}/stylesheets" />
<property name="docs.velocity.props" location="${docs.src}/velocity.properties" />
<property name="site.velocity.props" location="${site.src}/velocity.properties" />
<property name="include.xml" value="**/*.xml" />
<property file="src/doc.properties"/>
<property name="confluence.url" value="none" />
<property name="confluence.port" value="-1" />
<path id="jdoc.classpath">
<path location="lib/jee/javaee-api-7.0-1.jar"/>
<path location="lib/jee/jaxb-api-2.3.1.jar"/>
<path location="dist/ejbca-common.jar" />
<path location="modules/dist/ejbca-ejb.jar" />
<path location="modules/dist/cesecore-common.jar"/>
<path location="modules/dist/cesecore-entity.jar"/>
<path location="modules/dist/cesecore-ejb-interface.jar"/>
<path location="lib/bcprov-jdk15on-165.jar" />
<path location="lib/bcpkix-jdk15on-165.jar" />
<path location="lib/bctls-jdk15on-165.jar" />
</path>
<!-- =================================================================== -->
<!-- Build doc part -->
<!-- =================================================================== -->
<target name="doc.war" if="doc.war.enabled">
<antcall target="doc" inheritall="true" inheritrefs="true"/>
<war destfile="${dist.dir}/doc.war" webxml="${ejbca.home}/src/publicweb/empty_webxml.xml">
<fileset dir="${docs.dest}" />
</war>
</target>
<target name="doc-build-tool">
<mkdir dir="${docs.tools.dest}"/>
<javac srcdir="${ejbca.home}/modules/ejbca-common/src/" destdir="${docs.tools.dest}" debug="on" includeantruntime="no" encoding="UTF-8"
includes="org/ejbca/util/JAXWSDocAndConvTools.java"/>
</target>
<target name="prepare">
<path id="anakia.classpath">
<fileset dir="${velocity.dir}">
<include name="*.jar"/>
</fileset>
</path>
<available classname="org.apache.velocity.anakia.AnakiaTask"
property="AnakiaTask.present">
<classpath refid="anakia.classpath"/>
</available>
<available file="${site.velocity.props}"
property="site.present">
</available>
</target>
<target name="prepare-error" depends="prepare" unless="AnakiaTask.present">
<echo>
AnakiaTask is not present! Please check to make sure that
velocity.jar is in your classpath.
</echo>
</target>
<condition property="mod.rest-api.exists">
<available file="${mod.ejbca-rest-api.path}/build.xml" />
</condition>
<condition property="mod.rest-cryptotoken.exists">
<available file="${mod.ejbca-rest-cryptotoken.path}/build.xml" />
</condition>
<condition property="mod.rest-camanagement.exists">
<available file="${mod.ejbca-rest-camanagement.path}/build.xml" />
</condition>
<condition property="mod.acme.exists">
<available file="${mod.acme.path}/build.xml" />
</condition>
<condition property="update.from.confluence" value="true" else="false">
<istrue value="${doc.update}"/>
</condition>
<target name="doc-confluence">
<antcall target="doc-confluence-from-server" inheritall="true" inheritrefs="true"/>
<antcall target="doc-confluence-copy-local" inheritall="true" inheritrefs="true"/>
</target>
<target name="doc-confluence-from-server" if="${update.from.confluence}">
<delete dir="${docs.dest}" />
<mkdir dir="${docs.dest}"/>
<condition property="connected.to.confluence" value="true" else="false">
<and>
<istrue value="${doc.update}"/>
<isreachable url="http://${confluence.url}:${confluence.port}/" timeout="10"/>
</and>
</condition>
<fail message="Could not contact Confluence Server at http://${confluence.url}:${confluence.port}/. doc.update=${doc.update}">
<condition>
<isfalse value="${connected.to.confluence}"/>
</condition>
</fail>
<echo message="Pulling documentation from Confluence Server"/>
<!-- Perform a REST call to Confluence - only runs if -Ddoc.update is set and Confluence can be contacted -->
<!-- The values here are described in doc.properties -->
<get src="http://${confluence.url}:${confluence.port}/rest/scroll-html/1.0/sync-export?exportSchemeId=${confluence.export.schemed.id}&rootPageId=${confluence.root.page.id}&versionId=${confluence.version}"
dest="${docs.dest}/export.zip"
username="${confluence.username}"
password="${confluence.password}"
/>
<unzip src="${docs.dest}/export.zip" dest="${docs.dest}">
<patternset>
<exclude name="**/jquery.min.js"/>
</patternset>
</unzip>
<delete file="${docs.dest}/export.zip"/>
<copy file="${docs.dist}/assets/js/jquery.min.js/" todir="${docs.dest}/assets/js"/>
</target>
<target name="doc-confluence-copy-local" unless="${update.from.confluence}">
<!-- Do not update from Confluence, instead copy in a placeholder file (if no documentation currently exists). -->
<echo message="Using local documentation, if any. Set -Ddoc.update=true if you wish to update documentation from Confluence."/>
<mkdir dir="${docs.dest}"/>
<copy todir="${docs.dest}">
<fileset dir="${docs.dist}" includes="**/*"/>
</copy>
</target>
<target name="doc-external-deps" unless="docs.external-deps-satfisfied">
<antcall target="ejbca-common.jar" inheritall="true" inheritrefs="true"/>
</target>
<target name="site" if="site.present">
<taskdef name="anakia" classname="org.apache.velocity.anakia.AnakiaTask">
<classpath refid="anakia.classpath"/>
</taskdef>
<anakia basedir="${site.src}" destdir="${site.dest}"
extension=".html" style="./site.vsl"
projectFile="${project.file}"
excludes="**/stylesheets/**"
includes="${include.xml}"
lastModifiedCheck="true"
templatePath="${site.templ.path}"
velocityPropertiesFile="${site.velocity.props}">
</anakia>
<copy todir="${site.dest}">
<fileset dir="${site.src}" includes="**/*.css,**/*.png,**/*.jpg,**/*.gif,**/*.pdf"/>
<fileset dir="${site.src}" includes="sensornet/**/*"/>
</copy>
</target>
<target name="doc" depends="prepare, doc-build-tool, doc-external-deps, site, doc-confluence, doc-rest, doc-acme" description="Build EJBCA inline ear file docs. Set -Ddoc.update=true to update documentation from PrimeKey's Confluence Server.">
<echo message="WS=${ws.objects.dir}"/>
<mkdir dir="${jdocs.ws.tmp}"/>
<mkdir dir="${docs.dest.ws}"/>
<copy overwrite="yes" todir="${jdocs.ws.tmp}">
<fileset dir="${ws.client.gen.src}">
<exclude name="**/${client.ws.class}.java"/>
<exclude name="**/ObjectFactory.java"/>
</fileset>
</copy>
<copy overwrite="yes" file="${ws.objects.dir}/package.html" todir="${jdocs.ws.tmp}/${ws.client.gen.relative-path}"/>
<java classname="org.ejbca.util.JAXWSDocAndConvTools" classpath="${docs.tools.dest}" failonerror="yes" fork="true" inputstring="">
<arg value="${ws.master.file}"/>
<arg value="${ws.client.gen.src}/${ws.client.gen.relative-path}/${client.ws.class}.java"/>
<arg value="${jdocs.ws.tmp}"/>
</java>
<javadoc destdir="${docs.dest.ws}"
author="true"
version="true"
Package="false"
Use="false"
nodeprecated="true"
nodeprecatedlist="true"
classpathref="jdoc.classpath"
windowtitle="EJBCA WS">
<packageset dir="${jdocs.ws.tmp}"/>
<fileset dir="modules/cesecore-common/src" defaultexcludes="yes">
<include name="**/AlgorithmConstants.java"/>
</fileset>
<fileset dir="${es.iface.dir}" defaultexcludes="yes">
<include name="**/*ConstantsWS.java"/>
</fileset>
<fileset dir="${ws.common.dir}" defaultexcludes="yes">
<include name="**/CertificateHelper.java"/>
<include name="**/KeyStoreHelper.java"/>
</fileset>
<link offline="true" href="http://docs.oracle.com/javase/7/docs/api/" packagelistLoc="${env.JAVA_HOME}/docs/api"/>
<doctitle><![CDATA[<h1>EJBCA WS Support</h1>]]></doctitle>
<bottom><![CDATA[<i>2019 PrimeKey Solutions AB.</i>]]></bottom>
</javadoc>
<mkdir dir="${docs.dest.logtypes}"/>
<javadoc destdir="${docs.dest.logtypes}"
author="false"
notree="true"
nohelp="true"
version="false"
Package="false"
Use="false"
nodeprecated="true"
nodeprecatedlist="true"
classpathref="jdoc.classpath"
windowtitle="EJBCA and CESeCore Audit Log types">
<fileset dir="modules/cesecore-common/src" defaultexcludes="yes">
<include name="org/cesecore/audit/enums/*Types.java"/>
<include name="org/cesecore/audit/enums/EventStatus.java"/>
</fileset>
<fileset dir="modules/ejbca-ejb-interface/src" defaultexcludes="yes">
<include name="org/ejbca/core/ejb/audit/enums/*Types.java"/>
</fileset>
<link offline="true" href="http://docs.oracle.com/javase/7/docs/api/" packagelistLoc="${env.JAVA_HOME}/docs/api"/>
<doctitle><![CDATA[<h1>EJBCA and CESeCore Audit Log types</h1>]]></doctitle>
<bottom><![CDATA[<i>2019 PrimeKey Solutions AB.</i>]]></bottom>
</javadoc>
<echo message="Local documentation is now available in file://${docs.dest}/index.html"/>
</target>
<target name="doc-rest" if="${mod.rest-api.exists}">
<mkdir dir="${docs.dest.rest}"/>
<java dir="${ejbca.home}" jar="${ejbca.home}/lib/ext/swagger docs/swagger-codegen-cli-2.3.1.jar" fork="true">
<arg line="generate -i ${mod.ejbca-rest-api.path}/resources/swagger.json -l html2 -o ${docs.dest.rest}
-t ${ejbca.home}/modules/ejbca-rest-api/htmlDocsTemplate"/>
</java>
</target>
<target name="doc-acme" if="${mod.acme.exists}">
<mkdir dir="${docs.dest.acme}"/>
<java dir="${ejbca.home}" jar="${ejbca.home}/lib/ext/swagger docs/swagger-codegen-cli-2.3.1.jar" fork="true">
<arg line="generate -i ${mod.acme.path}/resources/swagger.json -l html2 -o ${docs.dest.acme}
-t ${ejbca.home}/modules/ejbca-rest-api/htmlDocsTemplate"/>
</java>
</target>
</project>