OW2 Consortium jonas

Rev

Rev 2904 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2904 Rev 8612
1
<project default="publish" basedir=".">
1
<project default="publish" basedir=".">
2

2

3
  <!-- customizable properties -->
3
  <!-- customizable properties -->
4
  <property file="build.properties" />
4
  <property file="build.properties" />
5

5

6
  <!-- uncustomizable properties -->
6
  <!-- uncustomizable properties -->
7
  <property name="common_web.archive" value="common_web.zip" />
7
  <property name="common_web.archive" value="common_web.zip" />
8
  <property name="lib.dir" value="${basedir}/lib" />
8
  <property name="lib.dir" value="${basedir}/lib" />
9
  <property name="xml.dir" value="${basedir}/xml" />
9
  <property name="xml.dir" value="${basedir}/xml" />
10
  <property name="html.src" value="${basedir}/html" />
10
  <property name="html.src" value="${basedir}/html" />
11
  <property name="cgi.src" value="${basedir}/cgi-bin" />
11
  <property name="cgi.src" value="${basedir}/cgi-bin" />
12

12

13
  <property name="common.dir" value="${basedir}/common" />
13
  <property name="common.dir" value="${basedir}/common" />
14
  <property name="dtd.dir" value="${common.dir}/dtd" />  
14
  <property name="dtd.dir" value="${common.dir}/dtd" />  
15

15

16
  <property name="stylesheets.dir" value="${common.dir}/stylesheets" />
16
  <property name="stylesheets.dir" value="${common.dir}/stylesheets" />
17
  <property name="stylesheet.browsable" value="${stylesheets.dir}/browsable.xsl" />
17
  <property name="stylesheet.browsable" value="${stylesheets.dir}/browsable.xsl" />
18
  <property name="stylesheet.printable" value="${stylesheets.dir}/printable.xsl" />
18
  <property name="stylesheet.printable" value="${stylesheets.dir}/printable.xsl" />
19

19

20
  <property name="last-modified.pattern" value="yyyy-MM-dd hh:mm aa" />
20
  <property name="last-modified.pattern" value="yyyy-MM-dd hh:mm aa" />
21

21

22
  <!-- classpath -->
22
  <!-- classpath -->
23
  <path id="externals.classpath">
23
  <path id="externals.classpath">
24
    <fileset dir="${lib.dir}">
24
    <fileset dir="${lib.dir}">
25
      <include name="**/*.jar"/>
25
      <include name="**/*.jar"/>
26
    </fileset>
26
    </fileset>
27
  </path>
27
  </path>
28

28

29
  <!-- ===================================================================== -->
29
  <!-- ===================================================================== -->
30
  <!-- publish -->
30
  <!-- publish -->
31
  <!-- ===================================================================== -->
31
  <!-- ===================================================================== -->
32
  <target name="publish"
32
  <target name="publish"
33
	  depends="prepare, check, html_print, html" 
33
	  depends="prepare, check, html_print, html" 
34
	  description="Build the Web site">
34
	  description="Build the Web site">
35

35

36
    <touch file="${basedir}/.build"/>
36
    <touch file="${basedir}/.build"/>
37
  </target>
37
  </target>
38

38

39
  <!-- ===================================================================== -->
39
  <!-- ===================================================================== -->
40
  <!-- prepare -->
40
  <!-- prepare -->
41
  <!-- ===================================================================== -->
41
  <!-- ===================================================================== -->
42
  <target name="prepare"
42
  <target name="prepare"
43
	  depends="unzip_common_web"
43
	  depends="unzip_common_web"
44
	  description="Prepare the Web site build">	  
44
	  description="Prepare the Web site build">	  
45

45

46
    <!-- rebuild HTML files only when needed -->
46
    <!-- rebuild HTML files only when needed -->
47
    <uptodate property="rebuild.notNeeded" targetfile="${basedir}/.build">
47
    <uptodate property="rebuild.notNeeded" targetfile="${basedir}/.build">
48
      <srcfiles dir="${dtd.dir}" includes="**/*.dtd"/>
48
      <srcfiles dir="${dtd.dir}" includes="**/*.dtd"/>
49
      <srcfiles dir="${stylesheets.dir}" includes="**/*.xsl"/>
49
      <srcfiles dir="${stylesheets.dir}" includes="**/*.xsl"/>
50
      <srcfiles dir="${xml.dir}" includes="**/*.xml"/>
50
      <srcfiles dir="${xml.dir}" includes="**/*.xml"/>
51
    </uptodate>
51
    </uptodate>
52

52

53
    <!-- mkdirs -->
53
    <!-- mkdirs -->
54
    <mkdir dir="${html.dest}"/>
54
    <mkdir dir="${html.dest}"/>
55
    <mkdir dir="${cgi.dest}"/>
55
    <mkdir dir="${cgi.dest}"/>
56

56

57
    <!-- set the time build -->
57
    <!-- set the time build -->
58
    <tstamp>
58
    <tstamp>
59
      <format property="last.modified" pattern="${last-modified.pattern}"/>
59
      <format property="last.modified" pattern="${last-modified.pattern}"/>
60
    </tstamp>
60
    </tstamp>
61

61

62
    <!-- copy css stylesheet into ${html.dest} -->
62
    <!-- copy css stylesheet into ${html.dest} -->
63
    <copy todir="${html.dest}">
63
    <copy todir="${html.dest}">
64
      <fileset dir="${stylesheets.dir}">
64
      <fileset dir="${stylesheets.dir}">
65
	<include name="*.css"/>
65
	<include name="*.css"/>
66
      </fileset>
66
      </fileset>
67
    </copy>
67
    </copy>
68
    
68
    
69
    <!-- copy common images into ${html.dest}/images -->
69
    <!-- copy common images into ${html.dest}/images -->
70
    <copy todir="${html.dest}/images">
70
    <copy todir="${html.dest}/images">
71
      <fileset dir="${common.dir}/images" />
71
      <fileset dir="${common.dir}/images" />
72
    </copy>
72
    </copy>
73

73

74
    <!-- copy HTML files into ${html.dest} -->
74
    <!-- copy HTML files into ${html.dest} -->
75
    <copy todir="${html.dest}">
75
    <copy todir="${html.dest}">
76
      <fileset dir="${html.src}" />
76
      <fileset dir="${html.src}" />
77
    </copy>
77
    </copy>
78

78

79
    <!-- copy js into ${html.dest} -->
79
    <!-- copy js into ${html.dest} -->
80
    <copy todir="${html.dest}/js">
80
    <copy todir="${html.dest}/js">
81
      <fileset dir="${common.dir}/js" />
81
      <fileset dir="${common.dir}/js" />
82
    </copy>
82
    </copy>
83

83

84
    <!-- copy cgi-bin scripts into ${cgi.dest} -->
84
    <!-- copy cgi-bin scripts into ${cgi.dest} -->
85
    <copy todir="${cgi.dest}">
85
    <copy todir="${cgi.dest}">
86
      <fileset dir="${cgi.src}" />
86
      <fileset dir="${cgi.src}" />
87
    </copy>
87
    </copy>
88
    <chmod dir="${cgi.dest}" perm="ugo+x" includes="*.*"/>
88
    <chmod dir="${cgi.dest}" perm="ugo+x" includes="*.*"/>
89

89

90
  </target>
90
  </target>
91

91

92
  <!-- ===================================================================== -->
92
  <!-- ===================================================================== -->
93
  <!-- check -->
93
  <!-- check -->
94
  <!-- ===================================================================== -->
94
  <!-- ===================================================================== -->
95
  <target name="check"
95
  <target name="check"
96
	  depends="unzip_common_web"
96
	  depends="unzip_common_web"
97
	  description="Check the XML files syntax"
97
	  description="Check the XML files syntax"
98
	  unless="rebuild.notNeeded">
98
	  unless="rebuild.notNeeded">
99

99

100
    <xmlvalidate failonerror="yes"
100
    <xmlvalidate failonerror="yes"
101
		 lenient="no"
101
		 lenient="no"
102
		 warn="yes"
102
		 warn="yes"
103
		 classname="org.apache.xerces.parsers.SAXParser">
103
		 classname="org.apache.xerces.parsers.SAXParser">
104
      <classpath refid="externals.classpath"/>
104
      <classpath refid="externals.classpath"/>
105
      <fileset dir="${xml.dir}">
105
      <fileset dir="${xml.dir}">
106
	<include name="**/*.xml"/>
106
	<include name="**/*.xml"/>
107
      </fileset>
107
      </fileset>
108
    </xmlvalidate>
108
    </xmlvalidate>
109

109

110
  </target>
110
  </target>
111

111

112
  <!-- ===================================================================== -->
112
  <!-- ===================================================================== -->
113
  <!-- zip_common_web -->
113
  <!-- zip_common_web -->
114
  <!-- ===================================================================== -->
114
  <!-- ===================================================================== -->
115
  <target name="zip_common_web"
115
  <target name="zip_common_web"
116
	  description="Zip the ${common.dir} directory into ${common_web.archive}">  
116
	  description="Zip the ${common.dir} directory into ${common_web.archive}">  
117

117

118
    <zip zipfile="${common_web.archive}">
118
    <zip zipfile="${common_web.archive}">
119
      <zipfileset dir="${common.dir}" />
119
      <zipfileset dir="${common.dir}" />
120
    </zip>
120
    </zip>
121

121

122
  </target>
122
  </target>
123

123

124
  <!-- ===================================================================== -->
124
  <!-- ===================================================================== -->
125
  <!-- unzip_common_web -->
125
  <!-- unzip_common_web -->
126
  <!-- ===================================================================== -->
126
  <!-- ===================================================================== -->
127
  <target name="unzip_common_web"
127
  <target name="unzip_common_web"
128
	  description="Unzip the ${common_web.archive} file into ${common.dir}">
128
	  description="Unzip the ${common_web.archive} file into ${common.dir}">
129

129

130
    <unzip src="${common_web.archive}"
130
    <unzip src="${common_web.archive}"
131
	   dest="${common.dir}"
131
	   dest="${common.dir}"
132
	   overwrite="false"/>
132
	   overwrite="false"/>
133

133

134
  </target>
134
  </target>
135

135

136
  <!-- ===================================================================== -->
136
  <!-- ===================================================================== -->
137
  <!-- html_print -->
137
  <!-- html_print -->
138
  <!-- ===================================================================== -->
138
  <!-- ===================================================================== -->
139
  <target name="html_print"
139
  <target name="html_print"
140
	  description="Build Web site (printable version)"
140
	  description="Build Web site (printable version)"
141
	  unless="rebuild.notNeeded">
141
	  unless="rebuild.notNeeded">
142

142

143
    <!-- root Web site -->
143
    <!-- root Web site -->
144
    <antcall target="real_html">
144
    <antcall target="real_html">
145
      <param name="srcdir" value="${xml.dir}/root" />
145
      <param name="srcdir" value="${xml.dir}/root" />
146
      <param name="destdir" value="${html.dest}" />
146
      <param name="destdir" value="${html.dest}" />
147
      <param name="project.file" value="project/project.xml" />
147
      <param name="project.file" value="project/project.xml" />
148
      <param name="style" value="${stylesheet.printable}" />
148
      <param name="style" value="${stylesheet.printable}" />
149
      <param name="extension" value="_print.html" />	       
149
      <param name="extension" value="_print.html" />	       
150
    </antcall>
150
    </antcall>
151

151

152
  </target>
152
  </target>
153

153

154
  <!-- ===================================================================== -->
154
  <!-- ===================================================================== -->
155
  <!-- html -->
155
  <!-- html -->
156
  <!-- ===================================================================== -->
156
  <!-- ===================================================================== -->
157
  <target name="html"
157
  <target name="html"
158
	  description="Build Web site (browsable version)"
158
	  description="Build Web site (browsable version)"
159
	  unless="rebuild.notNeeded">
159
	  unless="rebuild.notNeeded">
160

160

161
    <!-- root Web site -->
161
    <!-- root Web site -->
162
    <antcall target="real_html">
162
    <antcall target="real_html">
163
      <param name="srcdir" value="${xml.dir}/root" />
163
      <param name="srcdir" value="${xml.dir}/root" />
164
      <param name="destdir" value="${html.dest}" />
164
      <param name="destdir" value="${html.dest}" />
165
      <param name="project.file" value="project/project.xml" />
165
      <param name="project.file" value="project/project.xml" />
166
      <param name="style" value="${stylesheet.browsable}" />
166
      <param name="style" value="${stylesheet.browsable}" />
167
      <param name="extension" value=".html" />	       
167
      <param name="extension" value=".html" />	       
168
    </antcall>
168
    </antcall>
169

169

170
  </target>
170
  </target>
171

171

172
  <!-- ===================================================================== -->
172
  <!-- ===================================================================== -->
173
  <!-- real_html -->
173
  <!-- real_html -->
174
  <!-- ===================================================================== -->
174
  <!-- ===================================================================== -->
175
  <target name="real_html"
175
  <target name="real_html"
176
	  description="Do the real transformation xml -> html">
176
	  description="Do the real transformation xml -> html">
177

177

178
    <style basedir="${srcdir}"
178
    <style basedir="${srcdir}"
179
	   destdir="${destdir}"	  
179
	   destdir="${destdir}"	  
180
	   style="${style}"
180
	   style="${style}"
181
	   extension="${extension}"
181
	   extension="${extension}"
182
	   processor="org.objectweb.util.ant.Xalan2Liaison"
182
	   processor="org.objectweb.util.ant.Xalan2Liaison"
183
	   force="true">
183
	   force="true">
184

184

185
      <include name="**/*.xml"/>
185
      <include name="**/*.xml"/>
186
      <exclude name="${project.file}"/>
186
      <exclude name="${project.file}"/>
187
      
187
      
188
      <classpath refid="externals.classpath"/>
188
      <classpath refid="externals.classpath"/>
189
      <param name="project-file" expression="${xml.dir}/${project.file}" />
189
      <param name="project-file" expression="${xml.dir}/${project.file}" />
190
      <param name="last-modified" expression="${last.modified}" />
190
      <param name="last-modified" expression="${last.modified}" />
191
    </style>
191
    </style>
192

192

193
  </target>
193
  </target>
194

194

195
  <!-- ===================================================================== -->
195
  <!-- ===================================================================== -->
196
  <!-- clean -->
196
  <!-- clean -->
197
  <!-- ===================================================================== -->
197
  <!-- ===================================================================== -->
198
  <target name="clean"
198
  <target name="clean"
199
	  description="Delete the generated files">
199
	  description="Delete the generated files">
200

200

201
    <delete includeEmptyDirs="true" quiet="true">
201
    <delete includeEmptyDirs="true" quiet="true">
202
      <fileset dir="${html.dest}"/>
202
      <fileset dir="${html.dest}"/>
203
      <fileset dir="${cgi.dest}"/>
203
      <fileset dir="${cgi.dest}"/>
204
      <fileset dir="${common.dir}"/>
204
      <fileset dir="${common.dir}"/>
205
    </delete>
205
    </delete>
206

206

207
    <delete file="${basedir}/.build"/>
207
    <delete file="${basedir}/.build"/>
208
  </target>
208
  </target>
209

209

210
</project>
210
</project>