blob: 6da7474761f15ec404c0a2ea3a2efe11da1743cd [file] [log] [blame]
<!--/*******************************************************************************
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* Ant naming conventions:
* - regardless of the actual OS platform,'/' is the directory separator
* (Ant will convert as appropriate).
* - multi-word properties use periods '.'
* - multi-word targets use hyphens '-'
* - multi-word macros use underscores '_'
* - multi-word macro attributes are concatenated
* e.g. 'runpathref'
* - multi-word tasks (taskdef) names are concatenated
* e.g. 'validateconnection'
* - OS environment variables are in ALLCAPS and have 'env' as a prefix
* e.g. ${env.XXX}.
* - Ant properties are lower case.
*
* Contributors:
* Oracle - initial API and implementation
#******************************************************************************/-->
<project name="Build Mappings Plug-in Tests" default="build.all" basedir=".">
<!-- =================================================================== -->
<target name="init">
<tstamp>
<format property="build.date" pattern="yyyyMMdd"/>
<format property="build.time" pattern="HHmm"/>
</tstamp>
<property environment="env"/>
<property name="stop.on.error" value="false"/>
<property name="optimize.code" value="off"/>
<property name="report.deprecation" value="off"/>
<property name="javac.debug" value="on"/>
<property name="javac.debuglevel" value="lines,vars,source"/>
<property name="target.jvm" value="${javac.version}"/>
<property name="_nowarn" value="on"/>
<echo message="BuildDate.BuildTime='${build.date}.${build.time}'"/>
<echo message="java.version='${java.version}'"/>
<echo message="os.name='${os.name}'"/>
<echo message="os.arch='${os.arch}'"/>
<echo message="os.version='${os.version}'"/>
<echo message="stop.on.error='${stop.on.error}'"/>
<echo message="optimize.code='${optimize.code}'"/>
<echo message="report.deprecation='${report.deprecation}'"/>
<echo message="target.jvm='${target.jvm}'"/>
<echo message="_nowarn='${_nowarn}'"/>
</target>
<!-- =================================================================== -->
<!-- =================================================================== -->
<target name="build-all" depends="compile-mappingsplugin, jar-mappingsplugin"/>
<!-- =================================================================== -->
<!-- Properties -->
<!-- =================================================================== -->
<target name="properties-init" depends="init">
<property file="build.properties"/>
<property name="build.type" value="SNAPSHOT"/>
<property name="release.designation" value="EclipseLink DeveloperBuild"/>
<property name="version.string" value="${release.version}.qualifier"/>
<mkdir dir="${_classesDestDir}"/>
<mkdir dir="${_jarDestDir}"/>
<condition property="junit.classpath.exist" >
<isset property="junit.classpath"/>
</condition>
<property name="custom.tasks.lib" value="${basedir}/../../../buildsystem/ant_customizations.jar"/>
<property name="custom.selectbundle.task.class" value="org.eclipse.persistence.buildtools.ant.taskdefs.SelectBundle"/>
<taskdef name="selectbundle" classname="${custom.selectbundle.task.class}" classpath="${custom.tasks.lib}"/>
<selectbundle basename="org.eclipse.persistence.nosql" directory="${basedir}/../../../plugins" separator="_"
criterion="[2.0.0,9.0.0)" property="oep.nosql.lib" includepath="true"
/>
<selectbundle basename="org.eclipse.persistence.oracle.nosql" directory="${basedir}/../../../plugins" separator="_"
criterion="[2.0.0,9.0.0)" property="oep.oracle.nosql.lib" includepath="true"
/>
<echo message="oep.nosql.lib ='${oep.nosql.lib}'"/>
<echo message="oep.nosql.lib ='${oep.oracle.nosql.lib}'"/>
<path id="compile.mappingsplugin.path">
<pathelement path="${_jarDestDir}/utility_test.jar"/>
<pathelement path="${_jarDestDir}/framework_test.jar"/>
<pathelement path="${_mwdevLibDir}/mappingsplugin.jar"/>
<pathelement path="${_mwdevLibDir}/framework.jar"/>
<pathelement path="${_mwdevLibDir}/uitools.jar"/>
<pathelement path="${_mwdevLibDir}/cmpmigrator.jar"/>
<pathelement path="${_mwdevLibDir}/mappingsio.jar"/>
<pathelement path="${_mwdevLibDir}/mappingsmodel.jar"/>
<pathelement path="${_mwdevLibDir}/platformsmodel.jar"/>
<pathelement path="${_mwdevLibDir}/utility.jar"/>
<pathelement path="${_eclipselinkJar}"/>
<pathelement path="${_libDir}/compile/package-rename.jar"/>
<pathelement path="${junit.lib}"/>
<pathelement path="${oep.nosql.lib}"/>
<pathelement path="${oep.oracle.nosql.lib}"/>
</path>
</target>
<!-- =================================================================== -->
<!-- Clean -->
<!-- =================================================================== -->
<target name="clean" depends="init">
<property file="build.properties"/>
<delete dir="${_classesDestDir}" includeEmptyDirs="true" quiet="true"/>
<delete file="${_jarDestDir}/${mappingsplugin.jarfile}" quiet="true"/>
<delete file="${_jarDestDir}/${mappingsplugin.jarfile.src}" quiet="true"/>
</target>
<!-- =================================================================== -->
<!-- Compile -->
<!-- =================================================================== -->
<target name="compile-mappingsplugin" depends="properties-init">
<mkdir dir="${compile.mappingsplugin.destdir}"/>
<javac
srcdir="${compile.mappingsplugin.srcdir}"
destdir="${compile.mappingsplugin.destdir}"
debug="${javac.debug}"
debuglevel="${javac.debuglevel}"
failonerror="${stop.on.error}"
encoding="UTF-8"
optimize="${optimize.code}"
deprecation="${report.deprecation}"
source="${target.jvm}"
target="${target.jvm}"
nowarn="${_nowarn}"
includes="**/*.java"
excludes="**/*&#35;*/**, **/.ade_path/**"
classpathref="compile.mappingsplugin.path"
/>
</target>
<!-- =================================================================== -->
<!-- Jar -->
<!-- =================================================================== -->
<target name="jar-mappingsplugin" depends="jar-mappingsplugin-lib, jar-mappingsplugin-src"/>
<target name="jar-mappingsplugin-lib" depends="properties-init">
<delete file="${_jarDestDir}/${mappingsplugin.jarfile}"/>
<jar jarfile="${_jarDestDir}/${mappingsplugin.jarfile}">
<manifest>
<attribute name="Specification-Title" value="EclipseLink Mappings Plug-in Tests" />
<attribute name="Specification-Vendor" value="Eclipse Project" />
<attribute name="Specification-Version" value="${release.version}" />
<attribute name="Implementation-Title" value="test.org.eclipse.persistence.workbench.mappingsplugin" />
<attribute name="Implementation-Version" value="${version.string}"/>
<attribute name="Implementation-Vendor" value="Eclipse Project" />
</manifest>
<fileset
dir="${compile.mappingsplugin.destdir}"
includes="**/*.class"
/>
</jar>
</target>
<target name="jar-mappingsplugin-src" depends="properties-init">
<delete file="${_jarDestDir}/${mappingsplugin.jarfile.src}"/>
<jar jarfile="${_jarDestDir}/${mappingsplugin.jarfile.src}">
<manifest>
<attribute name="Specification-Title" value="EclipseLink Mappings Plug-in Tests" />
<attribute name="Specification-Vendor" value="Eclipse Project" />
<attribute name="Specification-Version" value="${release.version}" />
<attribute name="Implementation-Title" value="test.org.eclipse.persistence.workbench.mappingsplugin" />
<attribute name="Implementation-Version" value="${version.string}"/>
<attribute name="Implementation-Vendor" value="Eclipse Project" />
</manifest>
<fileset
dir="${compile.mappingsplugin.srcdir}"
includes="**/*.java"
excludes="**/*&#35;*/**, **/.ade_path/**"
/>
</jar>
</target>
<!-- =================================================================== -->
<!-- JUnit tests - run this target from the master build project only. -->
<!-- =================================================================== -->
<target name="test-all" depends="test-mappingsmodel,
test-mappingsplugin,
test-mappingsio"/>
<target name="checkClasspath" depends="properties-init" unless="junit.classpath.exist">
<echo message="Run this target from the master build project only." />
<fail>Run the master build project</fail>
</target>
<target name="test-mappingsmodel" depends="checkClasspath">
<junit>
<classpath path="${junit.classpath}" />
<formatter type="brief" usefile="false" />
<test name="test.org.eclipse.persistence.workbench.mappingsmodel.AllMappingsModelTests" />
</junit>
</target>
<target name="test-mappingsplugin" depends="checkClasspath">
<junit>
<classpath path="${junit.classpath}" />
<formatter type="brief" usefile="false" />
<test name="test.org.eclipse.persistence.workbench.mappingsplugin.AllMappingsPluginTests" />
</junit>
</target>
<target name="test-mappingsio" depends="checkClasspath">
<junit>
<classpath path="${junit.classpath}" />
<formatter type="brief" usefile="false" />
<test name="test.org.eclipse.persistence.workbench.mappingsio.AllMappingsIOTests" />
</junit>
</target>
</project>