You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by tk...@apache.org on 2010/10/16 17:53:30 UTC

svn commit: r1023316 - /geronimo/devtools/eclipse-plugin/trunk/eclipse/build.xml

Author: tkirby
Date: Sat Oct 16 15:53:29 2010
New Revision: 1023316

URL: http://svn.apache.org/viewvc?rev=1023316&view=rev
Log:
GERONIMODEVTOOLS-599 GERONIMODEVTOOLS-675 GERONIMODEVTOOLS-649 fix testsuite launching on mac and simplify and refactor.
fix/work-around both isMac and isUnix getting set on mac.

Modified:
    geronimo/devtools/eclipse-plugin/trunk/eclipse/build.xml

Modified: geronimo/devtools/eclipse-plugin/trunk/eclipse/build.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/eclipse/build.xml?rev=1023316&r1=1023315&r2=1023316&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/eclipse/build.xml (original)
+++ geronimo/devtools/eclipse-plugin/trunk/eclipse/build.xml Sat Oct 16 15:53:29 2010
@@ -18,15 +18,15 @@
 
 <!--
  |
- | Download eclipse artifacts and unzip them into the user's local maven repo
+ | Download eclipse_zip to ${download_to} directory and unzip them to ${extract_to} directory.
  |
  | @version $Rev$ $Date$
  -->
-<project name="EclipseArtifacts" default="doit" >
+<project name="EclipseArtifacts" default="GetEclipse" >
 
     <!-- expected input properties:
-        1. download_to   - The directory to download eclipse_zip to.
-        2. extract_to    - The directory to extract  ecslipe_zip to.
+        1. download_to   - The directory to download eclipseZip to.
+        2. extract_to    - The directory to extract  eclsipeZip to.
       -->
     <fail message="required download_to property not set.">
         <condition>
@@ -71,123 +71,128 @@
     </condition>
 
     <condition property="isUnix" >
-        <os family="unix" />
+        <and>
+            <os family="unix" />
+            <!-- MacOSX has os family of mac and unix both being true! -->
+            <not>
+                <isset property="isMac" />
+            </not>
+        </and>
     </condition>
 
     <condition property="isWindows" >
         <os family="windows" />
     </condition>
 
-    <!-- unzip or gunzip and untar?  Set properties appropriately -->
-
-    <condition property="isZip" >
-        <isset property="isWindows" />
-    </condition>
-
-    <condition property="isTarGz" >
-        <or>
-            <isset property="isMac" />
-            <isset property="isUnix" />
-        </or>
-    </condition>
+    <macrodef name="download" description="Download artifact" >
+        <attribute name="eclipseZip" />
+        <sequential>
+            <echo>#################################################################################</echo>
+            <echo>##                                                                               </echo>
+            <echo>## Downloading: @{eclipseZip}                                                    </echo>
+            <echo>##                                                                               </echo>
+            <echo>## From: ${eclipse_url}                                                          </echo>
+            <echo>##                                                                               </echo>
+            <echo>#################################################################################</echo>
+            <mkdir  dir="${download_to}" />
+            <get    src="${eclipse_url}/@{eclipseZip}${protocol}"
+                    dest="${download_to}/@{eclipseZip}"
+                    verbose="true"
+                    ignoreerrors="true"
+                    usetimestamp="true" />
+        </sequential>
+    </macrodef>
+
+    <macrodef name="wunzip" description="Unzip artifact" >
+        <attribute name="eclipseZip" />
+        <sequential>
+            <echo>#################################################################################</echo>
+            <echo>##                                                                               </echo>
+            <echo>## Unzipping: @{eclipseZip}                                                      </echo>
+            <echo>##                                                                               </echo>
+            <echo>#################################################################################</echo>
+            <delete dir="${extract_to}" quiet="true" />
+            <mkdir  dir="${extract_to}" />
+            <unzip  src="${download_to}/@{eclipseZip}"
+                    dest="${extract_to}"
+                    overwrite="true" />
+        </sequential>
+    </macrodef>
+
+    <macrodef name="untargz" description="Ungzip and Untar artifact" >
+        <attribute name="eclipseTar" />
+        <attribute name="eclipseZip" default="@{eclipseTar}.gz" />
+        <sequential>
+            <echo>#################################################################################</echo>
+            <echo>##                                                                               </echo>
+            <echo>## Gunzipping: @{eclipseZip}  Untarring: @{eclipseTar}                           </echo>
+            <echo>##                                                                               </echo>
+            <echo>#################################################################################</echo>
+            <delete dir="${extract_to}" quiet="true" />
+            <mkdir  dir="${extract_to}" />
+            <gunzip src="${download_to}/@{eclipseZip}" />
+            <untar  src="${download_to}/@{eclipseTar}"
+                    dest="${extract_to}"
+                    overwrite="true" />
+        </sequential>
+    </macrodef>
+
+    <target name="GetEclipse" >
+        <antcall target="mac" />
+        <antcall target="unix" />
+        <antcall target="windows" />
+    </target>
 
-    <!-- We will download ${eclipse_zip}, and untar ${eclipse_tar}.
-         Set ${eclipse_zip} name based on our environment (OS, 32/64 bit)
-     -->
+    <target name="mac" if="isMac" description="GetEclipse on mac" >
 
-    <condition property="eclipse_zip" value="${eclipse_basefilename}-win32.zip" >
-        <and>
-            <isset property="isWindows" />
+        <condition property="eclipseTar" value="${eclipse_basefilename}-macosx-cocoa.tar" >
             <isset property="is32bitJDK" />
-        </and>
-    </condition>
+        </condition>
 
-    <condition property="eclipse_zip" value="${eclipse_basefilename}-win32_64.zip" >
-        <and>
-            <isset property="isWindows" />
+        <condition property="eclipseTar" value="${eclipse_basefilename}-macosx-cocoa-x86_64.tar" >
             <isset property="is64bitJDK" />
-        </and>
-    </condition>
+        </condition>
 
-    <!-- ${eclipse_tar} not needed on windows, just mac and unix.
-         Set ${eclipse_zip} for them below by adding .gz
-     -->
+        <property name="eclipseZip" value="${eclipseTar}.gz" />
 
-    <condition property="eclipse_tar" value="${eclipse_basefilename}-macosx-cocoa.tar" >
-        <and>
-            <isset property="isMac" />
-            <isset property="is32bitJDK" />
-        </and>
-    </condition>
+        <download eclipseZip="${eclipseZip}" />
 
-    <condition property="eclipse_tar" value="${eclipse_basefilename}-macosx-cocoa-x86_64.tar" >
-        <and>
-            <isset property="isMac" />
-            <isset property="is64bitJDK" />
-        </and>
-    </condition>
+        <untargz  eclipseZip="${eclipseZip}" eclipseTar="${eclipseTar}" />
 
-    <condition property="eclipse_tar" value="${eclipse_basefilename}-linux-gtk.tar" >
-        <and>
-            <isset property="isUnix" />
+    </target>
+
+    <target name="unix" if="isUnix" description="GetEclipse on unix" >
+
+        <condition property="eclipseTar" value="${eclipse_basefilename}-linux-gtk.tar" >
             <isset property="is32bitJDK" />
-        </and>
-    </condition>
+        </condition>
 
-    <condition property="eclipse_tar" value="${eclipse_basefilename}-linux-gtk-x86_64.tar" >
-        <and>
-            <isset property="isUnix" />
+        <condition property="eclipseTar" value="${eclipse_basefilename}-linux-gtk-x86_64.tar" >
             <isset property="is64bitJDK" />
-        </and>
-    </condition>
+        </condition>
 
-    <!-- Set ${eclipse_zip} if needed in TarGz environment.  -->
+        <property name="eclipseZip" value="${eclipseTar}.gz" />
 
-    <condition property="eclipse_zip" value="${eclipse_tar}.gz" >
-        <isset property="isTarGz" />
-    </condition>
+        <download eclipseZip="${eclipseZip}" />
+
+        <untargz  eclipseZip="${eclipseZip}" eclipseTar="${eclipseTar}" />
 
-    <target name="doit" >
-        <antcall target="download" />
-        <antcall target="unzip"    />
-        <antcall target="untargz"  />
     </target>
 
-    <target name="download" description="Download artifact(s)" >
+    <target name="windows" if="isWindows" description="GetEclipse on windows" >
 
-        <echo>#################################################################################</echo>
-        <echo>##                                                                               </echo>
-        <echo>## Downloading: ${eclipse_zip}                                                   </echo>
-        <echo>##                                                                               </echo>
-        <echo>## From: ${eclipse_url}                                                          </echo>
-        <echo>##                                                                               </echo>
-        <echo>#################################################################################</echo>
-        <mkdir  dir="${download_to}" />
-        <get    src="${eclipse_url}/${eclipse_zip}${protocol}"
-                dest="${download_to}/${eclipse_zip}"
-                verbose="true"
-                ignoreerrors="true"
-                usetimestamp="true" />
-        <echo>#################################################################################</echo>
-        <echo>##                                                                               </echo>
-        <echo>## Unzipping: ${eclipse_zip}                                                     </echo>
-        <echo>##                                                                               </echo>
-        <echo>#################################################################################</echo>
-        <delete dir="${extract_to}" quiet="true" />
-        <mkdir  dir="${extract_to}" />
-    </target>
+        <condition property="eclipseZip" value="${eclipse_basefilename}-win32.zip" >
+            <isset property="is32bitJDK" />
+        </condition>
 
-    <target name="unzip" if="isZip" description="Unzip artifact(s)" >
-        <unzip  src="${download_to}/${eclipse_zip}"
-                dest="${extract_to}"
-                overwrite="true" />
-    </target>
+        <condition property="eclipseZip" value="${eclipse_basefilename}-win32_64.zip" >
+            <isset property="is64bitJDK" />
+        </condition>
+
+        <download eclipseZip="${eclipseZip}" />
+
+        <wunzip   eclipseZip="${eclipseZip}" />
 
-    <target name="untargz" if="isTarGz" description="Ungzip and Untar artifact(s)" >
-        <gunzip src="${download_to}/${eclipse_zip}" />
-        <untar  src="${download_to}/${eclipse_tar}"
-                dest="${extract_to}"
-                overwrite="true" />
     </target>
 
 </project>