After thouroughly customizing build.bat for my configuration for already
third time, I made the Jetspeed build files a little bit more
intelligent (taking the example from Turbine build files).

Besides build.bat, I also updated build.sh and build-cygnus.sh; however,
I could only test build.bat on my machine, so the feedback on the two
other files is very welcome.

Changes should be quite self explanatory, so I won't cover them in
detail here.

The diffs are below and the files are also available on
http://nemecec.one.lv/dev/.
(The build.bat had again CRCRLF in the end of each line, so I had to
make a diff without my CVS client and combine it afterwards. Can
somebody please do something about these CR's...)

Index: build.xml
===================================================================
RCS file: /products/cvs/jetspeed/jetspeed/build/build.xml,v
retrieving revision 1.57
diff -r1.57 build.xml
5c5
<   <property name="build.compiler" value="jikes"/>
---
>   <property name="build.compiler" value="${JAVAC}"/>


Index: build.sh
===================================================================
RCS file: /products/cvs/jetspeed/jetspeed/build/build.sh,v
retrieving revision 1.7
diff -r1.7 build.sh
29a30,39
> # -------------------------------------------------------------------
> # Set your java compiler. Possible values are:
> # classic - standard SUN compiler (javac)
> # jikes   - Jikes
> #
> # Get Jikes from here...
> # http://oss.software.ibm.com/developerworks/opensource/jikes/project
> # -------------------------------------------------------------------
> JAVAC=classic
> 
32a43,49
> if test -z "${JAVA_HOME}" ; then
>     echo "ERROR: JAVA_HOME not found in your environment."
>     echo "Please, set the JAVA_HOME variable in your environment to
match the"
>     echo "location of the Java Virtual Machine you want to use."
>     exit
> fi
> 
34c51
< TARGET=dist
---
>     TARGET=dist
37c54,62
<
CP=${CLASSPATH}:${JSDK}:${ECS}:${TURBINE}:${COCOON}:${CASTOR}:${VILLAGE}
:${XALAN}:${XERCES}:ant.jar:projectx-tr2.jar
---
> if test -f ${JAVA_HOME}/lib/tools.jar ; then
>     CLASSPATH=${CLASSPATH}:${JAVA_HOME}/lib/tools.jar
> fi
> 
> echo "JAVAC = ${JAVAC}"
> 
> echo "Now building ${TARGET}..."
> 
>
CP=${CLASSPATH}:${JSDK}:${ECS}:${TURBINE}:${COCOON}:${CASTOR}:${VILLAGE}
:${XALAN}:${XERCES}:${JIKES}:ant.jar:projectx-tr2.jar
41c66
< java -classpath ${CP} org.apache.tools.ant.Main -buildfile
${BUILDFILE} ${TARGET}
---
> ${JAVA_HOME}/bin/java -classpath ${CP} -DJAVAC=${JAVAC}
org.apache.tools.ant.Main -buildfile ${BUILDFILE} ${TARGET}


Index: build-cygnus.sh
===================================================================
RCS file: /products/cvs/jetspeed/jetspeed/build/build-cygnus.sh,v
retrieving revision 1.4
diff -r1.4 build-cygnus.sh
29a30,39
> # -------------------------------------------------------------------
> # Set your java compiler. Possible values are:
> # "classic" - standard SUN compiler (javac)
> # "jikes"   - Jikes
> #
> # Get Jikes from here...
> # http://oss.software.ibm.com/developerworks/opensource/jikes/project
> # -------------------------------------------------------------------
> JAVAC="classic"
> 
32a43,49
> if test -z "${JAVA_HOME}" ; then
>     echo "ERROR: JAVA_HOME not found in your environment."
>     echo "Please, set the JAVA_HOME variable in your environment to
match the"
>     echo "location of the Java Virtual Machine you want to use."
>     exit
> fi
> 
34c51
< TARGET=dist
---
>     TARGET="dist"
37c54,62
<
CP="${CLASSPATH};${JSDK};${ECS};${TURBINE};${COCOON};${CASTOR};${VILLAGE
};${XALAN};${XERCES};ant.jar;projectx-tr2.jar"
---
> if test -f ${JAVA_HOME}/lib/tools.jar ; then
>     CLASSPATH="${CLASSPATH}:${JAVA_HOME}/lib/tools.jar"
> fi
> 
> echo "JAVAC = ${JAVAC}"
> 
> echo "Now building ${TARGET}..."
> 
>
CP="${CLASSPATH};${JSDK};${ECS};${TURBINE};${COCOON};${CASTOR};${VILLAGE
};${XALAN};${XERCES};${JIKES};ant.jar;projectx-tr2.jar"
41c66
< java -classpath ${CP} org.apache.tools.ant.Main -buildfile
${BUILDFILE} ${TARGET}
---
> ${JAVA_HOME}/bin/java -classpath ${CP} -DJAVAC=${JAVAC}
org.apache.tools.ant.Main -buildfile ${BUILDFILE} ${TARGET}


Index: build.bat
===================================================================
RCS file: /products/cvs/jetspeed/jetspeed/build/build.bat,v
retrieving revision 1.6
diff -r1.6 build.bat
1c1,2
< @echo off
---
> @echo off
> 
31a33,42
> REM
-------------------------------------------------------------------
> REM Set your java compiler. Possible values are:
> REM classic - standard SUN compiler (javac)
> REM jikes   - Jikes
> REM
> REM Get Jikes from here...
> REM
http://oss.software.ibm.com/developerworks/opensource/jikes/project
> REM
-------------------------------------------------------------------
> set JAVAC=classic
> 
40c51
< set TARGET=core
---
> set TARGET=dist
43a55,60
> set BUILDFILE=build.xml
> 
> if "%JAVA_HOME%" == "" goto javahomeerror
> if exist %JAVA_HOME%\lib\tools.jar set
CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar
> 
> echo JAVAC = %JAVAC%
46c63
< set
CP=%JSDK%;%ECS%;%TURBINE%;%COCOON%;%CASTOR%;%VILLAGE%;%XALAN%;%XERCES%;a
nt.jar;projectx-tr2.jar;javac.jar
---
> set
CP=%CLASSPATH%;%JSDK%;%ECS%;%TURBINE%;%COCOON%;%CASTOR%;%VILLAGE%;%XALAN
%;%XERCES%;%JIKES%;ant.jar;projectx-tr2.jar;
48c65,70
< set BUILDFILE=build.xml
---
> echo Classpath: %CP%
> echo JAVA_HOME: %JAVA_HOME%
> 
> %JAVA_HOME%\bin\java.exe -classpath "%CP%" -DJAVAC=%JAVAC%
org.apache.tools.ant.Main -buildfile %BUILDFILE% %TARGET%
> 
> goto end
50c72,76
< echo "Classpath: %CP%"
---
> REM -----------ERROR-------------
> :javahomeerror
> echo "ERROR: JAVA_HOME not found in your environment."
> echo "Please, set the JAVA_HOME variable in your environment to match
the"
> echo "location of the Java Virtual Machine you want to use."
52c78
< java -classpath %CP% org.apache.tools.ant.Main -buildfile %BUILDFILE%
%TARGET%
---
> :end


--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to