forked from too4words/securibench-micro
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
108 lines (95 loc) · 4.51 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
<!-- $Id: build.xml,v 1.10 2006/01/04 06:27:18 livshits Exp $ -->
<project name="Securibench Micro" default="cleandist" basedir=".">
<property environment="currentenv" />
<property file="build.properties" />
<property name="rootdir" value="." />
<path id="class.path">
<pathelement path="${currentenv.classpath}" />
<fileset dir="./lib">
<include name="**/*.jar" />
</fileset>
</path>
<!-- xdoclet paths -->
<property name="xdoclet.jar" value="${xdoclet}/xdoclet-1.2.3.jar" />
<property name="webdoclet.jar" value="${xdoclet}/xdoclet-web-module-1.2.3.jar" />
<property name="xjavadoc.jar" value="${xdoclet}/xjavadoc-1.1.jar" />
<property name="log4j.jar" value="${xdoclet}/log4j.jar" />
<property name="commons.collections.jar" value="${xdoclet}/commons-collections-2.0.jar" />
<property name="commons.logging.jar" value="${xdoclet}/commons-logging.jar" />
<property name="j2ee.jar" value="${rootdir}/lib/j2ee.jar" />
<property name="src.dir" value="${rootdir}/src" />
<property name="appDeployDir" value="${tomcat.home}/webapps/${web.context}"/>
<property name="webdav" value="${tomcat.home}/webapps/${webdav.context}"/>
<path id="webdoclet.classpath">
<pathelement path="${xdoclet.jar}" />
<pathelement path="${webdoclet.jar}" />
<pathelement path="${xjavadoc.jar}" />
<pathelement path="${commons.collections.jar}" />
<pathelement path="${commons.logging.jar}" />
<pathelement path="${log4j.jar}" />
<pathelement path="${j2ee.jar}" />
</path>
<!-- additional tasks -->
<taskdef name="xdoclet" classname="xdoclet.modules.web.WebDocletTask" classpathref="webdoclet.classpath" />
<taskdef name="java2html" classname="de.java2html.anttasks.Java2HtmlTask" classpath="${rootdir}/lib/java2html.jar" />
<!-- CLEAN -->
<target name="clean">
<echo message="Removing old directory structure..." />
<delete dir="${appDeployDir}/classes" />
<delete dir="${webdav}${web.context}" />
<delete dir="${rootdir}/${colorized.dir}" />
<delete file="${rootdir}/securibench-micro-${version}.zip" />
</target>
<!-- MK DEPLOY DIR -->
<target name="mkDeployDir">
<mkdir dir="${appDeployDir}/WEB-INF/classes" />
</target>
<!-- DEPLOY -->
<target name="deploy">
<echo message="Deploying classes, generating web.xml and index.html, colorizing sources... " />
<copy todir="${appDeployDir}/WEB-INF/lib">
<fileset dir="${rootdir}/lib" />
</copy>
<!--
<copy todir="${appDeployDir}/WEB-INF/classes">
<fileset dir="${rootdir}/classes" />
</copy>
-->
<java2html outputformat="html" srcdir="${src.dir}" destdir="${webdav}" includes="**/*.java"
style="eclipse" showLineNumbers="true" showFileName="true"
showTableBorder="false" includeDocumentHeader="true" />
<xdoclet destdir="${appDeployDir}" verbose="true" force="${xdoclet.force}" mergedir="metadata/web">
<fileset dir="${rootdir}/src">
<include name="**/*.java" />
</fileset>
<template templatefile="${rootdir}/web-xml-gen.xdt" destinationfile="WEB-INF/web.xml" />
<template templatefile="${rootdir}/index-html-gen.xdt" destinationfile="index.html" />
</xdoclet>
<!-- make a local copy of index.html -->
<copy file="${appDeployDir}/index.html" tofile="${rootdir}/index.html"/>
</target>
<!-- a separate task to produce colorized sources -->
<target name="colorize">
<echo message="Colorizing Java code and saving it in ${rootdir}/${colorized.dir}" />
<delete dir="${rootdir}/${colorized.dir}" />
<java2html outputformat="html" srcdir="${src.dir}" destdir="${rootdir}/${colorized.dir}"
includes="**/*.java" style="eclipse" showLineNumbers="true"
showFileName="true" showTableBorder="false" includeDocumentHeader="true" />
<zip destfile="${rootdir}/${colorized.dir}-${version}.zip"
basedir="${rootdir}/${colorized.dir}" />
<delete dir="${rootdir}/${colorized.dir}" />
</target>
<target name="compile">
<echo message="Compiling Securibench Micro..." />
<javac verbose="false" classpathref="class.path" srcdir="${src.dir}" destdir="${appDeployDir}/WEB-INF/classes" />
</target>
<!-- CLEANDIST -->
<target name="cleandist" depends="clean, mkDeployDir, compile, deploy"/>
<!-- This target makes a zip file for distribution -->
<target name="zip" depends="cleandist,colorize">
<echo message="Creating a distribution of Securibench Micro..." />
<zip destfile="${rootdir}/securibench-micro-${version}.zip"
basedir="${rootdir}"
excludes="${rootdir}/securibench-micro-*.zip,**/*.class"/>
</target>
</project>