From 446a11fca8f834862f54a49010c1551ffa572c0d Mon Sep 17 00:00:00 2001 From: Antoine Levy-Lambert Date: Mon, 1 Sep 2003 10:52:43 +0000 Subject: [PATCH] Add cygwin support in runant.pl git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275161 13f79535-47bb-0310-9956-ffa450edef68 --- src/script/runant.pl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/script/runant.pl b/src/script/runant.pl index 7a50d8f88..80fb2b10b 100644 --- a/src/script/runant.pl +++ b/src/script/runant.pl @@ -61,6 +61,8 @@ if ($^O eq "NetWare") $onnetware = 1; } +my $oncygwin = ($^O eq "cygwin"); + #ISSUE: what java wants to split up classpath varies from platform to platform #and perl is not too hot at hinting which box it is on. #here I assume ":" 'cept on win32, dos, and netware. Add extra tests here as needed. @@ -105,6 +107,17 @@ if($ENV{JIKESPATH} ne "") #construct arguments to java my @ARGS; push @ARGS, @ANT_OPTS; + +my $CYGHOME = ""; + +if ($oncygwin == 1) { + $localpath = `cygpath --path --windows $localpath`; + chomp ($localpath); + $HOME = `cygpath --path --windows $HOME`; + chomp ($HOME); + $CYGHOME = `cygpath --path --windows $ENV{HOME}`; + chomp ($CYGHOME); +} if ($onnetware == 1) { # make classpath literally $CLASSPATH; and then the contents of $localpath @@ -117,6 +130,10 @@ else push @ARGS, "-classpath", "$localpath"; } push @ARGS, "-Dant.home=$HOME"; +if ( ! $CYGHOME eq "" ) +{ + push @ARGS, "-Dcygwin.user.home=\"$CYGHOME\"" +} push @ARGS, "org.apache.tools.ant.launch.Launcher", @ANT_ARGS; push @ARGS, @ARGV;