tetra 0.46.0 → 0.48.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.rubocop.yml +6 -0
- data/README.md +5 -12
- data/SPECIAL_CASES.md +3 -74
- data/integration-tests/build-commons.sh +5 -8
- data/lib/template/kit/CONTENTS +4 -3
- data/lib/template/kit/apache-ant-1.9.4/INSTALL +2 -0
- data/lib/template/kit/apache-ant-1.9.4/KEYS +1497 -0
- data/lib/template/kit/apache-ant-1.9.4/LICENSE +272 -0
- data/lib/template/kit/apache-ant-1.9.4/NOTICE +9 -0
- data/lib/template/kit/apache-ant-1.9.4/README +97 -0
- data/lib/template/kit/apache-ant-1.9.4/WHATSNEW +6108 -0
- data/lib/template/kit/apache-ant-1.9.4/bin/ant +336 -0
- data/lib/template/kit/apache-ant-1.9.4/bin/ant.bat +218 -0
- data/lib/template/kit/apache-ant-1.9.4/bin/ant.cmd +93 -0
- data/lib/template/kit/apache-ant-1.9.4/bin/antRun +24 -0
- data/lib/template/kit/apache-ant-1.9.4/bin/antRun.bat +50 -0
- data/lib/template/kit/apache-ant-1.9.4/bin/antRun.pl +66 -0
- data/lib/template/kit/apache-ant-1.9.4/bin/antenv.cmd +98 -0
- data/lib/template/kit/apache-ant-1.9.4/bin/complete-ant-cmd.pl +114 -0
- data/lib/template/kit/apache-ant-1.9.4/bin/envset.cmd +131 -0
- data/lib/template/kit/apache-ant-1.9.4/bin/lcp.bat +31 -0
- data/lib/template/kit/apache-ant-1.9.4/bin/runant.pl +153 -0
- data/lib/template/kit/apache-ant-1.9.4/bin/runant.py +102 -0
- data/lib/template/kit/apache-ant-1.9.4/bin/runrc.cmd +60 -0
- data/lib/template/kit/apache-ant-1.9.4/etc/ant-bootstrap.jar +0 -0
- data/lib/template/kit/apache-ant-1.9.4/etc/changelog.xsl +148 -0
- data/lib/template/kit/apache-ant-1.9.4/etc/checkstyle/checkstyle-frames.xsl +299 -0
- data/lib/template/kit/apache-ant-1.9.4/etc/checkstyle/checkstyle-text.xsl +34 -0
- data/lib/template/kit/apache-ant-1.9.4/etc/checkstyle/checkstyle-xdoc.xsl +130 -0
- data/lib/template/kit/apache-ant-1.9.4/etc/coverage-frames.xsl +489 -0
- data/lib/template/kit/apache-ant-1.9.4/etc/jdepend-frames.xsl +487 -0
- data/lib/template/kit/apache-ant-1.9.4/etc/jdepend.xsl +276 -0
- data/lib/template/kit/apache-ant-1.9.4/etc/junit-frames-xalan1.xsl +745 -0
- data/lib/template/kit/apache-ant-1.9.4/etc/junit-frames.xsl +955 -0
- data/lib/template/kit/apache-ant-1.9.4/etc/junit-noframes.xsl +496 -0
- data/lib/template/kit/apache-ant-1.9.4/etc/log.xsl +203 -0
- data/lib/template/kit/apache-ant-1.9.4/etc/maudit-frames.xsl +503 -0
- data/lib/template/kit/apache-ant-1.9.4/etc/mmetrics-frames.xsl +1026 -0
- data/lib/template/kit/apache-ant-1.9.4/etc/tagdiff.xsl +179 -0
- data/lib/template/kit/apache-ant-1.9.4/fetch.xml +335 -0
- data/lib/template/kit/apache-ant-1.9.4/get-m2.xml +121 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/README +3 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-antlr.jar +0 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-antlr.pom +75 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-apache-bcel.jar +0 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-apache-bcel.pom +71 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-apache-bsf.jar +0 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-apache-bsf.pom +74 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-apache-log4j.jar +0 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-apache-log4j.pom +69 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-apache-oro.jar +0 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-apache-oro.pom +74 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-apache-regexp.jar +0 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-apache-regexp.pom +70 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-apache-resolver.jar +0 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-apache-resolver.pom +69 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-apache-xalan2.jar +0 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-apache-xalan2.pom +94 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-commons-logging.jar +0 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-commons-logging.pom +70 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-commons-net.jar +0 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-commons-net.pom +75 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-jai.jar +0 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-jai.pom +85 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-javamail.jar +0 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-javamail.pom +78 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-jdepend.jar +0 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-jdepend.pom +72 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-jmf.jar +0 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-jmf.pom +65 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-jsch.jar +0 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-jsch.pom +74 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-junit.jar +0 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-junit.pom +101 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-junit4.jar +0 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-junit4.pom +71 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-launcher.jar +0 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-launcher.pom +57 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-netrexx.jar +0 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-netrexx.pom +98 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-parent.pom +151 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-swing.jar +0 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-swing.pom +66 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-testutil.jar +0 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant-testutil.pom +74 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant.jar +0 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/ant.pom +225 -0
- data/lib/template/kit/apache-ant-1.9.4/lib/libraries.properties +65 -0
- data/lib/template/kit/apache-maven-3.2.5/LICENSE +302 -0
- data/lib/template/kit/apache-maven-3.2.5/NOTICE +8 -0
- data/lib/template/kit/apache-maven-3.2.5/README.txt +77 -0
- data/lib/template/kit/apache-maven-3.2.5/bin/m2.conf +8 -0
- data/lib/template/kit/apache-maven-3.2.5/bin/mvn +202 -0
- data/lib/template/kit/apache-maven-3.2.5/bin/mvn.bat +197 -0
- data/lib/template/kit/apache-maven-3.2.5/bin/mvnDebug +200 -0
- data/lib/template/kit/apache-maven-3.2.5/bin/mvnDebug.bat +200 -0
- data/lib/template/kit/apache-maven-3.2.5/bin/mvnyjp +207 -0
- data/lib/template/kit/apache-maven-3.2.5/boot/plexus-classworlds-2.5.2.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/conf/logging/simplelogger.properties +25 -0
- data/lib/template/kit/apache-maven-3.2.5/conf/settings.xml +257 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/aether-api-1.0.0.v20140518.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/aether-api.license +261 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/aether-connector-basic-1.0.0.v20140518.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/aether-connector-basic.license +261 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/aether-impl-1.0.0.v20140518.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/aether-impl.license +261 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/aether-spi-1.0.0.v20140518.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/aether-spi.license +261 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/aether-transport-wagon-1.0.0.v20140518.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/aether-transport-wagon.license +261 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/aether-util-1.0.0.v20140518.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/aether-util.license +261 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/aopalliance-1.0.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/cdi-api-1.0.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/cdi-api.license +445 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/commons-cli-1.2.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/commons-io-2.2.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/commons-lang-2.6.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/ext/README.txt +2 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/guava-18.0.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/javax.inject-1.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/jsoup-1.7.2.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/jsoup.license +66 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/jsr250-api-1.0.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/jsr250-api.license +406 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/maven-aether-provider-3.2.5.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/maven-aether-provider.license +202 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/maven-artifact-3.2.5.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/maven-artifact.license +202 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/maven-compat-3.2.5.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/maven-compat.license +202 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/maven-core-3.2.5.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/maven-core.license +202 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/maven-embedder-3.2.5.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/maven-embedder.license +202 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/maven-model-3.2.5.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/maven-model-builder-3.2.5.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/maven-model-builder.license +202 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/maven-model.license +202 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/maven-plugin-api-3.2.5.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/maven-plugin-api.license +202 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/maven-repository-metadata-3.2.5.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/maven-repository-metadata.license +202 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/maven-settings-3.2.5.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/maven-settings-builder-3.2.5.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/maven-settings-builder.license +202 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/maven-settings.license +202 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/org.eclipse.sisu.inject-0.3.0.M1.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/org.eclipse.sisu.inject.license +261 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/org.eclipse.sisu.plexus-0.3.0.M1.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/org.eclipse.sisu.plexus.license +261 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/plexus-cipher-1.7.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/plexus-cipher.license +445 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/plexus-component-annotations-1.5.5.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/plexus-interpolation-1.21.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/plexus-sec-dispatcher-1.3.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/plexus-sec-dispatcher.license +445 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/plexus-utils-3.0.20.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/sisu-guice-3.2.3-no_aop.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/slf4j-api-1.7.5.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/slf4j-api.license +190 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/slf4j-simple-1.7.5.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/slf4j-simple.license +190 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/wagon-file-2.8.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/wagon-file.license +202 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/wagon-http-2.8-shaded.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/wagon-http-shared-2.8.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/wagon-http-shared.license +202 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/wagon-http.license +202 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/wagon-provider-api-2.8.jar +0 -0
- data/lib/template/kit/apache-maven-3.2.5/lib/wagon-provider-api.license +202 -0
- data/lib/tetra.rb +30 -29
- data/lib/tetra/facades/ant.rb +27 -0
- data/lib/tetra/{git.rb → facades/git.rb} +29 -24
- data/lib/tetra/facades/mvn.rb +44 -0
- data/lib/tetra/facades/process_runner.rb +65 -0
- data/lib/tetra/facades/tar.rb +20 -0
- data/lib/tetra/{kit_runner.rb → kit.rb} +3 -10
- data/lib/tetra/main.rb +12 -36
- data/lib/tetra/maven_website.rb +1 -1
- data/lib/tetra/packages/archivable.rb +3 -11
- data/lib/tetra/packages/{kit.rb → kit_package.rb} +1 -1
- data/lib/tetra/packages/{built_package.rb → package.rb} +2 -2
- data/lib/tetra/packages/scriptable.rb +27 -15
- data/lib/tetra/project.rb +18 -14
- data/lib/tetra/{commands/ant.rb → ui/ant_subcommand.rb} +5 -5
- data/lib/tetra/ui/dry_run_subcommand.rb +44 -0
- data/lib/tetra/{commands/generate_all.rb → ui/generate_all_subcommand.rb} +5 -5
- data/lib/tetra/{commands/generate_archive.rb → ui/generate_archive_subcommand.rb} +2 -2
- data/lib/tetra/{commands/generate_kit.rb → ui/generate_kit_subcommand.rb} +2 -2
- data/lib/tetra/{commands/generate_script.rb → ui/generate_script_subcommand.rb} +2 -2
- data/lib/tetra/{commands/generate_spec.rb → ui/generate_spec_subcommand.rb} +2 -2
- data/lib/tetra/{commands/get_pom.rb → ui/get_pom_subcommand.rb} +1 -1
- data/lib/tetra/{commands/init.rb → ui/init_subcommand.rb} +1 -1
- data/lib/tetra/{commands/move_jars_to_kit.rb → ui/move_jars_to_kit_subcommand.rb} +1 -1
- data/lib/tetra/{commands/mvn.rb → ui/mvn_subcommand.rb} +5 -5
- data/lib/tetra/{commands/base.rb → ui/subcommand.rb} +19 -6
- data/lib/tetra/version.rb +1 -1
- data/spec/lib/ant_spec.rb +36 -0
- data/spec/lib/archivable_spec.rb +1 -1
- data/spec/lib/built_package_spec.rb +6 -6
- data/spec/lib/kit_package_spec.rb +47 -0
- data/spec/lib/kit_spec.rb +8 -28
- data/spec/lib/mvn_spec.rb +47 -0
- data/spec/lib/project_spec.rb +11 -11
- data/spec/lib/scriptable_spec.rb +8 -16
- data/spec/spec_helper.rb +13 -4
- data/tetra.gemspec +1 -0
- metadata +207 -31
- data/lib/tetra/ant_runner.rb +0 -27
- data/lib/tetra/commands/download_maven_source_jars.rb +0 -29
- data/lib/tetra/commands/dry_run.rb +0 -17
- data/lib/tetra/commands/finish.rb +0 -22
- data/lib/tetra/commands/get_source.rb +0 -30
- data/lib/tetra/commands/list_kit_missing_sources.rb +0 -21
- data/lib/tetra/kit_checker.rb +0 -104
- data/lib/tetra/maven_runner.rb +0 -43
- data/lib/tetra/source_getter.rb +0 -41
- data/spec/lib/ant_runner_spec.rb +0 -45
- data/spec/lib/kit_checker_spec.rb +0 -119
- data/spec/lib/maven_runner_spec.rb +0 -68
- data/spec/lib/source_getter_spec.rb +0 -36
- data/spec/support/kit_runner_examples.rb +0 -15
@@ -0,0 +1,336 @@
|
|
1
|
+
#! /bin/sh
|
2
|
+
|
3
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
4
|
+
# contributor license agreements. See the NOTICE file distributed with
|
5
|
+
# this work for additional information regarding copyright ownership.
|
6
|
+
# The ASF licenses this file to You under the Apache License, Version 2.0
|
7
|
+
# (the "License"); you may not use this file except in compliance with
|
8
|
+
# the License. You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
|
18
|
+
# Extract launch and ant arguments, (see details below).
|
19
|
+
ant_exec_args=
|
20
|
+
no_config=false
|
21
|
+
use_jikes_default=false
|
22
|
+
ant_exec_debug=false
|
23
|
+
show_help=false
|
24
|
+
for arg in "$@" ; do
|
25
|
+
if [ "$arg" = "--noconfig" ] ; then
|
26
|
+
no_config=true
|
27
|
+
elif [ "$arg" = "--usejikes" ] ; then
|
28
|
+
use_jikes_default=true
|
29
|
+
elif [ "$arg" = "--execdebug" ] ; then
|
30
|
+
ant_exec_debug=true
|
31
|
+
elif [ my"$arg" = my"--h" -o my"$arg" = my"--help" ] ; then
|
32
|
+
show_help=true
|
33
|
+
ant_exec_args="$ant_exec_args -h"
|
34
|
+
else
|
35
|
+
if [ my"$arg" = my"-h" -o my"$arg" = my"-help" ] ; then
|
36
|
+
show_help=true
|
37
|
+
fi
|
38
|
+
ant_exec_args="$ant_exec_args \"$arg\""
|
39
|
+
fi
|
40
|
+
done
|
41
|
+
|
42
|
+
# Source/default ant configuration
|
43
|
+
if $no_config ; then
|
44
|
+
rpm_mode=false
|
45
|
+
usejikes=$use_jikes_default
|
46
|
+
else
|
47
|
+
# load system-wide ant configuration (ONLY if ANT_HOME has NOT been set)
|
48
|
+
if [ -z "$ANT_HOME" -o "$ANT_HOME" = "/usr/share/ant" ]; then
|
49
|
+
if [ -f "/etc/ant.conf" ] ; then
|
50
|
+
. /etc/ant.conf
|
51
|
+
fi
|
52
|
+
fi
|
53
|
+
|
54
|
+
# load user ant configuration
|
55
|
+
if [ -f "$HOME/.ant/ant.conf" ] ; then
|
56
|
+
. $HOME/.ant/ant.conf
|
57
|
+
fi
|
58
|
+
if [ -f "$HOME/.antrc" ] ; then
|
59
|
+
. "$HOME/.antrc"
|
60
|
+
fi
|
61
|
+
|
62
|
+
# provide default configuration values
|
63
|
+
if [ -z "$rpm_mode" ] ; then
|
64
|
+
rpm_mode=false
|
65
|
+
fi
|
66
|
+
if [ -z "$usejikes" ] ; then
|
67
|
+
usejikes=$use_jikes_default
|
68
|
+
fi
|
69
|
+
fi
|
70
|
+
|
71
|
+
# Setup Java environment in rpm mode
|
72
|
+
if $rpm_mode ; then
|
73
|
+
if [ -f /usr/share/java-utils/java-functions ] ; then
|
74
|
+
. /usr/share/java-utils/java-functions
|
75
|
+
set_jvm
|
76
|
+
set_javacmd
|
77
|
+
fi
|
78
|
+
fi
|
79
|
+
|
80
|
+
# OS specific support. $var _must_ be set to either true or false.
|
81
|
+
cygwin=false;
|
82
|
+
darwin=false;
|
83
|
+
mingw=false;
|
84
|
+
case "`uname`" in
|
85
|
+
CYGWIN*) cygwin=true ;;
|
86
|
+
Darwin*) darwin=true
|
87
|
+
if [ -z "$JAVA_HOME" ] ; then
|
88
|
+
if [ -x '/usr/libexec/java_home' ] ; then
|
89
|
+
JAVA_HOME=`/usr/libexec/java_home`
|
90
|
+
elif [ -d "/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home" ]; then
|
91
|
+
JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
|
92
|
+
fi
|
93
|
+
fi
|
94
|
+
;;
|
95
|
+
MINGW*) mingw=true ;;
|
96
|
+
esac
|
97
|
+
|
98
|
+
if [ -z "$ANT_HOME" -o ! -d "$ANT_HOME" ] ; then
|
99
|
+
## resolve links - $0 may be a link to ant's home
|
100
|
+
PRG="$0"
|
101
|
+
progname=`basename "$0"`
|
102
|
+
|
103
|
+
# need this for relative symlinks
|
104
|
+
while [ -h "$PRG" ] ; do
|
105
|
+
ls=`ls -ld "$PRG"`
|
106
|
+
link=`expr "$ls" : '.*-> \(.*\)$'`
|
107
|
+
if expr "$link" : '/.*' > /dev/null; then
|
108
|
+
PRG="$link"
|
109
|
+
else
|
110
|
+
PRG=`dirname "$PRG"`"/$link"
|
111
|
+
fi
|
112
|
+
done
|
113
|
+
|
114
|
+
ANT_HOME=`dirname "$PRG"`/..
|
115
|
+
|
116
|
+
# make it fully qualified
|
117
|
+
ANT_HOME=`cd "$ANT_HOME" > /dev/null && pwd`
|
118
|
+
fi
|
119
|
+
|
120
|
+
# For Cygwin and Mingw, ensure paths are in UNIX format before
|
121
|
+
# anything is touched
|
122
|
+
if $cygwin ; then
|
123
|
+
[ -n "$ANT_HOME" ] &&
|
124
|
+
ANT_HOME=`cygpath --unix "$ANT_HOME"`
|
125
|
+
[ -n "$JAVA_HOME" ] &&
|
126
|
+
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
127
|
+
fi
|
128
|
+
if $mingw ; then
|
129
|
+
[ -n "$ANT_HOME" ] &&
|
130
|
+
ANT_HOME="`(cd "$ANT_HOME"; pwd)`"
|
131
|
+
[ -n "$JAVA_HOME" ] &&
|
132
|
+
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
|
133
|
+
fi
|
134
|
+
|
135
|
+
# set ANT_LIB location
|
136
|
+
ANT_LIB="${ANT_HOME}/lib"
|
137
|
+
|
138
|
+
if [ -z "$JAVACMD" ] ; then
|
139
|
+
if [ -n "$JAVA_HOME" ] ; then
|
140
|
+
# IBM's JDK on AIX uses strange locations for the executables
|
141
|
+
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
142
|
+
JAVACMD="$JAVA_HOME/jre/sh/java"
|
143
|
+
elif [ -x "$JAVA_HOME/jre/bin/java" ] ; then
|
144
|
+
JAVACMD="$JAVA_HOME/jre/bin/java"
|
145
|
+
else
|
146
|
+
JAVACMD="$JAVA_HOME/bin/java"
|
147
|
+
fi
|
148
|
+
else
|
149
|
+
JAVACMD=`which java 2> /dev/null `
|
150
|
+
if [ -z "$JAVACMD" ] ; then
|
151
|
+
JAVACMD=java
|
152
|
+
fi
|
153
|
+
fi
|
154
|
+
fi
|
155
|
+
|
156
|
+
if [ ! -x "$JAVACMD" ] ; then
|
157
|
+
echo "Error: JAVA_HOME is not defined correctly."
|
158
|
+
echo " We cannot execute $JAVACMD"
|
159
|
+
exit 1
|
160
|
+
fi
|
161
|
+
|
162
|
+
# Build local classpath using just the launcher in non-rpm mode or
|
163
|
+
# use the Jpackage helper in rpm mode with basic and default jars
|
164
|
+
# specified in the ant.conf configuration. Because the launcher is
|
165
|
+
# used, libraries linked in ANT_HOME/lib will also be included, but this
|
166
|
+
# is discouraged as it is not java-version safe. A user should
|
167
|
+
# request optional jars and their dependencies via the OPT_JAR_LIST
|
168
|
+
# variable
|
169
|
+
if $rpm_mode && [ -x /usr/bin/build-classpath ] ; then
|
170
|
+
LOCALCLASSPATH="$(/usr/bin/build-classpath ant ant-launcher jaxp_parser_impl xml-commons-apis)"
|
171
|
+
|
172
|
+
# If no optional jars have been specified then build the default list
|
173
|
+
if [ -z "$OPT_JAR_LIST" ] ; then
|
174
|
+
for file in /etc/ant.d/*; do
|
175
|
+
if [ -f "$file" ]; then
|
176
|
+
case "$file" in
|
177
|
+
*~) ;;
|
178
|
+
*#*) ;;
|
179
|
+
*.rpmsave) ;;
|
180
|
+
*.rpmnew) ;;
|
181
|
+
*)
|
182
|
+
for dep in `cat "$file"`; do
|
183
|
+
OPT_JAR_LIST="$OPT_JAR_LIST${OPT_JAR_LIST:+ }$dep"
|
184
|
+
done
|
185
|
+
esac
|
186
|
+
fi
|
187
|
+
done
|
188
|
+
fi
|
189
|
+
|
190
|
+
# If the user requested to try to add some other jars to the classpath
|
191
|
+
if [ -n "$OPT_JAR_LIST" ] ; then
|
192
|
+
_OPTCLASSPATH="$(/usr/bin/build-classpath $OPT_JAR_LIST 2> /dev/null)"
|
193
|
+
if [ -n "$_OPTCLASSPATH" ] ; then
|
194
|
+
LOCALCLASSPATH="$LOCALCLASSPATH:$_OPTCLASSPATH"
|
195
|
+
fi
|
196
|
+
fi
|
197
|
+
|
198
|
+
# Explicitly add javac path to classpath, assume JAVA_HOME set
|
199
|
+
# properly in rpm mode
|
200
|
+
if [ -f "$JAVA_HOME/lib/tools.jar" ] ; then
|
201
|
+
LOCALCLASSPATH="$LOCALCLASSPATH:$JAVA_HOME/lib/tools.jar"
|
202
|
+
fi
|
203
|
+
if [ -f "$JAVA_HOME/lib/classes.zip" ] ; then
|
204
|
+
LOCALCLASSPATH="$LOCALCLASSPATH:$JAVA_HOME/lib/classes.zip"
|
205
|
+
fi
|
206
|
+
|
207
|
+
# if CLASSPATH_OVERRIDE env var is set, LOCALCLASSPATH will be
|
208
|
+
# user CLASSPATH first and ant-found jars after.
|
209
|
+
# In that case, the user CLASSPATH will override ant-found jars
|
210
|
+
#
|
211
|
+
# if CLASSPATH_OVERRIDE is not set, we'll have the normal behaviour
|
212
|
+
# with ant-found jars first and user CLASSPATH after
|
213
|
+
if [ -n "$CLASSPATH" ] ; then
|
214
|
+
# merge local and specified classpath
|
215
|
+
if [ -z "$LOCALCLASSPATH" ] ; then
|
216
|
+
LOCALCLASSPATH="$CLASSPATH"
|
217
|
+
elif [ -n "$CLASSPATH_OVERRIDE" ] ; then
|
218
|
+
LOCALCLASSPATH="$CLASSPATH:$LOCALCLASSPATH"
|
219
|
+
else
|
220
|
+
LOCALCLASSPATH="$LOCALCLASSPATH:$CLASSPATH"
|
221
|
+
fi
|
222
|
+
|
223
|
+
# remove class path from launcher -cp option
|
224
|
+
CLASSPATH=""
|
225
|
+
fi
|
226
|
+
else
|
227
|
+
# not using rpm_mode; use launcher to determine classpaths
|
228
|
+
if [ -z "$LOCALCLASSPATH" ] ; then
|
229
|
+
LOCALCLASSPATH=$ANT_LIB/ant-launcher.jar
|
230
|
+
else
|
231
|
+
LOCALCLASSPATH=$ANT_LIB/ant-launcher.jar:$LOCALCLASSPATH
|
232
|
+
fi
|
233
|
+
fi
|
234
|
+
|
235
|
+
if [ -n "$JAVA_HOME" ] ; then
|
236
|
+
# OSX hack to make Ant work with jikes
|
237
|
+
if $darwin ; then
|
238
|
+
OSXHACK="${JAVA_HOME}/../Classes"
|
239
|
+
if [ -d "${OSXHACK}" ] ; then
|
240
|
+
for i in "${OSXHACK}"/*.jar
|
241
|
+
do
|
242
|
+
JIKESPATH="$JIKESPATH:$i"
|
243
|
+
done
|
244
|
+
fi
|
245
|
+
fi
|
246
|
+
fi
|
247
|
+
|
248
|
+
# Allow Jikes support (off by default)
|
249
|
+
if $usejikes; then
|
250
|
+
ANT_OPTS="$ANT_OPTS -Dbuild.compiler=jikes"
|
251
|
+
fi
|
252
|
+
|
253
|
+
# For Cygwin, switch paths to appropriate format before running java
|
254
|
+
# For PATHs convert to unix format first, then to windows format to ensure
|
255
|
+
# both formats are supported. Probably this will fail on directories with ;
|
256
|
+
# in the name in the path. Let's assume that paths containing ; are more
|
257
|
+
# rare than windows style paths on cygwin.
|
258
|
+
if $cygwin; then
|
259
|
+
if [ "$OS" = "Windows_NT" ] && cygpath -m .>/dev/null 2>/dev/null ; then
|
260
|
+
format=mixed
|
261
|
+
else
|
262
|
+
format=windows
|
263
|
+
fi
|
264
|
+
[ -n "$ANT_HOME" ] && ANT_HOME=`cygpath --$format "$ANT_HOME"`
|
265
|
+
ANT_LIB=`cygpath --$format "$ANT_LIB"`
|
266
|
+
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --$format "$JAVA_HOME"`
|
267
|
+
LCP_TEMP=`cygpath --path --unix "$LOCALCLASSPATH"`
|
268
|
+
LOCALCLASSPATH=`cygpath --path --$format "$LCP_TEMP"`
|
269
|
+
if [ -n "$CLASSPATH" ] ; then
|
270
|
+
CP_TEMP=`cygpath --path --unix "$CLASSPATH"`
|
271
|
+
CLASSPATH=`cygpath --path --$format "$CP_TEMP"`
|
272
|
+
fi
|
273
|
+
CYGHOME=`cygpath --$format "$HOME"`
|
274
|
+
fi
|
275
|
+
|
276
|
+
# Show script help if requested
|
277
|
+
if $show_help ; then
|
278
|
+
echo $0 '[script options] [options] [target [target2 [target3] ..]]'
|
279
|
+
echo 'Script Options:'
|
280
|
+
echo ' --help, --h print this message and ant help'
|
281
|
+
echo ' --noconfig suppress sourcing of /etc/ant.conf,'
|
282
|
+
echo ' $HOME/.ant/ant.conf, and $HOME/.antrc'
|
283
|
+
echo ' configuration files'
|
284
|
+
echo ' --usejikes enable use of jikes by default, unless'
|
285
|
+
echo ' set explicitly in configuration files'
|
286
|
+
echo ' --execdebug print ant exec line generated by this'
|
287
|
+
echo ' launch script'
|
288
|
+
echo ' '
|
289
|
+
fi
|
290
|
+
# add a second backslash to variables terminated by a backslash under cygwin
|
291
|
+
if $cygwin; then
|
292
|
+
case "$ANT_HOME" in
|
293
|
+
*\\ )
|
294
|
+
ANT_HOME="$ANT_HOME\\"
|
295
|
+
;;
|
296
|
+
esac
|
297
|
+
case "$CYGHOME" in
|
298
|
+
*\\ )
|
299
|
+
CYGHOME="$CYGHOME\\"
|
300
|
+
;;
|
301
|
+
esac
|
302
|
+
case "$JIKESPATH" in
|
303
|
+
*\\ )
|
304
|
+
JIKESPATH="$JIKESPATH\\"
|
305
|
+
;;
|
306
|
+
esac
|
307
|
+
case "$LOCALCLASSPATH" in
|
308
|
+
*\\ )
|
309
|
+
LOCALCLASSPATH="$LOCALCLASSPATH\\"
|
310
|
+
;;
|
311
|
+
esac
|
312
|
+
case "$CLASSPATH" in
|
313
|
+
*\\ )
|
314
|
+
CLASSPATH="$CLASSPATH\\"
|
315
|
+
;;
|
316
|
+
esac
|
317
|
+
fi
|
318
|
+
# Execute ant using eval/exec to preserve spaces in paths,
|
319
|
+
# java options, and ant args
|
320
|
+
ant_sys_opts=
|
321
|
+
if [ -n "$CYGHOME" ]; then
|
322
|
+
if [ -n "$JIKESPATH" ]; then
|
323
|
+
ant_sys_opts="-Djikes.class.path=\"$JIKESPATH\" -Dcygwin.user.home=\"$CYGHOME\""
|
324
|
+
else
|
325
|
+
ant_sys_opts="-Dcygwin.user.home=\"$CYGHOME\""
|
326
|
+
fi
|
327
|
+
else
|
328
|
+
if [ -n "$JIKESPATH" ]; then
|
329
|
+
ant_sys_opts="-Djikes.class.path=\"$JIKESPATH\""
|
330
|
+
fi
|
331
|
+
fi
|
332
|
+
ant_exec_command="exec \"$JAVACMD\" $ANT_OPTS -classpath \"$LOCALCLASSPATH\" -Dant.home=\"$ANT_HOME\" -Dant.library.dir=\"$ANT_LIB\" $ant_sys_opts org.apache.tools.ant.launch.Launcher $ANT_ARGS -cp \"$CLASSPATH\""
|
333
|
+
if $ant_exec_debug ; then
|
334
|
+
echo $ant_exec_command $ant_exec_args
|
335
|
+
fi
|
336
|
+
eval $ant_exec_command "$ant_exec_args"
|
@@ -0,0 +1,218 @@
|
|
1
|
+
@echo off
|
2
|
+
|
3
|
+
REM Licensed to the Apache Software Foundation (ASF) under one or more
|
4
|
+
REM contributor license agreements. See the NOTICE file distributed with
|
5
|
+
REM this work for additional information regarding copyright ownership.
|
6
|
+
REM The ASF licenses this file to You under the Apache License, Version 2.0
|
7
|
+
REM (the "License"); you may not use this file except in compliance with
|
8
|
+
REM the License. You may obtain a copy of the License at
|
9
|
+
REM
|
10
|
+
REM http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
REM
|
12
|
+
REM Unless required by applicable law or agreed to in writing, software
|
13
|
+
REM distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
REM See the License for the specific language governing permissions and
|
16
|
+
REM limitations under the License.
|
17
|
+
|
18
|
+
REM This is an inordinately troublesome piece of code, particularly because it
|
19
|
+
REM tries to work on both Win9x and WinNT-based systems. If we could abandon '9x
|
20
|
+
REM support, things would be much easier, but sadly, it is not yet time.
|
21
|
+
REM Be cautious about editing this, and only add WinNT specific stuff in code that
|
22
|
+
REM only runs on WinNT.
|
23
|
+
|
24
|
+
if "%HOME%"=="" goto homeDrivePathPre
|
25
|
+
if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat"
|
26
|
+
|
27
|
+
:homeDrivePathPre
|
28
|
+
if "%HOMEDRIVE%%HOMEPATH%"=="" goto userProfilePre
|
29
|
+
if "%HOMEDRIVE%%HOMEPATH%"=="%HOME%" goto userProfilePre
|
30
|
+
if exist "%HOMEDRIVE%%HOMEPATH%\antrc_pre.bat" call "%HOMEDRIVE%%HOMEPATH%\antrc_pre.bat"
|
31
|
+
|
32
|
+
:userProfilePre
|
33
|
+
if "%USERPROFILE%"=="" goto alpha
|
34
|
+
if "%USERPROFILE%"=="%HOME%" goto alpha
|
35
|
+
if "%USERPROFILE%"=="%HOMEDRIVE%%HOMEPATH%" goto alpha
|
36
|
+
if exist "%USERPROFILE%\antrc_pre.bat" call "%USERPROFILE%\antrc_pre.bat"
|
37
|
+
|
38
|
+
:alpha
|
39
|
+
|
40
|
+
if "%OS%"=="Windows_NT" @setlocal
|
41
|
+
if "%OS%"=="WINNT" @setlocal
|
42
|
+
|
43
|
+
if "%ANT_HOME%"=="" goto setDefaultAntHome
|
44
|
+
|
45
|
+
:stripAntHome
|
46
|
+
if not _%ANT_HOME:~-1%==_\ goto checkClasspath
|
47
|
+
set ANT_HOME=%ANT_HOME:~0,-1%
|
48
|
+
goto stripAntHome
|
49
|
+
|
50
|
+
:setDefaultAntHome
|
51
|
+
rem %~dp0 is expanded pathname of the current script under NT
|
52
|
+
set ANT_HOME=%~dp0..
|
53
|
+
|
54
|
+
:checkClasspath
|
55
|
+
set _USE_CLASSPATH=yes
|
56
|
+
rem CLASSPATH must not be used if it is equal to ""
|
57
|
+
if "%CLASSPATH%"=="""" set _USE_CLASSPATH=no
|
58
|
+
if "%CLASSPATH%"=="" set _USE_CLASSPATH=no
|
59
|
+
|
60
|
+
rem Slurp the command line arguments. This loop allows for an unlimited number
|
61
|
+
rem of arguments (up to the command line limit, anyway).
|
62
|
+
set ANT_CMD_LINE_ARGS=
|
63
|
+
:setupArgs
|
64
|
+
if ""%1""=="""" goto doneStart
|
65
|
+
if ""%1""==""-noclasspath"" goto clearclasspath
|
66
|
+
set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1
|
67
|
+
shift
|
68
|
+
goto setupArgs
|
69
|
+
|
70
|
+
rem here is there is a -noclasspath in the options
|
71
|
+
:clearclasspath
|
72
|
+
set _USE_CLASSPATH=no
|
73
|
+
shift
|
74
|
+
goto setupArgs
|
75
|
+
|
76
|
+
rem This label provides a place for the argument list loop to break out
|
77
|
+
rem and for NT handling to skip to.
|
78
|
+
|
79
|
+
:doneStart
|
80
|
+
|
81
|
+
if "%_USE_CLASSPATH%"=="no" goto findAntHome
|
82
|
+
|
83
|
+
:stripClasspath
|
84
|
+
if not _%CLASSPATH:~-1%==_\ goto findAntHome
|
85
|
+
set CLASSPATH=%CLASSPATH:~0,-1%
|
86
|
+
goto stripClasspath
|
87
|
+
|
88
|
+
:findAntHome
|
89
|
+
rem find ANT_HOME if it does not exist due to either an invalid value passed
|
90
|
+
rem by the user or the %0 problem on Windows 9x
|
91
|
+
if exist "%ANT_HOME%\lib\ant.jar" goto checkJava
|
92
|
+
|
93
|
+
rem check for ant in Program Files
|
94
|
+
if not exist "%ProgramFiles%\ant" goto checkSystemDrive
|
95
|
+
set ANT_HOME=%ProgramFiles%\ant
|
96
|
+
goto checkJava
|
97
|
+
|
98
|
+
:checkSystemDrive
|
99
|
+
rem check for ant in root directory of system drive
|
100
|
+
if not exist %SystemDrive%\ant\lib\ant.jar goto checkCDrive
|
101
|
+
set ANT_HOME=%SystemDrive%\ant
|
102
|
+
goto checkJava
|
103
|
+
|
104
|
+
:checkCDrive
|
105
|
+
rem check for ant in C:\ant for Win9X users
|
106
|
+
if not exist C:\ant\lib\ant.jar goto noAntHome
|
107
|
+
set ANT_HOME=C:\ant
|
108
|
+
goto checkJava
|
109
|
+
|
110
|
+
:noAntHome
|
111
|
+
echo ANT_HOME is set incorrectly or ant could not be located. Please set ANT_HOME.
|
112
|
+
goto end
|
113
|
+
|
114
|
+
:checkJava
|
115
|
+
set _JAVACMD=%JAVACMD%
|
116
|
+
|
117
|
+
if "%JAVA_HOME%" == "" goto noJavaHome
|
118
|
+
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
|
119
|
+
if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe
|
120
|
+
goto checkJikes
|
121
|
+
|
122
|
+
:noJavaHome
|
123
|
+
if "%_JAVACMD%" == "" set _JAVACMD=java.exe
|
124
|
+
|
125
|
+
:checkJikes
|
126
|
+
if not "%JIKESPATH%"=="" goto runAntWithJikes
|
127
|
+
|
128
|
+
:runAnt
|
129
|
+
if "%_USE_CLASSPATH%"=="no" goto runAntNoClasspath
|
130
|
+
:runAntWithClasspath
|
131
|
+
"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% -cp "%CLASSPATH%" %ANT_CMD_LINE_ARGS%
|
132
|
+
rem Check the error code of the Ant build
|
133
|
+
if not "%OS%"=="Windows_NT" goto onError
|
134
|
+
set ANT_ERROR=%ERRORLEVEL%
|
135
|
+
goto end
|
136
|
+
|
137
|
+
:runAntNoClasspath
|
138
|
+
"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% %ANT_CMD_LINE_ARGS%
|
139
|
+
rem Check the error code of the Ant build
|
140
|
+
if not "%OS%"=="Windows_NT" goto onError
|
141
|
+
set ANT_ERROR=%ERRORLEVEL%
|
142
|
+
goto end
|
143
|
+
|
144
|
+
:runAntWithJikes
|
145
|
+
|
146
|
+
if not _%JIKESPATH:~-1%==_\ goto checkJikesAndClasspath
|
147
|
+
set JIKESPATH=%JIKESPATH:~0,-1%
|
148
|
+
goto runAntWithJikes
|
149
|
+
|
150
|
+
:checkJikesAndClasspath
|
151
|
+
|
152
|
+
if "%_USE_CLASSPATH%"=="no" goto runAntWithJikesNoClasspath
|
153
|
+
|
154
|
+
:runAntWithJikesAndClasspath
|
155
|
+
"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" "-Djikes.class.path=%JIKESPATH%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% -cp "%CLASSPATH%" %ANT_CMD_LINE_ARGS%
|
156
|
+
rem Check the error code of the Ant build
|
157
|
+
if not "%OS%"=="Windows_NT" goto onError
|
158
|
+
set ANT_ERROR=%ERRORLEVEL%
|
159
|
+
goto end
|
160
|
+
|
161
|
+
:runAntWithJikesNoClasspath
|
162
|
+
"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" "-Djikes.class.path=%JIKESPATH%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% %ANT_CMD_LINE_ARGS%
|
163
|
+
rem Check the error code of the Ant build
|
164
|
+
if not "%OS%"=="Windows_NT" goto onError
|
165
|
+
set ANT_ERROR=%ERRORLEVEL%
|
166
|
+
goto end
|
167
|
+
|
168
|
+
:onError
|
169
|
+
rem Windows 9x way of checking the error code. It matches via brute force.
|
170
|
+
for %%i in (1 10 100) do set err%%i=
|
171
|
+
for %%i in (0 1 2) do if errorlevel %%i00 set err100=%%i
|
172
|
+
if %err100%==2 goto onError200
|
173
|
+
if %err100%==0 set err100=
|
174
|
+
for %%i in (0 1 2 3 4 5 6 7 8 9) do if errorlevel %err100%%%i0 set err10=%%i
|
175
|
+
if "%err100%"=="" if %err10%==0 set err10=
|
176
|
+
:onError1
|
177
|
+
for %%i in (0 1 2 3 4 5 6 7 8 9) do if errorlevel %err100%%err10%%%i set err1=%%i
|
178
|
+
goto onErrorEnd
|
179
|
+
:onError200
|
180
|
+
for %%i in (0 1 2 3 4 5) do if errorlevel 2%%i0 set err10=%%i
|
181
|
+
if err10==5 for %%i in (0 1 2 3 4 5) do if errorlevel 25%%i set err1=%%i
|
182
|
+
if not err10==5 goto onError1
|
183
|
+
:onErrorEnd
|
184
|
+
set ANT_ERROR=%err100%%err10%%err1%
|
185
|
+
for %%i in (1 10 100) do set err%%i=
|
186
|
+
|
187
|
+
:end
|
188
|
+
rem bug ID 32069: resetting an undefined env variable changes the errorlevel.
|
189
|
+
if not "%_JAVACMD%"=="" set _JAVACMD=
|
190
|
+
if not "%_ANT_CMD_LINE_ARGS%"=="" set ANT_CMD_LINE_ARGS=
|
191
|
+
|
192
|
+
if "%ANT_ERROR%"=="0" goto mainEnd
|
193
|
+
|
194
|
+
goto omega
|
195
|
+
|
196
|
+
:mainEnd
|
197
|
+
|
198
|
+
rem If there were no errors, we run the post script.
|
199
|
+
if "%OS%"=="Windows_NT" @endlocal
|
200
|
+
if "%OS%"=="WINNT" @endlocal
|
201
|
+
|
202
|
+
if "%HOME%"=="" goto homeDrivePathPost
|
203
|
+
if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat"
|
204
|
+
|
205
|
+
:homeDrivePathPost
|
206
|
+
if "%HOMEDRIVE%%HOMEPATH%"=="" goto userProfilePost
|
207
|
+
if "%HOMEDRIVE%%HOMEPATH%"=="%HOME%" goto userProfilePost
|
208
|
+
if exist "%HOMEDRIVE%%HOMEPATH%\antrc_post.bat" call "%HOMEDRIVE%%HOMEPATH%\antrc_post.bat"
|
209
|
+
|
210
|
+
:userProfilePost
|
211
|
+
if "%USERPROFILE%"=="" goto omega
|
212
|
+
if "%USERPROFILE%"=="%HOME%" goto omega
|
213
|
+
if "%USERPROFILE%"=="%HOMEDRIVE%%HOMEPATH%" goto omega
|
214
|
+
if exist "%USERPROFILE%\antrc_post.bat" call "%USERPROFILE%\antrc_post.bat"
|
215
|
+
|
216
|
+
:omega
|
217
|
+
|
218
|
+
exit /b %ANT_ERROR%
|