Gentoo Archives: gentoo-commits

From: Patrice Clement <monsieurp@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/javatoolkit:master commit in: src/obsolete/bsfix/, src/obsolete/bsfix/tests/
Date: Mon, 07 Aug 2017 23:48:39
Message-Id: 1502149534.7bee587c7f6694e88a69ebaec66d7447b0e30b7b.monsieurp@gentoo
1 commit: 7bee587c7f6694e88a69ebaec66d7447b0e30b7b
2 Author: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
3 AuthorDate: Mon Aug 7 23:45:34 2017 +0000
4 Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
5 CommitDate: Mon Aug 7 23:45:34 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/javatoolkit.git/commit/?id=7bee587c
7
8 remove obsolete directory
9
10 src/obsolete/bsfix/JXSLT.java | 141 --------------
11 src/obsolete/bsfix/Makefile | 36 ----
12 src/obsolete/bsfix/bsfix | 8 -
13 src/obsolete/bsfix/bsfix-eclipse.py | 105 ----------
14 src/obsolete/bsfix/bsfix.py | 80 --------
15 src/obsolete/bsfix/build-xml-source-target.xslt | 28 ---
16 src/obsolete/bsfix/rewrite2-speed-test.sh | 47 -----
17 src/obsolete/bsfix/tests/build.xml | 247 ------------------------
18 8 files changed, 692 deletions(-)
19
20 diff --git a/src/obsolete/bsfix/JXSLT.java b/src/obsolete/bsfix/JXSLT.java
21 deleted file mode 100644
22 index 3b580f2..0000000
23 --- a/src/obsolete/bsfix/JXSLT.java
24 +++ /dev/null
25 @@ -1,141 +0,0 @@
26 -/*
27 - * Copyright (C) 2004, Jan Brinkmann <lucky@×××××××××××××.de>
28 - * Copyright (c) 2004, Karl Trygve Kalleberg <karltk@g.o>
29 - * Copyright (c) 2004, Thomas Matthijs <axxo@g.o>
30 - * Copyright (c) 2004, Gentoo Foundation
31 - *
32 - * Licensed under the GNU General Public License, v2
33 - *
34 - */
35 -
36 -import javax.xml.transform.Result;
37 -import javax.xml.transform.Source;
38 -import javax.xml.transform.Transformer;
39 -import javax.xml.transform.TransformerConfigurationException;
40 -import javax.xml.transform.TransformerException;
41 -import javax.xml.transform.TransformerFactory;
42 -import javax.xml.transform.stream.StreamSource;
43 -import javax.xml.transform.stream.StreamResult;
44 -import java.io.*;
45 -
46 -public class JXSLT
47 -{
48 - public static void printHelp()
49 - {
50 - System.err
51 - .println("Usage: java JXSLT ( -v <version> || -s <version> -t <version> ) -x <build.xslt> -i <oldbuild.xml> -o <newbuild.xml> ");
52 - }
53 -
54 - public static void main(String[] args)
55 - {
56 - // check if there are enough options given
57 - if (args.length <= 8)
58 - {
59 - System.err.println("missing options");
60 - printHelp();
61 - System.exit(1);
62 - }
63 -
64 - // detailed parsing of command line arguments
65 - File oldXmlFile = null, newXmlFile = null, xsltFile = null;
66 - String source = null, target = null;
67 - int i = 0;
68 - while (i < args.length)
69 - {
70 - boolean match = false;
71 - String[] options = {
72 - "-v", "--version", "-s", "--source", "-t", "--target", "-x", "--xsltsource", "-i", "--oldxml", "-o", "--newxml"
73 - };
74 -
75 - if (args[i].substring(0, 1).equals("-"))
76 - {
77 - if (args[i+1].substring(0, 1).equals("-")) {
78 - System.err.println("missing argument for '"+args[i]+"'");
79 - printHelp();
80 - System.exit(1);
81 - }
82 -
83 - int j = 0;
84 - while (j < options.length)
85 - {
86 - if (options[j].equals(args[i]))
87 - {
88 - match = true;
89 - break;
90 - }
91 - ++j;
92 - }
93 -
94 - if (match != true)
95 - {
96 - System.err.println("invalid option '" + args[i] + "'");
97 - printHelp();
98 - System.exit(1);
99 - }
100 - }
101 -
102 - if (args[i].equalsIgnoreCase("-v") || args[i].equalsIgnoreCase("--version"))
103 - {
104 - target = source = args[i + 1];
105 - } else if (args[i].equalsIgnoreCase("-s") || args[i].equalsIgnoreCase("--source"))
106 - {
107 - source = args[i + 1];
108 - } else if (args[i].equalsIgnoreCase("-t") || args[i].equalsIgnoreCase("--target"))
109 - {
110 - target = args[i + 1];
111 - } else if (args[i].equalsIgnoreCase("-x")
112 - || args[i].equalsIgnoreCase("--xsltsource"))
113 - {
114 - xsltFile = new File(args[i + 1]);
115 - } else if (args[i].equalsIgnoreCase("-i") || args[i].equalsIgnoreCase("--oldxml"))
116 - {
117 - oldXmlFile = new File(args[i + 1]);
118 - } else if (args[i].equalsIgnoreCase("-o") || args[i].equalsIgnoreCase("--newxml"))
119 - {
120 - newXmlFile = new File(args[i + 1]);
121 - }
122 -
123 - ++i;
124 - }
125 -
126 - // check if files exist
127 - Source xmlSource = null, xsltSource = null;
128 - if (oldXmlFile.exists())
129 - {
130 - xmlSource = new StreamSource(oldXmlFile);
131 - } else
132 - {
133 - System.out.println("xml sourcefile doesn't exist");
134 - System.exit(1);
135 - }
136 -
137 - if (xsltFile.exists())
138 - {
139 - xsltSource = new StreamSource(xsltFile);
140 - } else
141 - {
142 - System.out.println("xslt sourcefile doesn't exist");
143 - System.exit(1);
144 - }
145 - Result result = new StreamResult(newXmlFile);
146 -
147 - // create a new transformer and perform a transformation
148 - TransformerFactory transFact = TransformerFactory.newInstance();
149 - Transformer trans = null;
150 - try
151 - {
152 - trans = transFact.newTransformer(xsltSource);
153 - trans.setParameter("source", source);
154 - trans.setParameter("target", target);
155 - trans.transform(xmlSource, result);
156 - System.out.println(oldXmlFile + " transformed to " + newXmlFile);
157 - System.exit(0);
158 - } catch (TransformerConfigurationException e)
159 - {
160 - e.printStackTrace();
161 - } catch (TransformerException e)
162 - {
163 - e.printStackTrace();
164 - }
165 - }
166 -}
167
168 diff --git a/src/obsolete/bsfix/Makefile b/src/obsolete/bsfix/Makefile
169 deleted file mode 100644
170 index 87b0e32..0000000
171 --- a/src/obsolete/bsfix/Makefile
172 +++ /dev/null
173 @@ -1,36 +0,0 @@
174 -# Copyright 2004 Karl Trygve Kalleberg <karltk@g.o>
175 -# Copyright 2004 Gentoo Foundation
176 -# Distributed under the terms of the GNU General Public License v2
177 -#
178 -# $Header: /var/cvsroot/gentoo-src/javatoolkit/src/bsfix/Makefile,v 1.4 2005/01/02 02:30:12 axxo Exp $
179 -
180 -include ../../makedefs.mak
181 -
182 -all:
183 -
184 -dist:
185 - mkdir -p ../../$(distdir)/src/bsfix
186 - cp Makefile bsfix build-xml-source-target.xslt xml-rewrite.py xml-rewrite-2.py xml-rewrite-3.py class-version-verify.py ../../$(distdir)/src/bsfix
187 -
188 -install: all
189 - install -m 0755 bsfix $(bindir)/
190 - install -d $(DESTDIR)/usr/share/javatoolkit/lib
191 - install build-xml-source-target.xslt ${DESTDIR}/usr/share/javatoolkit/
192 - install -m 0755 xml-rewrite.py ${bindir}/
193 - install -m 0755 xml-rewrite-2.py ${bindir}/
194 - install -m 0755 xml-rewrite-3.py ${xmlrewritedir}/
195 - install -m 0755 class-version-verify.py ${bindir}/
196 -
197 -testdir:=tests
198 -
199 -test:
200 - # Dom based stuff
201 - cat $(testdir)/build.xml | ./xml-rewrite-2.py -g > /dev/null
202 - # Sax based stuff
203 - cat $(testdir)/build.xml | ./xml-rewrite-2.py \
204 - --change -e javac -e xjavac -a classpath -v '$${gentoo.classpath}' | grep gentoo.classpath > /dev/null
205 - cp $(testdir)/build.xml $(testdir)/test.xml
206 - ./xml-rewrite-2.py -f $(testdir)/test.xml \
207 - --change -e javac -e xjavac -a classpath -v '$${gentoo.classpath}'
208 - grep gentoo.classpath $(testdir)/test.xml > /dev/null
209 - rm $(testdir)/test.xml
210
211 diff --git a/src/obsolete/bsfix/bsfix b/src/obsolete/bsfix/bsfix
212 deleted file mode 100755
213 index 7d7dc79..0000000
214 --- a/src/obsolete/bsfix/bsfix
215 +++ /dev/null
216 @@ -1,8 +0,0 @@
217 -#! /bin/bash
218 -#
219 -# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@g.o>
220 -# Copyright (c) 2004, Gentoo Foundation
221 -#
222 -# Licensed under the GNU General Public License, v2
223 -
224 -java -cp /usr/share/javatoolkit/lib/ JXSLT $@
225
226 diff --git a/src/obsolete/bsfix/bsfix-eclipse.py b/src/obsolete/bsfix/bsfix-eclipse.py
227 deleted file mode 100755
228 index 3109b7d..0000000
229 --- a/src/obsolete/bsfix/bsfix-eclipse.py
230 +++ /dev/null
231 @@ -1,105 +0,0 @@
232 -#! /usr/bin/python2
233 -#
234 -# Copyright(c) 2004, Karl Trygve Kalleberg <karltk@g.o>
235 -# Copyright(c) 2004, Gentoo Foundation
236 -#
237 -# Licensed under the GNU General Public License, v2
238 -#
239 -# $Header: /var/cvsroot/gentoo-src/javatoolkit/src/bsfix/bsfix-eclipse.py,v 1.1 2004/12/20 19:13:05 karltk Exp $
240 -
241 -#
242 -# Usage:
243 -#
244 -# bsfix-eclipse --prefix /usr/lib/eclipse-3 --versions 3.0.0,3.0.1 --varnames eclipse_classpath build.properties
245 -#
246 -
247 -import os
248 -import re
249 -import sys
250 -import optparse
251 -
252 -import javatoolkit.parser as parser
253 -from javatoolkit.classpath import Classpath
254 -
255 -from javatoolkit import die
256 -
257 -__author__ = "Karl Trygve Kalleberg <karltk@g.o>"
258 -__version__ = "0.1.0"
259 -__productname__ = "bsfix-eclipse"
260 -__description__ = "Gentoo Eclipse Build Script Fixer"
261 -
262 -def find_best_version(path, vers):
263 - for ver in vers:
264 - x = re.sub("[0-9].[0-9].[0-9]", ver, path)
265 - if os.path.exists(x):
266 - return ver
267 - return None
268 -
269 -def resolve_version(doc, var, versions, prefix):
270 -
271 - node = doc.find_node(var)
272 - oldcp = Classpath(parser.expand(doc, node.value))
273 - newcp = Classpath()
274 -
275 - for i in range(len(oldcp)):
276 - entry = oldcp[i]
277 - if entry.startswith(prefix):
278 - ver = find_best_version(entry, versions)
279 - if ver is None:
280 - die(2, "Failed to resolve " + entry)
281 -
282 - substed_entry = re.sub("[0-9].[0-9].[0-9]", ver, entry)
283 - newcp.append(substed_entry)
284 - else:
285 - newcp.append(entry)
286 -
287 - node.value = str(newcp)
288 - return node
289 -
290 -"""
291 -Print program version to stdout.
292 -"""
293 -def print_version():
294 - print __productname__ + "(" + __version__ + ") - " + \
295 - __description__
296 - print "Author(s): " + __author__
297 -
298 -"""
299 -Parse command line arguments
300 -"""
301 -def parse_args():
302 -
303 - parser = optparse.OptionParser(version="%prog " + __version__ )
304 -
305 - parser.add_option("-p", "--prefix-path", dest="prefix_path",
306 - default="", help="path of Eclipse installation")
307 -
308 - parser.add_option("-a", "--allowed-versions", dest="versions",
309 - default=".", help="versions to check for (comma separated)")
310 -
311 - parser.add_option("-n", "--varnames", dest="varnames",
312 - default=".", help="attribute names to be considered as classpaths (comma separated)")
313 -
314 - (opts, args) = parser.parse_args()
315 - opts.varnames = opts.varnames.split(",")
316 - opts.versions = opts.versions.split(",")
317 -
318 - return (opts, args)
319 -
320 -def main():
321 -
322 - (options, args) = parse_args()
323 -
324 - for arg in args:
325 -
326 - doc = parser.buildproperties.parse(open(arg))
327 - if doc == None:
328 - raise "File not readable, '" + arg + "'"
329 -
330 - for var in options.varnames:
331 - resolve_version(doc, var, options.versions, options.prefix_path)
332 -
333 - doc.dump()
334 -
335 -if __name__ == "__main__":
336 - main()
337
338 diff --git a/src/obsolete/bsfix/bsfix.py b/src/obsolete/bsfix/bsfix.py
339 deleted file mode 100755
340 index 9aafe7d..0000000
341 --- a/src/obsolete/bsfix/bsfix.py
342 +++ /dev/null
343 @@ -1,80 +0,0 @@
344 -#! /usr/bin/python2
345 -#
346 -# Copyright(c) 2004, Karl Trygve Kalleberg <karltk@g.o>
347 -# Copyright(c) 2004, Gentoo Foundation
348 -#
349 -# Licensed under the GNU General Public License, v2
350 -#
351 -# $Header: /var/cvsroot/gentoo-src/javatoolkit/src/bsfix/bsfix.py,v 1.1 2004/12/20 19:13:05 karltk Exp $
352 -
353 -import os
354 -import re
355 -import sys
356 -import optparse
357 -
358 -import javatoolkit.parser as parser
359 -from javatoolkit.classpath import Classpath
360 -
361 -def find_best_version(path, vers):
362 - for ver in vers:
363 - x = re.sub("[0-9].[0-9].[0-9]", ver, path)
364 - if os.path.exists(x):
365 - return ver
366 - return None
367 -
368 -"""
369 -Parse command line arguments.
370 -"""
371 -def parse_args(args):
372 -
373 - basedir = os.getcwd()
374 -
375 - parser = optparse.OptionParser(version="%prog " + __version__ )
376 -
377 - parser.add_option("-a", "--attribute", dest="attribute",
378 - default="", help="select this attribute")
379 -
380 - parser.add_option("-r", "--replace", dest="replace",
381 - default=".", help="where to store the generated files")
382 -
383 - parser.add_option("-c", "--cache-file", dest="cachefile",
384 - default=basedir + "/cache3.db", help="where to store the cache")
385 -
386 - parser.add_option("-m", "--manifest-file", dest="manifestfile",
387 - default=basedir + "/manifest.synctool", help="where to store the manifest file")
388 -
389 - parser.add_option("-u", "--update-mode", dest="update_mode",
390 - default="quick", help="update mode, either 'generate' or 'quick'")
391 -
392 - parser.add_option("-v", "--verbose", dest="verbosity",
393 - default=3, help="verbosity")
394 -
395 - return parser.parse_args()
396 -
397 -
398 -if __name__ == "__main__":
399 -
400 - infile = sys.argv[1]
401 - r = parser.buildproperties.parse(open(infile))
402 -
403 - alt_versions = sys.argv[2:]
404 -
405 - n = parser.find_node(r, "eclipse_classpath")
406 - cp = Classpath(n.value)
407 -
408 - for i in range(len(cp)):
409 - x = cp[i]
410 - t = parser.expand(r, x)
411 - if t.startswith("/usr/lib/eclipse-3"):
412 - ver = find_best_version(t, alt_versions)
413 - if ver is None:
414 - print "Failed to resolve " + x
415 - sys.exit(2)
416 -
417 - y = re.sub("[0-9].[0-9].[0-9]", ver, x)
418 - cp[i] = y
419 -
420 - n.value = str(cp)
421 -
422 - r.dump()
423 -
424
425 diff --git a/src/obsolete/bsfix/build-xml-source-target.xslt b/src/obsolete/bsfix/build-xml-source-target.xslt
426 deleted file mode 100644
427 index fd9bceb..0000000
428 --- a/src/obsolete/bsfix/build-xml-source-target.xslt
429 +++ /dev/null
430 @@ -1,28 +0,0 @@
431 -<?xml version="1.0"?>
432 - <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
433 - <xsl:output method="xml" indent="yes" />
434 - <xsl:param name="target" />
435 - <xsl:param name="source" />
436 -
437 - <xsl:template match="@*|node()">
438 - <xsl:copy>
439 - <xsl:apply-templates select="@*|node()"/>
440 - </xsl:copy>
441 - </xsl:template>
442 - <xsl:template match="javac|xjavac|javac.preset">
443 - <xsl:copy>
444 - <xsl:attribute name="target">
445 - <xsl:value-of select="$target"/>
446 - </xsl:attribute>
447 - <xsl:apply-templates select="@*|node()"/>
448 - </xsl:copy>
449 - </xsl:template>
450 - <xsl:template match="javac|xjavac|javac.preset|javadoc">
451 - <xsl:copy>
452 - <xsl:attribute name="source">
453 - <xsl:value-of select="$source"/>
454 - </xsl:attribute>
455 - <xsl:apply-templates select="@*|node()"/>
456 - </xsl:copy>
457 - </xsl:template>
458 -</xsl:stylesheet>
459
460 diff --git a/src/obsolete/bsfix/rewrite2-speed-test.sh b/src/obsolete/bsfix/rewrite2-speed-test.sh
461 deleted file mode 100755
462 index b572206..0000000
463 --- a/src/obsolete/bsfix/rewrite2-speed-test.sh
464 +++ /dev/null
465 @@ -1,47 +0,0 @@
466 -#!/bin/sh
467 -files=""
468 -JAVA_PKG_BSFIX_TARGET_TAGS=${JAVA_PKG_BSFIX_TARGET_TAGS:-"javac xjavac javac.preset"}
469 -JAVA_PKG_BSFIX_SOURCE_TAGS=${JAVA_PKG_BSFIX_SOURCE_TAGS:-"javadoc javac xjavac javac.preset"}
470 -
471 -want_source="java-1.4"
472 -want_target="java-1.5"
473 -
474 -NEWPATH="./" # TODO: CHANGEME
475 -rpath="./xmls" # TODO: CHANGEME
476 -
477 -for i in $(ls $rpath/b*);
478 -do
479 - files=" $files -f $i"
480 -done
481 -
482 -clean(){
483 - rm -rf $rpath
484 - cp -rf $rpath.sav $rpath
485 -}
486 -
487 -old() {
488 - xml-rewrite-2.py ${files} \
489 - -c -e ${JAVA_PKG_BSFIX_SOURCE_TAGS// / -e } \
490 - -a source -v ${want_source} ${output}
491 - xml-rewrite-2.py ${files} \
492 - -c -e ${JAVA_PKG_BSFIX_TARGET_TAGS// / -e } \
493 - -a target -v ${want_target} ${output}
494 -}
495 -
496 -new(){
497 - ${NEWPATH}/xml-rewrite-2.py ${files} \
498 - -c --source-element ${JAVA_PKG_BSFIX_SOURCE_TAGS// / --source_elements } \
499 - --source-attribute source --source-value ${want_source} \
500 - --target-element ${JAVA_PKG_BSFIX_TARGET_TAGS// / --target_elements} \
501 - --target-attribute target --target-value ${want_target} \
502 - ${output}
503 -}
504 -
505 -clean
506 -echo "_________________time old"
507 -time old|grep -v "ewrit"
508 -
509 -clean
510 -echo "_________________time new"
511 -time new|grep -v "ewrit"
512 -
513
514 diff --git a/src/obsolete/bsfix/tests/build.xml b/src/obsolete/bsfix/tests/build.xml
515 deleted file mode 100644
516 index e8a8aa5..0000000
517 --- a/src/obsolete/bsfix/tests/build.xml
518 +++ /dev/null
519 @@ -1,247 +0,0 @@
520 -<?xml version="1.0"?>
521 -<project basedir="." default="lib">
522 - <target name="init">
523 - <!--
524 - Default values for most properties. Module specific settings are made
525 - in build-default.properties, local overrides go into build.properties
526 - -->
527 - <property file="${user.home}/.${ant.project.name}-build.properties"/>
528 - <property file="${user.home}/.build.properties"/>
529 - <property file="build.properties"/>
530 - <property file="build-default.properties"/>
531 - <property name="module.name" value="${ant.project.name}" />
532 -
533 - <property name="lib.dir" value="${dist.root}/lib" />
534 - <property name="build.lib.dir" value="${dist.root}/build-lib" />
535 - <property name="lib-test.dir" value="${dist.root}/tests" />
536 - <property name="src.dir" value="src" />
537 - <property name="test.dir" value="tests" />
538 - <property name="build.dir" value="build" />
539 - <property name="doc.dir" value="doc" />
540 - <property name="lib-doc.dir" value="${dist.root}/doc" />
541 -
542 - <property name="module.jar" value="${lib.dir}/${module.name}.jar" />
543 -
544 - <property name="build.classes" value="${build.dir}/classes" />
545 - <property name="build.debug" value="on" />
546 - <property name="build.optimize" value="off" />
547 - <property name="build.compiler" value="modern" />
548 -
549 - <property name="test.classes" value="${build.dir}/tests" />
550 - <property name="test.results" value="${build.dir}/testresults" />
551 - <property name="test.jar" value="${lib-test.dir}/${module.name}-tests.jar" />
552 - <property name="javadoc.packages" value="*" />
553 - <property name="javadoc.dir" value="${doc.dir}/api" />
554 - <property name="javadoc.bottom" value="Copyright &amp;copy; ${module.year} ${module.contributor}. All Rights reserved." />
555 - <property name="javadoc.title" value="${module.fullname} ${module.version} API" />
556 - <property name="javadoc.windowtitle" value="${javadoc.title}" />
557 - <property name="javadoc.omitindex" value="false" />
558 - <property name="javadoc.splitindex" value="true" />
559 - <property name="javadoc.showauthor" value="true" />
560 - <property name="javadoc.showuse" value="true" />
561 - <property name="javadoc.showversion" value="true" />
562 - <property name="javadoc.zip" value="${lib-doc.dir}/${module.name}.zip" />
563 -
564 - <property name="clean.backup-pattern" value="**/*~,**/*.bak" />
565 -
566 -
567 - <!-- Automatically disable all test related targets if we don't have
568 - a test source directory -->
569 - <condition property="test.skip">
570 - <not>
571 - <available file="${test.dir}" />
572 - </not>
573 - </condition>
574 -
575 - <!-- Class paths for use in building and testing -->
576 - <path id="module.classpath">
577 - <pathelement path="${build.classes}"/>
578 - <fileset dir="${lib.dir}"
579 - includes="${module.depends}"
580 - excludes="${module.jar}" />
581 - <fileset dir="${build.lib.dir}"
582 - includes="${module.depends}"
583 - excludes="${module.jar}" />
584 - </path>
585 -
586 - <path id="test.classpath">
587 - <path refid="module.classpath" />
588 - <pathelement path="${test.classes}" />
589 - <!-- Include the test source dir so that we can find test data and
590 - the like via getResource() -->
591 - <pathelement path="${test.dir}" />
592 - <!-- finally, include all of the junit stuff -->
593 - <pathelement path="${build.lib.dir}/junit.jar" />
594 - <pathelement path="${build.lib.dir}/junit-ext.jar" />
595 - <pathelement path="${build.lib.dir}/junit-tivano.jar" />
596 - </path>
597 -
598 - <!-- redefine the junit task so that it uses the provided junit.jar -->
599 - <!--<taskdef classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask" name="junit">
600 - <classpath>
601 - <pathelement path="${build.lib.dir}/junit.jar"/>
602 - <pathelement path="${build.lib.dir}/ant-optional.jar"/>
603 - </classpath>
604 - </taskdef>-->
605 - </target>
606 -
607 - <target name="all" depends="init,clean,compile,tests,dist"
608 - description="Build everything: clean, compile, tests, lib, javadoc, dist">
609 - </target>
610 -
611 - <target name="distclean" depends="clean-dist"
612 - description="Alias for 'clean-dist'" />
613 -
614 -
615 - <target name="compile" depends="init"
616 - description="Compile the source files">
617 - <mkdir dir="${build.classes}" />
618 - <javac srcdir="${src.dir}"
619 - destdir="${build.classes}"
620 - debug="${build.debug}"
621 - optimize="${build.optimize}"
622 - includes="${build.includes}"
623 - excludes="${build.excludes}">
624 - <classpath refid="module.classpath"/>
625 - </javac>
626 - </target>
627 -
628 - <target name="lib" depends="init,compile"
629 - description="Build the module .jar file">
630 - <tstamp/>
631 - <delete file="${module.jar}"/>
632 - <jar jarfile="${module.jar}">
633 - <fileset file="${dist.root}/../LICENSE-xmlc"/>
634 - <fileset dir="${build.classes}" />
635 - <fileset dir="${src.dir}"
636 - includes="${module.lib.extra.includes}"
637 - excludes="${module.lib.extra.excludes}" />
638 - <manifest>
639 - <attribute name="Built-By" value="${user.name}"/>
640 - <attribute name="Built-On" value="${TODAY}"/>
641 - <section name="org/enhydra/xml/xmlc/taskdef/">
642 - <attribute name="Specification-Title" value="Enhydra XMLC Ant Task"/>
643 - <attribute name="Specification-Version" value="${module.version}"/>
644 - <attribute name="Specification-Vendor" value="ObjectWeb Consortium"/>
645 - <attribute name="Implementation-Title" value="org.enhydra.xml.xmlc.taskdef"/>
646 - <attribute name="Implementation-Version" value="${module.version}"/>
647 - <attribute name="Implementation-Vendor" value="ObjectWeb Consortium"/>
648 - <attribute name="Implementation-Vendor-Id" value="org.objectweb"/>
649 - <attribute name="Implementation-URL" value="http://www.enhydra.org/tech/xmlc/"/>
650 - </section>
651 - </manifest>
652 - </jar>
653 - </target>
654 -
655 - <target name="lib-tests" depends="init,compile-tests" unless="test.skip"
656 - description="Build the unit test .jar file">
657 - <jar jarfile="${test.jar}">
658 - <fileset dir="${test.classes}" />
659 - <fileset dir="${test.dir}"
660 - includes="${test.lib.extra.includes}"
661 - excludes="${test.lib.extra.excludes}" />
662 - </jar>
663 - </target>
664 -
665 - <target name="compile-tests" depends="init,compile" unless="test.skip"
666 - description="Compile the JUnit unit tests">
667 - <mkdir dir="${test.classes}" />
668 - <javac srcdir="${test.dir}"
669 - destdir="${test.classes}"
670 - debug="${build.debug}"
671 - optimize="${build.optimize}" >
672 - <classpath refid="test.classpath"/>
673 - </javac>
674 - </target>
675 -
676 - <target name="tests" depends="init,compile-tests" unless="test.skip"
677 - description="Compile and run the JUnit unit tests">
678 - <mkdir dir="${test.results}"/>
679 - <junit haltonfailure="no" printsummary="yes">
680 - <classpath refid="test.classpath" />
681 - <formatter type="plain"/>
682 - <batchtest fork="yes" todir="${test.results}">
683 - <fileset dir="${test.dir}">
684 - <include name="**/*Test.java"/>
685 - </fileset>
686 - </batchtest>
687 - </junit>
688 - </target>
689 -
690 - <target name="javadoc" depends="init"
691 - description="Build the API documentation">
692 - <mkdir dir="${javadoc.dir}"/>
693 -
694 - <condition property="javadoc.breakiterator" value="-breakiterator" >
695 - <or>
696 - <equals arg1="${ant.java.version}" arg2="1.4" />
697 - <equals arg1="${ant.java.version}" arg2="1.5" />
698 - </or>
699 - </condition>
700 - <property name="javadoc.breakiterator" value="" />
701 - <condition property="javadoc.jdk.href" value="http://java.sun.com/products/jdk/1.2/docs/api/">
702 - <equals arg1="${ant.java.version}" arg2="1.2" />
703 - </condition>
704 - <condition property="javadoc.jdk.href" value="http://java.sun.com/j2se/1.3/docs/api/">
705 - <equals arg1="${ant.java.version}" arg2="1.3" />
706 - </condition>
707 - <condition property="javadoc.jdk.href" value="http://java.sun.com/j2se/1.4/docs/api/">
708 - <equals arg1="${ant.java.version}" arg2="1.4" />
709 - </condition>
710 - <condition property="javadoc.jdk.href" value="http://java.sun.com/j2se/1.5/docs/api/">
711 - <equals arg1="${ant.java.version}" arg2="1.5" />
712 - </condition>
713 - <property name="javadoc.jdk.href" value="" />
714 -
715 - <javadoc author="${javadoc.showauthor}"
716 - bottom="${javadoc.bottom}"
717 - destdir="${javadoc.dir}"
718 - doctitle="${javadoc.title}"
719 - noindex="${javadoc.omitindex}"
720 - packagenames="${javadoc.packages}"
721 - splitindex="${javadoc.splitindex}"
722 - use="${javadoc.showuse}"
723 - version="${javadoc.showversion}"
724 - windowtitle="${javadoc.windowtitle}"
725 - package="true"
726 - additionalparam="${javadoc.breakiterator}" >
727 - <link offline="true" href="${javadoc.url.xml-apis}" packagelistLoc="${javadoc.packagelistLoc.base}/xml-apis" />
728 - <link offline="true" href="${javadoc.jdk.href}" packagelistLoc="${javadoc.packagelistLoc.base}/java" />
729 - <classpath refid="module.classpath" />
730 - <sourcepath>
731 - <pathelement path="${src.dir}"/>
732 - </sourcepath>
733 - </javadoc>
734 - </target>
735 -
736 - <target name="dist" depends="init,lib,lib-tests,javadoc"
737 - description="Package up the library, unit tests and documentation">
738 - <zip basedir="${doc.dir}" zipfile="${javadoc.zip}" />
739 - </target>
740 -
741 - <target name="clean" depends="init"
742 - description="Remove .class and backup files">
743 - <delete dir="${build.classes}" />
744 - <delete dir="${test.classes}" />
745 - <delete>
746 - <fileset defaultexcludes="no" dir=""
747 - includes="${clean.backup-pattern}" />
748 - </delete>
749 - </target>
750 -
751 - <target name="clean-dist" depends="init,clean"
752 - description="Remove all generated and backup files">
753 - <delete includeEmptyDirs="true" quiet="true">
754 - <fileset dir="${doc.dir}" includes="**/*" />
755 - </delete>
756 - <delete dir="${test.results}" />
757 - <delete file="${module.jar}" />
758 - <delete file="${test.jar}" />
759 - <delete file="${javadoc.zip}" />
760 - </target>
761 -
762 - <target name="dtd"
763 - description="Regenerate the DTD for this build file">
764 - <antstructure output="project.dtd" />
765 - </target>
766 -</project>