ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/jannotatix/forrest-targets.ent
Revision: 1.1.1.1 (vendor branch)
Committed: Sat Apr 30 12:19:26 2005 UTC (11 years, 4 months ago) by maximilian
Branch: MAIN
CVS Tags: HEAD, HEAD
Changes since 1.1: +0 -0 lines
Log Message:
First import

Line File contents
1 <!--
2 This build.xml snippet contains Forrest targets for Ant 1.5+. It checks that
3 the user has set ${forrest.home}, either in one of:
4 build.properties
5 project.properties
6 ant.properties
7 .ant.properties
8 or with the FORREST_HOME environment variable, and prints an informative error
9 message if not found.
10
11 Usage:
12 1) Copy this file to somewhere in your project.
13 2) Add the following to the top of your project's Ant build.xml script
14 (adjusting the path):
15
16 <!DOCTYPE project [
17 <!ENTITY forrest-targets SYSTEM "file:./forrest-targets.ent">
18 ]>
19
20 3) Before the closing '</project>' in your build.xml, add this:
21
22 &forrest-targets;
23
24 This is like expanding a macro: it pulls in the contents of this file.
25
26 A minimal build.xml would thus be:
27
28 <!DOCTYPE project [
29 <!ENTITY forrest-targets SYSTEM "file:./forrest-targets.ent">
30 ]>
31
32 <project default="site">
33 &forrest-targets;
34 </project>
35 -->
36
37 <target name="site" depends="forrest.init" description="Generates static HTML documentation">
38 <ant antfile="${forrest.home}/forrest.antproxy.xml" target="site"/>
39 </target>
40
41 <target name="webapp" depends="forrest.init" description="Generates an unpackaged webapp of the website">
42 <ant antfile="${forrest.home}/forrest.antproxy.xml" target="webapp"/>
43 </target>
44
45 <target name="war" depends="forrest.init" description="Generates a .war file containing the website">
46 <ant antfile="${forrest.home}/forrest.antproxy.xml" target="war"/>
47 </target>
48
49 <target name="validate" depends="forrest.init" description="Validates XML documentation files">
50 <ant antfile="${forrest.home}/forrest.antproxy.xml" target="validate"/>
51 </target>
52
53 <target name="forrest.init" depends="forrest.sethome, forrest.home.defined"/>
54
55 <target name="forrest.sethome" depends="forrest.loadenv,
56 forrest.checkenv, forrest.checkhome, forrest.check-build.properties,
57 forrest.check-project.properties, forrest.check-ant.properties,
58 forrest.check-.ant.properties"/>
59
60 <target name="forrest.loadenv" unless="forrest.home.present">
61 <property environment="env"/>
62 <echo level="verbose">Forrest: Got ${env.FORREST_HOME}</echo>
63 </target>
64
65 <target name="forrest.checkenv" if="env.FORREST_HOME">
66 <echo level="verbose">Found $FORREST_HOME..</echo>
67 <property name="forrest.home" location="${env.FORREST_HOME}"/>
68 <echo level="verbose">forrest.home set to ${forrest.home}</echo>
69 <available file="${forrest.home}" type="dir" property="forrest.home.present"/>
70 </target>
71
72
73 <target name="forrest.checkhome">
74 <available file="${forrest.home}" type="dir" property="forrest.home.present"/>
75 <available file="build.properties" type="file" property="build.properties.present"/>
76 <available file="project.properties" type="file" property="project.properties.present"/>
77 <available file="ant.properties" type="file" property="ant.properties.present"/>
78 <available file=".ant.properties" type="file" property=".ant.properties.present"/>
79 </target>
80
81 <!-- No we can't extract the commonalities below into an antcall'ed target,
82 because it wouldn't be able to set forrest.home -->
83 <target name="forrest.check-build.properties" unless="forrest.home.present"
84 if="build.properties.present">
85 <echo level="verbose">Forrest: Checking build.properties..</echo>
86 <loadproperties srcfile="build.properties">
87 <filterchain>
88 <linecontains>
89 <contains value="forrest.home"/>
90 </linecontains>
91 </filterchain>
92 </loadproperties>
93 <available file="${forrest.home}" type="dir" property="forrest.home.present"/>
94
95 </target>
96
97 <target name="forrest.check-project.properties" unless="forrest.home.present"
98 if="project.properties.present">
99 <echo level="verbose">Forrest: Checking project.properties..</echo>
100 <loadproperties srcfile="project.properties">
101 <filterchain>
102 <linecontains>
103 <contains value="forrest.home"/>
104 </linecontains>
105 </filterchain>
106 </loadproperties>
107 <available file="${forrest.home}" type="dir" property="forrest.home.present"/>
108 </target>
109
110 <target name="forrest.check-ant.properties" unless="forrest.home.present"
111 if="ant.properties.present">
112 <echo level="verbose">Forrest: Checking ant.properties..</echo>
113 <loadproperties srcfile="ant.properties">
114 <filterchain>
115 <linecontains>
116 <contains value="forrest.home"/>
117 </linecontains>
118 </filterchain>
119 </loadproperties>
120 <available file="${forrest.home}" type="dir" property="forrest.home.present"/>
121 </target>
122
123 <target name="forrest.check-.ant.properties" unless="forrest.home.present"
124 if=".ant.properties.present">
125 <echo level="verbose">Forrest: Checking .ant.properties..</echo>
126 <loadproperties srcfile=".ant.properties">
127 <filterchain>
128 <linecontains>
129 <contains value="forrest.home"/>
130 </linecontains>
131 </filterchain>
132 </loadproperties>
133 <available file="${forrest.home}" type="dir" property="forrest.home.present"/>
134 </target>
135
136 <target name="forrest.home.defined" depends="forrest.sethome" unless="forrest.home.present">
137 <property name="path" value="${user.home}/xml-forrest/build/dist/shbat"/>
138 <pathconvert targetos="windows" property="winpath">
139 <path>
140 <pathelement location="${path}"/>
141 </path>
142 </pathconvert>
143 <pathconvert targetos="unix" property="unixpath">
144 <path>
145 <pathelement
146 location="${path}"/>
147 </path>
148 </pathconvert>
149
150 <echo>
151 ----------------------------------------------
152 To run this target, you need Forrest installed.
153 Please do the following:
154
155 export CVSROOT=:pserver:anoncvs@cvs.apache.org:/home/cvspublic
156 cvs checkout xml-forrest
157 cd xml-forrest
158 build (Windows)
159 ./build.sh (Unix)
160
161 Then either:
162
163 - Set FORREST_HOME as the Forrest build instructions describe
164 - Create a build.properties, with the forrest.home property pointing to
165 the forrest shbat directory, eg:
166
167 forrest.home=${winpath} (Windows)
168 forrest.home=${unixpath} (Unix)
169
170 (adjusting the path according to where your xml-forrest is)
171 ----------------------------------------------
172 </echo>
173 <fail message="Need to define $${forrest.home}"/>
174 </target>