Skip to content

Commit

Permalink
Fixes a few problems with the build script and JDK versions.
Browse files Browse the repository at this point in the history
git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@481 c6a108a4-781c-0410-a6c6-c2d559e19af0
  • Loading branch information
lucboudreau committed Nov 10, 2011
1 parent 4c0f311 commit c3370ac
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 29 deletions.
38 changes: 21 additions & 17 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
-->
<project name="olap4j" basedir="." default="dist" xmlns:ivy="antlib:org.apache.ivy.ant">
<property file="${basedir}/test.properties"/>
<property name="unix.script" value="${basedir}/buildOnJdk.sh"/>
<import file="subfloor.xml" />

<property name="jar-jdk14.file"
Expand All @@ -29,32 +30,32 @@ ${src.dir}/org/olap4j/mdx/parser/impl/DefaultMdxParserSym.java" />
</target>

<condition property="jdk15.present">
<equals arg1="${ant.java.version}" arg2="1.5" />
<contains string="${java.version}" substring="1.5." />
</condition>

<condition property="jdk15.not.present">
<not>
<equals arg1="${ant.java.version}" arg2="1.5" />
<contains string="${java.version}" substring="1.5." />
</not>
</condition>

<condition property="jdk16.present">
<equals arg1="${ant.java.version}" arg2="1.6" />
<contains string="${java.version}" substring="1.6." />
</condition>

<condition property="jdk16.not.present">
<not>
<equals arg1="${ant.java.version}" arg2="1.6" />
<contains string="${java.version}" substring="1.6." />
</not>
</condition>

<condition property="jdk17.present">
<equals arg1="${ant.java.version}" arg2="1.7" />
<contains string="${java.version}" substring="1.7." />
</condition>

<condition property="jdk17.not.present">
<not>
<equals arg1="${ant.java.version}" arg2="1.7" />
<contains string="${java.version}" substring="1.7." />
</not>
</condition>

Expand Down Expand Up @@ -108,6 +109,10 @@ olap4j_api.pdf"
</tar>
</target>

<target name="compile"
depends="init, compile.pre, compileJdk15, compileJdk16, compileJdk17, compile.src_copy, compile.res_copy, compile.lic_copy, compile.post"
description="Performs all the steps to prepare the bin directory with a complete compilation" />

<target name="jar" depends="init, compile.pre, checkIsJdk15, compileJdk15, compileJdk16, compileJdk17, compile, compile-tests, set-build.id, generate.manifest"
description="Jars up the bin directory after a compile">
<zip destfile="${dist.dir}/${ivy.artifact.id}-${project.revision}.jar">
Expand Down Expand Up @@ -153,29 +158,29 @@ VERSION.txt" />
</target>

<target name="compileJdk15">
<exec osfamily="unix" executable="${basedir}/buildOnJdk.sh">
<arg line="jdk1.5 compile.compile"/>
<exec osfamily="unix" executable="${unix.script}">
<arg line="jdk1.5 -Dskip.download=true compile.compile"/>
</exec>
<exec osfamily="windows" dir="." executable="cmd">
<arg line="/c .\buildOnJdk.bat jdk1.5 compile.compile"/>
<arg line="/c .\buildOnJdk.bat jdk1.5 -Dskip.download=true compile.compile"/>
</exec>
</target>

<target name="compileJdk16">
<exec osfamily="unix" executable="${basedir}/buildOnJdk.sh">
<arg line="jdk1.6 compile.compile"/>
<exec osfamily="unix" executable="${unix.script}">
<arg line="jdk1.6 -Dskip.download=true compile.compile"/>
</exec>
<exec osfamily="windows" dir="." executable="cmd">
<arg line="/c .\buildOnJdk.bat jdk1.6 compile.compile"/>
<arg line="/c .\buildOnJdk.bat jdk1.6 -Dskip.download=true compile.compile"/>
</exec>
</target>

<target name="compileJdk17">
<exec osfamily="unix" executable="${basedir}/buildOnJdk.sh">
<arg line="jdk1.7 compile.compile"/>
<exec osfamily="unix" executable="${unix.script}">
<arg line="jdk1.7 -Dskip.download=true compile.compile"/>
</exec>
<exec osfamily="windows" dir="." executable="cmd">
<arg line="/c .\buildOnJdk.bat jdk1.7 compile.compile"/>
<arg line="/c .\buildOnJdk.bat jdk1.7 -Dskip.download=true compile.compile"/>
</exec>
</target>

Expand Down Expand Up @@ -320,8 +325,7 @@ class XmlaOlap4jDriverVersion {
<!-- override compile task to account for special jdk handling -->
<target name="compile.compile">
<javac destdir="${classes.dir}" debug="${javac.debug}"
deprecation="${javac.deprecation}" fork="true" source="${javac.source}"
target="${javac.target}">
deprecation="${javac.deprecation}" fork="true">
<classpath>
<path refid="classpath" />
</classpath>
Expand Down
68 changes: 58 additions & 10 deletions buildOnJdk.bat
Original file line number Diff line number Diff line change
@@ -1,17 +1,65 @@
@echo off
rem $Id: buildJdk16.bat 207 2009-05-05 14:58:00Z lucboudreau $
rem Called recursively from 'ant release' to build the files which can only be
rem built under JDK 1.6.
rem $Id: //open/mondrian/buildOnJdk.bat#2 $

rem **** This program takes 1 argument and a series of other arguments to pass to Ant.
rem **** - buildOnJdk.bat [jdk version] [ant arguments]

rem **** The value of [jdk version] must be one of:
rem **** - jdk1.5
rem **** - jdk1.6
rem **** - jdk1.7

rem **** It assumes the following environment variables are set.
rem **** - JAVA_HOME_15: Home directory of a JDK 1.5.X.
rem **** - JAVA_HOME_16: Home directory of a JDK 1.6.X.
rem **** - JAVA_HOME_17: Home directory of a JDK 1.7.X.

rem **** It also assumes that Ant is on the classpath.

rem =============================================================================
rem ===== You can set some environment variables right here if needed ===========

rem Change the following line to point to your JDK 1.5 home.
set JAVA_HOME_15=C:\apps\java\jdk1.5.0_22

rem Change the following line to point to your JDK 1.6 home.
set JAVA_HOME=C:\jdk1.6.0_11
rem set JAVA_HOME=C:\java\jdk1.6.0_13
set JAVA_HOME_16=C:\apps\java\jdk1.6.0_27

rem Change the following line to point to your JDK 1.7 home.
set JAVA_HOME_17=C:\apps\java\jdk1.7.0_01

rem Change the following line to point to your ant home.
set ANT_HOME=C:\open\thirdparty\ant
rem set ANT_HOME=C:\ant\ant-1.7.0
rem set ANT_HOME=C:\apps\ant\1.7.1
rem set ANT_HOME=C:\apps\ant\1.8.1

rem ======================================================
rem ===== Don't touch anything below this line ===========

if %1==jdk1.5 (
set JAVA_HOME=%JAVA_HOME_15%
)
if %1==jdk1.6 (
set JAVA_HOME=%JAVA_HOME_16%
)
if %1==jdk1.7 (
set JAVA_HOME=%JAVA_HOME_17%
)

set ANT_ARGUMENTS=
for %%A in (%*) do (
set ANT_ARGUMENTS=%ANT_ARGUMENTS% %%A
)

rem We set JAVACMD for the benefit of Ant.
set JAVACMD=%JAVA_HOME%\bin\java.exe

rem Some debug info
echo Using ANT_HOME: %ANT_HOME%
echo Using JAVA_HOME: %JAVA_HOME%
echo Using JAVACMD: %JAVACMD%
echo Using Ant arguments: %ANT_ARGUMENTS%

ant %ANT_ARGUMENTS%

set PATH=%JAVA_HOME%\bin;%PATH%
%ANT_HOME%\bin\ant compile.compile
rem End buildJdk16.bat

# End buildJdk16.bat
8 changes: 6 additions & 2 deletions buildOnJdk.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $Id: //open/mondrian/buildJdk16.sh#3 $
# $Id: //open/mondrian/buildOnJdk.sh#2 $
# Called recursively from 'ant release' to build the files which can only be
# built under a particular JDK version.
#
Expand All @@ -22,6 +22,10 @@ if [ ! -d "$JAVA_HOME" ]; then
fi

export PATH=$JAVA_HOME/bin:$PATH
ant -Dskip.download=true "$@"

echo Using JAVA_HOME: $JAVA_HOME
echo Using Ant arguments: $@

ant "$@"

# End buildOnJdk.sh

0 comments on commit c3370ac

Please sign in to comment.