2 @rem Copyright (c) 2003-2006 by nexB, Inc. http://www.nexb.com/ - All rights reserved.
3 @rem This software is licensed under the terms of the Open Software License version 2.1.
4 @rem A copy of the license is available at http://opensource.org/licenses/osl-2.1.php
6 @rem Usage: Use anteclipse like you would use Ant from the command line.
7 @rem See http://ant.apache.org/manual/running.html for more details
8 @rem You must define environment variables:
9 @rem JAVA_HOME: pointing to your JDK installation
10 @rem ECLIPSE_HOME: pointing to your Eclipse installation.
11 @rem If the ECLIPSE_HOME variable is not defined the script will try to infer a location
14 @rem Customize those values based on your local machine capacity
15 SET VM_ARGS=-Xms512m -Xmx1024m -XX:MaxPermSize=192m
17 SET ECLIPSE_JAVA="%JAVA_HOME%\bin\java"
20 @rem ===============================================
21 @rem Borrowed from Groovy @ codehaus.org
22 @rem Use explicit find.exe to prevent cygwin and others find.exe from being used
23 set FIND_EXE="find.exe"
24 if exist "%SystemRoot%\system32\find.exe" set FIND_EXE="%SystemRoot%\system32\find.exe"
25 if exist "%SystemRoot%\command\find.exe" set FIND_EXE="%SystemRoot%\command\find.exe"
28 @rem ===============================================
30 @rem This clever handling of env vars is copied from Tomcat...
31 if not "%ECLIPSE_HOME%" == "" goto gotEclipseHome
32 echo The ECLIPSE_HOME environment variable is not defined correctly
33 echo This environment variable is needed to run this program
34 echo Attempting to guess an eclipse installation...
37 rem ===============================================
39 rem Find a platform ainstall pointer in Eclipse own pde prefs
40 rem This file in the workspace: .metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.pde.core.prefs
41 rem contains the path to the platform as
42 rem platform_path=c\:\\ec-312\\eclipse
44 set PDE_PREF_PATH="..\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.pde.core.prefs"
45 if not exist "%PDE_PREF_PATH%" goto noeclipseinpde
46 rem splits each line at the "=" and returns the right part, that is the second token
47 for /F "tokens=1* delims==" %%A IN ('TYPE %PDE_PREF_PATH% ^| %FIND_EXE% "platform_path"') DO set FOUND_PDEECLIPSE=%%B
49 for /F "tokens=1* delims=:\" %%A IN ('echo %FOUND_PDEECLIPSE%') DO set CORRECTED_PDEECLIPSE=%%A:\%%B
51 set CORRECTED_PDEECLIPSE=%CORRECTED_PDEECLIPSE:"=%
52 set ECLIPSE_HOME=%CORRECTED_PDEECLIPSE%
53 echo An Eclipse installation was found at %ECLIPSE_HOME%
54 if not "%ECLIPSE_HOME%" == "" goto gotEclipseHome
58 echo No Eclipse installation found in PDE prefs: abandoning...
63 if exist "%ECLIPSE_HOME%\eclipse.exe" goto okHome
64 echo The ECLIPSE_HOME environment variable does not point to a valid Eclipse installation
65 echo Unable to find %ECLIPSE_HOME%\eclipse.exe
66 echo This environment variable is needed to run this program
72 rem This clever handling of arguments is copied from Ant itself @ apache.org...
74 rem Slurp the command line arguments. This loop allows for an unlimited number
75 rem of arguments (up to the command line limit, anyway).
76 set ECLIPSE_ANT_CMD_LINE_ARGS=%1
77 if ""%1""=="""" goto nextInit
81 if ""%1""=="""" goto nextInit
82 set ECLIPSE_ANT_CMD_LINE_ARGS=%ECLIPSE_ANT_CMD_LINE_ARGS% %1
92 %ECLIPSE_JAVA% %VM_ARGS% -cp %ECLIPSE_HOME%\startup.jar org.eclipse.core.launcher.Main -vm %ECLIPSE_JAVA% -application org.eclipse.ant.core.antRunner %ECLIPSE_ANT_CMD_LINE_ARGS%