| <!--/******************************************************************************* | |
| * 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 concatinated | |
| * e.g. 'runpathref' | |
| * - multi-word tasks (taskdef) names are concatinated | |
| * 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 SC Plug-in Tests" default="build.all" basedir="."> | |
| <!-- =================================================================== --> | |
| <target name="init"> | |
| <tstamp> | |
| <format property="build.date" pattern="yyMMdd"/> | |
| <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="target.jvm" value="${javac.version}"/> | |
| <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}'"/> | |
| </target> | |
| <!-- =================================================================== --> | |
| <!-- =================================================================== --> | |
| <target name="set-release" unless="debug" depends="init"> | |
| <property name="debug.postfix" value=""/> | |
| <property name="debug.level" value="lines,source"/> | |
| <property name="debug.set" value="true"/> | |
| <echo message="debug.level='${debug.level}'"/> | |
| <echo message="debug.set='${debug.set}'"/> | |
| <echo message="debug.postfix='${debug.postfix}'"/> | |
| </target> | |
| <target name="set-debug" if="debug" depends="set-release"> | |
| <property name="debug.postfix" value="debug"/> | |
| <property name="debug.level" value="lines,vars,source"/> | |
| <echo message="debug.level='${debug.level}'"/> | |
| <echo message="debug.set not defined."/> | |
| <echo message="debug.postfix='${debug.postfix}'"/> | |
| </target> | |
| <!-- =================================================================== --> | |
| <!-- =================================================================== --> | |
| <target name="build-all" depends="compile-scplugin, jar-scplugin"/> | |
| <!-- =================================================================== --> | |
| <!-- Properties --> | |
| <!-- =================================================================== --> | |
| <target name="properties-init" depends="set-debug"> | |
| <property file="build.properties"/> | |
| <mkdir dir="${_classesDestDir}"/> | |
| <mkdir dir="${_jarDestDir}"/> | |
| <condition property="junit.classpath.exist" > | |
| <isset property="junit.classpath"/> | |
| </condition> | |
| </target> | |
| <!-- =================================================================== --> | |
| <!-- Clean --> | |
| <!-- =================================================================== --> | |
| <target name="clean" depends="set-debug"> | |
| <property file="build.properties"/> | |
| <delete dir="${_classesDestDir}" includeEmptyDirs="true" quiet="true"/> | |
| <delete file="${_jarDestDir}/${scplugin.jarfile}" quiet="true"/> | |
| </target> | |
| <!-- =================================================================== --> | |
| <!-- Compile --> | |
| <!-- =================================================================== --> | |
| <target name="compile-scplugin" depends="properties-init"> | |
| <mkdir dir="${compile.scplugin.destdir}"/> | |
| <javac | |
| classpath="${compile.scplugin.classpath}" | |
| srcdir="${compile.scplugin.srcdir}" | |
| destdir="${compile.scplugin.destdir}" | |
| debug="${javac.debug}" | |
| debuglevel="${debug.level}" | |
| failonerror="${stop.on.error}" | |
| optimize="${optimize.code}" | |
| deprecation="${report.deprecation}" | |
| target="${target.jvm}" | |
| includes="**/*.java" | |
| excludes="**/*#*/**, **/.ade_path/**" | |
| /> | |
| </target> | |
| <!-- =================================================================== --> | |
| <!-- Jar --> | |
| <!-- =================================================================== --> | |
| <target name="jar-scplugin" depends="jar-scplugin-lib, jar-scplugin-src"/> | |
| <target name="jar-scplugin-lib" if="debug.set" depends="properties-init"> | |
| <delete file="${_jarDestDir}/${scplugin.jarfile}"/> | |
| <jar jarfile="${_jarDestDir}/${scplugin.jarfile}"> | |
| <manifest> | |
| <attribute name="Specification-Title" value="EclipseLink SC Plug-in Tests" /> | |
| <attribute name="Specification-Vendor" value="Eclipse Project" /> | |
| <attribute name="Specification-Version" value="${_VersionStamp}" /> | |
| <attribute name="Implementation-Title" value="test.org.eclipse.persistence.workbench.scplugin" /> | |
| <attribute name="Implementation-Version" value="${_VersionStamp}.${_buildNumber}" /> | |
| <attribute name="Implementation-Vendor" value="Eclipse Project" /> | |
| </manifest> | |
| <fileset | |
| dir="${compile.scplugin.destdir}" | |
| includes="**/*.class" | |
| /> | |
| </jar> | |
| </target> | |
| <target name="jar-scplugin-src" unless="debug.set" depends="properties-init"> | |
| <delete file="${_jarDestDir}/${scplugin.jarfile}"/> | |
| <jar jarfile="${_jarDestDir}/${scplugin.jarfile}"> | |
| <manifest> | |
| <attribute name="Specification-Title" value="EclipseLink SC Plug-in Tests" /> | |
| <attribute name="Specification-Vendor" value="Eclipse Project" /> | |
| <attribute name="Specification-Version" value="${_VersionStamp}" /> | |
| <attribute name="Implementation-Title" value="test.org.eclipse.persistence.workbench.scplugin" /> | |
| <attribute name="Implementation-Version" value="${_VersionStamp}.${_buildNumber}" /> | |
| <attribute name="Implementation-Vendor" value="Eclipse Project" /> | |
| </manifest> | |
| <fileset | |
| dir="${compile.scplugin.destdir}" | |
| includes="**/*.class" | |
| /> | |
| <fileset | |
| dir="${compile.scplugin.srcdir}" | |
| includes="**/*.java" | |
| excludes="**/*#*/**, **/.ade_path/**" | |
| /> | |
| </jar> | |
| </target> | |
| <!-- =================================================================== --> | |
| <!-- JUnit tests - run this target from the master build project only. --> | |
| <!-- =================================================================== --> | |
| <target name="checkClasspath" depends="properties-init" unless="junit.classpath.exist"> | |
| <echo message="Run the test-all target from the master build project only." /> | |
| <fail>Run the master build project</fail> | |
| </target> | |
| <target name="test-all" depends="checkClasspath"> | |
| <junit> | |
| <classpath path="${junit.classpath}" /> | |
| <formatter type="brief" usefile="false" /> | |
| <test name="test.org.eclipse.persistence.workbench.scplugin.AllSCTests" /> | |
| </junit> | |
| </target> | |
| </project> |