You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2003/09/01 12:14:26 UTC
cvs commit: ant/src/script runant.pl
bodewig 2003/09/01 03:14:26
Modified: src/script runant.pl
Log:
Sync runant.pl with the other scripts to use new Launcher
Revision Changes Path
1.6 +9 -36 ant/src/script/runant.pl
Index: runant.pl
===================================================================
RCS file: /home/cvs/ant/src/script/runant.pl,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- runant.pl 1 Jun 2002 12:26:42 -0000 1.5
+++ runant.pl 1 Sep 2003 10:14:26 -0000 1.6
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#
-# Copyright (c) 2001-2002 The Apache Software Foundation. All rights
+# Copyright (c) 2000-2003 The Apache Software Foundation. All rights
# reserved.
#
#######################################################################
@@ -18,7 +18,7 @@
# the code is not included.
#
# created: 2000-8-24
-# last modified: 2000-8-24
+# last modified: $Date$
# author: Steve Loughran steve_l@sourceforge.net
#######################################################################
#
@@ -86,38 +86,11 @@
$localpath="";
}
-#add jar files. I am sure there is a perl one liner to do this.
-my $jarpattern="$HOME/lib/*.jar";
-my @jarfiles =glob($jarpattern);
-print "jarfiles=@jarfiles\n" if ($debug);
-my $jar;
-foreach $jar (@jarfiles )
- {
- $localpath.="$s$jar";
- }
-
-#if Java home is defined, look for tools.jar & classes.zip and add to classpath
-my $JAVA_HOME = $ENV{JAVA_HOME};
-if ($JAVA_HOME ne "")
- {
- my $tools="$JAVA_HOME/lib/tools.jar";
- if (-e "$tools")
- {
- $localpath .= "$s$tools";
- }
- my $classes="$JAVA_HOME/lib/classes.zip";
- if (-e $classes)
- {
- $localpath .= "$s$classes";
- }
- }
-else
- {
- print "\n\nWarning: JAVA_HOME environment variable is not set.\n".
- "If the build fails because sun.* classes could not be found\n".
- "you will need to set the JAVA_HOME environment variable\n".
- "to the installation directory of java\n";
- }
+if ($localpath eq "") {
+ $localpath = "$HOME/lib/ant-launcher.jar";
+} else {
+ $localpath = "$HOME/lib/ant-launcher.jar$s$localpath";
+}
#set JVM options and Ant arguments, if any
my @ANT_OPTS=split(" ", $ENV{ANT_OPTS});
@@ -131,6 +104,7 @@
#construct arguments to java
my @ARGS;
+push @ARGS, @ANT_OPTS;
if ($onnetware == 1)
{
# make classpath literally $CLASSPATH; and then the contents of $localpath
@@ -143,8 +117,7 @@
push @ARGS, "-classpath", "$localpath";
}
push @ARGS, "-Dant.home=$HOME";
-push @ARGS, @ANT_OPTS;
-push @ARGS, "org.apache.tools.ant.Main", @ANT_ARGS;
+push @ARGS, "org.apache.tools.ant.launch.Launcher", @ANT_ARGS;
push @ARGS, @ARGV;
print "\n $JAVACMD @ARGS\n\n" if ($debug);
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org