From fe0c75c61a7f32ed21d8435f5bc7ddf0e5f65aa5 Mon Sep 17 00:00:00 2001 From: pombredanne Date: Thu, 2 Nov 2006 06:57:32 +0000 Subject: [PATCH 1/1] Added the anteclipse from farialima @ easyeclipse to drive command line builds. --- build/anteclipse | 37 +++++++++++++++++++ build/anteclipse.bat | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 132 insertions(+), 0 deletions(-) create mode 100644 build/anteclipse create mode 100644 build/anteclipse.bat diff --git a/build/anteclipse b/build/anteclipse new file mode 100644 index 0000000..9b96fde --- /dev/null +++ b/build/anteclipse @@ -0,0 +1,37 @@ +#!/bin/sh +# Copyright (c) 2003-2006 by nexB, Inc. http://www.nexb.com/ - All rights reserved. +# This software is licensed under the terms of the Open Software License version 2.1. +# A copy of the license is available at http://opensource.org/licenses/osl-2.1.php + +# Usage: Use anteclipse like you would use Ant from the command line. +# See http://ant.apache.org/manual/running.html for more details +# You must define environment variables: +# JAVA_HOME: pointing to your JDK installation +# ECLIPSE_HOME: pointing to your Eclipse installation + +# Customize those values based on your local machine capacity +JAVA_OPTS="-Xms768M -Xmx1024M" + +OS=`uname` +# Setting the windowing system and providing a workspace help avoiding problems +if [ $OS == 'Darwin' ]; then + ECLIPSE_OPTS="-ws carbon -data /tmp/ws" +elif [ $OS == 'Linux' ]; then + # TODO: verify right options for Linux + ECLIPSE_OPTS="-data /tmp/ws" +else + echo Operating System not supported: $OS + exit +fi + +if ! [ -d "$ECLIPSE_HOME" ]; then + echo No ECLIPSE_HOME environment variable defined. + exit +fi + +if ! [ -d "$JAVA_HOME" ]; then + echo No JAVA_HOME environment variable defined. + exit +fi + +$JAVA_HOME/bin/java $JAVA_OPTS -cp "$ECLIPSE_HOME/startup.jar" org.eclipse.core.launcher.Main $ECLIPSE_OPTS -application org.eclipse.ant.core.antRunner "$@" diff --git a/build/anteclipse.bat b/build/anteclipse.bat new file mode 100644 index 0000000..766505c --- /dev/null +++ b/build/anteclipse.bat @@ -0,0 +1,95 @@ +@echo OFF +@rem Copyright (c) 2003-2006 by nexB, Inc. http://www.nexb.com/ - All rights reserved. +@rem This software is licensed under the terms of the Open Software License version 2.1. +@rem A copy of the license is available at http://opensource.org/licenses/osl-2.1.php + +@rem Usage: Use anteclipse like you would use Ant from the command line. +@rem See http://ant.apache.org/manual/running.html for more details +@rem You must define environment variables: +@rem JAVA_HOME: pointing to your JDK installation +@rem ECLIPSE_HOME: pointing to your Eclipse installation. +@rem If the ECLIPSE_HOME variable is not defined the script will try to infer a location + + +@rem Customize those values based on your local machine capacity +SET VM_ARGS=-Xms512m -Xmx1024m -XX:MaxPermSize=192m + +SET ECLIPSE_JAVA="%JAVA_HOME%\bin\java" + + +@rem =============================================== +@rem Borrowed from Groovy @ codehaus.org +@rem Use explicit find.exe to prevent cygwin and others find.exe from being used +set FIND_EXE="find.exe" +if exist "%SystemRoot%\system32\find.exe" set FIND_EXE="%SystemRoot%\system32\find.exe" +if exist "%SystemRoot%\command\find.exe" set FIND_EXE="%SystemRoot%\command\find.exe" + + +@rem =============================================== +:geteclipsefromenv +@rem This clever handling of env vars is copied from Tomcat... +if not "%ECLIPSE_HOME%" == "" goto gotEclipseHome +echo The ECLIPSE_HOME environment variable is not defined correctly +echo This environment variable is needed to run this program +echo Attempting to guess an eclipse installation... + + +rem =============================================== +:geteclipsefrompde +rem Find a platform ainstall pointer in Eclipse own pde prefs +rem This file in the workspace: .metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.pde.core.prefs +rem contains the path to the platform as +rem platform_path=c\:\\ec-312\\eclipse + +set PDE_PREF_PATH="..\.metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.pde.core.prefs" +if not exist "%PDE_PREF_PATH%" goto noeclipseinpde +rem splits each line at the "=" and returns the right part, that is the second token +for /F "tokens=1* delims==" %%A IN ('TYPE %PDE_PREF_PATH% ^| %FIND_EXE% "platform_path"') DO set FOUND_PDEECLIPSE=%%B +rem removes extra \ +for /F "tokens=1* delims=:\" %%A IN ('echo %FOUND_PDEECLIPSE%') DO set CORRECTED_PDEECLIPSE=%%A:\%%B +rem removes quotes +set CORRECTED_PDEECLIPSE=%CORRECTED_PDEECLIPSE:"=% +set ECLIPSE_HOME=%CORRECTED_PDEECLIPSE% +echo An Eclipse installation was found at %ECLIPSE_HOME% +if not "%ECLIPSE_HOME%" == "" goto gotEclipseHome + + +:noeclipseinpde +echo No Eclipse installation found in PDE prefs: abandoning... + +goto end + +:gotEclipseHome +if exist "%ECLIPSE_HOME%\eclipse.exe" goto okHome +echo The ECLIPSE_HOME environment variable does not point to a valid Eclipse installation +echo Unable to find %ECLIPSE_HOME%\eclipse.exe +echo This environment variable is needed to run this program +goto end + +:okHome + + +rem This clever handling of arguments is copied from Ant itself @ apache.org... + +rem Slurp the command line arguments. This loop allows for an unlimited number +rem of arguments (up to the command line limit, anyway). +set ECLIPSE_ANT_CMD_LINE_ARGS=%1 +if ""%1""=="""" goto nextInit +shift +:setupArgs + +if ""%1""=="""" goto nextInit +set ECLIPSE_ANT_CMD_LINE_ARGS=%ECLIPSE_ANT_CMD_LINE_ARGS% %1 +shift +goto setupArgs + +:nextInit + +goto start + +:start + +%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% +:end + +rem @echo on \ No newline at end of file -- 1.7.1