[jboss-cvs] JBossAS SVN: r91007 - trunk/build.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jul 9 10:39:26 EDT 2009


Author: pgier
Date: 2009-07-09 10:39:25 -0400 (Thu, 09 Jul 2009)
New Revision: 91007

Modified:
   trunk/build/build.bat
   trunk/build/build.sh
Log:
Change build scripts to point to Maven.

Modified: trunk/build/build.bat
===================================================================
--- trunk/build/build.bat	2009-07-09 14:36:34 UTC (rev 91006)
+++ trunk/build/build.bat	2009-07-09 14:39:25 UTC (rev 91007)
@@ -1,19 +1,23 @@
 @echo off
-
 REM  ======================================================================
 REM
 REM  This is the main entry point for the build system.
 REM
-REM  Users should be sure to execute this file rather than 'ant' to ensure
+REM  Users should be sure to execute this file rather than 'mvn' to ensure
 REM  the correct version is being used with the correct configuration.
 REM
 REM  ======================================================================
 REM
 REM $Id$
+REM
+REM Authors:
+REM     Jason Dillon <jason at planet57.com>
+REM     Sacha Labourey <sacha.labourey at cogito-info.ch>
+REM
 
 REM ******************************************************
-REM Ignore the ANT_HOME variable: we want to use *our*
-REM ANT version and associated JARs.
+REM Ignore the MAVEN_HOME variable: we want to use *our*
+REM Maven version and associated JARs.
 REM ******************************************************
 REM Ignore the users classpath, cause it might mess
 REM things up
@@ -21,66 +25,52 @@
 
 SETLOCAL
 
-set NOPAUSE=true
 set CLASSPATH=
-set ANT_HOME=
+set MAVEN_HOME=
 
-set ANT_OPTS=-Xmx256m -Dbuild.script=build.bat
-
 REM ******************************************************
 REM - "for" loops have been unrolled for compatibility
 REM   with some WIN32 systems.
 REM ******************************************************
 
-set NAMES=tools;tools\ant;tools\apache\ant
+set NAMES=tools;tools\maven;tools\apache\maven
 set SUBFOLDERS=..;..\..;..\..\..;..\..\..\..
 
 REM ******************************************************
-REM ********Save the command line arguments***************
 REM ******************************************************
-set BUILD_ARGS=%1
-if ""%1""=="""" goto completedArgs
-shift
-:processArg
-if ""%1""=="""" goto completedArgs
-set BUILD_ARGS=%BUILD_ARGS% %1
-shift
-goto processArg
 
-:completedArgs
-
-REM ******************************************************
-REM ******************************************************
-
 SET EXECUTED=FALSE
-for %%i in (%NAMES%) do call :subLoop %%i %BUILD_ARGS%
+for %%i in (%NAMES%) do call :subLoop %%i %1 %2 %3 %4 %5 %6
 
 goto :EOF
 
+
 REM ******************************************************
 REM ********* Search for names in the subfolders *********
 REM ******************************************************
 
 :subLoop
-for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\ant.bat %BUILD_ARGS%
+for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\mvn.bat %2 %3 %4 %5 %6 %7
 
 goto :EOF
 
+
 REM ******************************************************
-REM ************ Test if ANT Batch file exists ***********
+REM ************ Test if Maven Batch file exists ***********
 REM ******************************************************
 
 :testIfExists
-if exist %1 call :BatchFound %1 %BUILD_ARGS%
+if exist %1 call :BatchFound %1 %2 %3 %4 %5 %6 %7 %8
 
 goto :EOF
 
+
 REM ******************************************************
 REM ************** Batch file has been found *************
 REM ******************************************************
 
 :BatchFound
-if (%EXECUTED%)==(FALSE) call :ExecuteBatch %1 %BUILD_ARGS%
+if (%EXECUTED%)==(FALSE) call :ExecuteBatch %1 %2 %3 %4 %5 %6 %7 %8
 set EXECUTED=TRUE
 
 goto :EOF
@@ -90,10 +80,11 @@
 REM ******************************************************
 
 :ExecuteBatch
-echo Calling %1 %BUILD_ARGS%
-call %1 %BUILD_ARGS%
+echo Calling %1 %2 %3 %4 %5 %6 %7 %8
+set GOAL=%2
+if "%GOAL%"=="" set GOAL=install
+call %1 %GOAL% %3 %4 %5 %6 %7 %8
 
 :end
 
 if "%NOPAUSE%" == "" pause
-

Modified: trunk/build/build.sh
===================================================================
--- trunk/build/build.sh	2009-07-09 14:36:34 UTC (rev 91006)
+++ trunk/build/build.sh	2009-07-09 14:39:25 UTC (rev 91007)
@@ -3,7 +3,7 @@
 ##                                                                          ##
 ##  This is the main entry point for the build system.                      ##
 ##                                                                          ##
-##  Users should be sure to execute this file rather than 'ant' to ensure   ##
+##  Users should execute this file rather than 'mvn' to ensure              ##
 ##  the correct version is being used with the correct configuration.       ##
 ##                                                                          ##
 ### ====================================================================== ###
@@ -15,21 +15,18 @@
 GREP="grep"
 ROOT="/"
 
-# Ignore user's ANT_HOME if it is set
-ANT_HOME=""
+# Ignore user's MAVEN_HOME if it is set
+MAVEN_HOME=""
 
-# the default search path for ant
-ANT_SEARCH_PATH="\
+# the default search path for maven
+MAVEN_SEARCH_PATH="\
     tools
-    tools/ant \
-    tools/apache/ant \
-    ant"
+    tools/maven \
+    tools/apache/maven \
+    maven"
 
-# the default build file name
-ANT_BUILD_FILE="build.xml"
-
 # the default arguments
-ANT_OPTIONS="--noconfig -find $ANT_BUILD_FILE"
+MVN_OPTIONS=""
 
 # Use the maximum available, or set MAX_FD != -1 to use that
 MAX_FD="maximum"
@@ -76,11 +73,11 @@
 search() {
     search="$*"
     for d in $search; do
-	ANT_HOME="`pwd`/$d"
-	ANT="$ANT_HOME/bin/ant"
-	if [ -x "$ANT" ]; then
+	MAVEN_HOME="`pwd`/$d"
+	MVN="$MAVEN_HOME/bin/mvn"
+	if [ -x "$MVN" ]; then
 	    # found one
-	    echo $ANT_HOME
+	    echo $MAVEN_HOME
 	    break
 	fi
     done
@@ -112,17 +109,17 @@
     fi
 
     # try the search path
-    ANT_HOME=`search $ANT_SEARCH_PATH`
+    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 
     # try looking up to root
-    if [ "x$ANT_HOME" = "x" ]; then
+    if [ "x$MAVEN_HOME" = "x" ]; then
 	target="build"
 	_cwd=`pwd`
 
-	while [ "x$ANT_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
+	while [ "x$MAVEN_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
 	    cd ..
 	    cwd=`pwd`
-	    ANT_HOME=`search $ANT_SEARCH_PATH`
+	    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 	done
 
 	# make sure we get back
@@ -134,34 +131,40 @@
 
 	# complain if we did not find anything
 	if [ "$found" != "true" ]; then
-	    die "Could not locate Ant; check \$ANT or \$ANT_HOME."
+	    die "Could not locate Maven; check \$MVN or \$MAVEN_HOME."
 	fi
     fi
 
     # make sure we have one
-    ANT=$ANT_HOME/bin/ant
-    if [ ! -x "$ANT" ]; then
-	die "Ant file is not executable: $ANT"
+    MVN=$MAVEN_HOME/bin/mvn
+    if [ ! -x "$MVN" ]; then
+	die "Maven file is not executable: $MVN"
     fi
 
-    # Set the max memory to 256m
-    ANT_OPTS=-Xmx256m
+    # need to specify planet57/buildmagic protocol handler package
+    MVN_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
 
     # setup some build properties
-    ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
+    MVN_OPTS="$MVN_OPTS -Dbuild.script=$0"
 
     # change to the directory where the script lives so users are not forced
     # to be in the same directory as build.xml
     cd $DIRNAME
 
-    # export some stuff for ant
-    export ANT ANT_HOME ANT_OPTS
+    MVN_GOAL=$@
+    if [ -z "$MVN_GOAL" ]; then
+      MVN_GOAL="install"
+    fi
+    
+    # export some stuff for maven
+    export MVN MAVEN_HOME MVN_OPTS MVN_GOAL
 
+    
     # execute in debug mode, or simply execute
-    if [ "x$ANT_DEBUG" != "x" ]; then
-	/bin/sh -x $ANT $ANT_OPTIONS "$@"
+    if [ "x$MVN_DEBUG" != "x" ]; then
+	  /bin/sh -x $MVN $MVN_OPTIONS $MVN_GOAL
     else
-	exec $ANT $ANT_OPTIONS "$@"
+	  exec $MVN $MVN_OPTIONS $MVN_GOAL
     fi
 }
 




More information about the jboss-cvs-commits mailing list