From 3b2b084af9643c6506f65c7a5278cf60439790ff Mon Sep 17 00:00:00 2001 From: "Ryan R. LaMothe" <Ryan.LaMothe@pnnl.gov> Date: Sat, 27 Sep 2014 19:33:14 -0700 Subject: [PATCH] Minor adjustments to support Git --- test/codegen/.classpath | 26 +++---- test/codegen/.gitignore | 3 + test/codegen/build.xml | 148 +++++++++++++++++------------------- test/codegen/src/.gitignore | 1 + 4 files changed, 87 insertions(+), 91 deletions(-) create mode 100644 test/codegen/.gitignore create mode 100644 test/codegen/src/.gitignore diff --git a/test/codegen/.classpath b/test/codegen/.classpath index 935e0115..974f5c8a 100644 --- a/test/codegen/.classpath +++ b/test/codegen/.classpath @@ -1,13 +1,13 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="src" path="src/java"/> - <classpathentry kind="src" path="src/genjava"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/> - <classpathentry kind="lib" path="/com.amd.aparapi/dist/aparapi.jar" sourcepath="/com.amd.aparapi"> - <attributes> - <attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="com.amd.aparapi.jni/dist"/> - </attributes> - </classpathentry> - <classpathentry kind="output" path="classes"/> -</classpath> +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src/java"/> + <classpathentry kind="src" path="src/genjava"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="lib" path="/com.amd.aparapi/dist/aparapi.jar" sourcepath="/com.amd.aparapi"> + <attributes> + <attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="com.amd.aparapi.jni/dist"/> + </attributes> + </classpathentry> + <classpathentry kind="lib" path=".libs/junit-4.10.jar"/> + <classpathentry kind="output" path="classes"/> +</classpath> diff --git a/test/codegen/.gitignore b/test/codegen/.gitignore new file mode 100644 index 00000000..c59924d5 --- /dev/null +++ b/test/codegen/.gitignore @@ -0,0 +1,3 @@ +/.libs/ +/classes/ +/junit/ diff --git a/test/codegen/build.xml b/test/codegen/build.xml index 7af1dceb..c41e58c8 100644 --- a/test/codegen/build.xml +++ b/test/codegen/build.xml @@ -1,93 +1,85 @@ <?xml version="1.0"?> -<project name="codegen" default="junit" basedir="."> +<project name="test-codegen" default="junit" basedir="."> - <!-- + <!-- USER CONFIGURABLE PROPERTIES - --> - <property name="junit.jar.version" value="4.10"/> - <property name="junit.jar.name" value="junit-${junit.jar.version}.jar"/> - <property name="junit.home" value="${basedir}/.libs"/> - <property name="junit.base.url" value="http://repo1.maven.org/maven2/junit/junit"/> - - <!-- + --> + <property name="junit.jar.version" value="4.10" /> + <property name="junit.jar.name" value="junit-${junit.jar.version}.jar" /> + <property name="junit.home" value="${basedir}/.libs" /> + <property name="junit.base.url" value="http://repo1.maven.org/maven2/junit/junit" /> + + <!-- DO NOT EDIT BELOW THIS LINE --> - <echo>OS Name: ${os.name}</echo> - <echo>OS Version: ${os.version}</echo> - <echo>OS Arch: ${os.arch}</echo> + <echo>OS Name: ${os.name}</echo> + <echo>OS Version: ${os.version}</echo> + <echo>OS Arch: ${os.arch}</echo> + + <!-- Ideally this would be the latest version of Java but not everyone is going to have it installed --> + <!-- Additionally we want to avoid "Class not found: javac1.8" errors from old Ant versions (i.e. Eclipse) --> + <property name="build.compiler" value="javac1.7" /> + <property name="ant.build.javac.source" value="1.7" /> + <property name="ant.build.javac.target" value="1.7" /> - <property name="build.compiler" value="javac1.6"/> - <property name="ant.build.javac.source" value="1.6"/> - <property name="ant.build.javac.target" value="1.6"/> - - <available property="junit.installed" file="${junit.home}/${junit.jar.name}"/> + <available property="junit.installed" file="${junit.home}/${junit.jar.name}" /> + + <target name="install.deps" unless="junit.installed"> + <mkdir dir="${junit.home}" /> + <!-- Cleanup all existing JUnit installations --> + <delete failonerror="false" includeEmptyDirs="true"> + <fileset dir="${junit.home}" includes="junit*/" /> + </delete> + <!-- Download and unzip requested JUnit version --> + <get src="${junit.base.url}/${junit.jar.version}/${junit.jar.name}" dest="${junit.home}" /> + </target> - <target name="install.junit" unless="junit.installed"> - <mkdir dir="${junit.home}"/> - <!-- Cleanup all existing JUnit installations --> - <delete failonerror="false" includeEmptyDirs="true"> - <fileset dir="${junit.home}" includes="junit*/"/> - </delete> - <!-- Download and unzip requested JUnit version --> - <get src="${junit.base.url}/${junit.jar.version}/${junit.jar.name}" dest="${junit.home}"/> + <target name="clean"> + <delete dir="classes" /> + <delete dir="junit" /> + <delete dir="src/genjava/com" /> + <!-- Legacy cleanup --> + <delete file="junit*.jar" /> </target> - - <target name="clean"> - <delete dir="classes"/> - <delete dir="junit"/> - <delete dir="src/genjava/com"/> - <!-- Legacy cleanup --> - <delete file="junit*.jar"/> - </target> - <path id="classpath"> - <pathelement path="${basedir}/../../com.amd.aparapi/dist/aparapi.jar"/> - <pathelement path="${junit.home}/${junit.jar.name}"/> - <pathelement path="classes"/> - </path> - - <target name="junit" depends="clean, install.junit"> - <mkdir dir="classes"/> - <javac debug="true" - debuglevel="lines,vars,source" - srcdir="src/java" - destdir="classes" - includeAntRuntime="false" - classpathref="classpath"> - <compilerarg value="-Xlint"/> - <compilerarg value="-Xlint:-path"/> - </javac> + <path id="classpath"> + <pathelement path="${basedir}/../../com.amd.aparapi/dist/aparapi.jar" /> + <pathelement path="${junit.home}/${junit.jar.name}" /> + <pathelement path="classes" /> + </path> - <java classname="com.amd.aparapi.CreateJUnitTests" classpathref="classpath"> - <sysproperty key="root" value="${basedir}"/> - </java> + <target name="junit" depends="clean, install.deps"> + <mkdir dir="classes" /> + <javac debug="true" debuglevel="lines,vars,source" srcdir="src/java" destdir="classes" includeAntRuntime="false" classpathref="classpath"> + <compilerarg value="-Xlint" /> + <compilerarg value="-Xlint:-path" /> + </javac> - <javac debug="true" - debuglevel="lines,vars,source" - srcdir="src/genjava" - destdir="classes" - includeAntRuntime="false" - classpathref="classpath"> - <compilerarg value="-Xlint"/> - <compilerarg value="-Xlint:-path"/> - </javac> - - <mkdir dir="junit"/> - <mkdir dir="junit/data"/> - - <junit printsummary="false" fork="false" haltonfailure="false" failureproperty="tests.failed" showoutput="false"> - <formatter type="xml" /> - <classpath refid="classpath"/> - <batchtest todir="junit/data"> - <fileset dir="src/genjava"/> - </batchtest> - </junit> + <java classname="com.amd.aparapi.CreateJUnitTests" classpathref="classpath"> + <sysproperty key="root" value="${basedir}" /> + </java> - <junitreport todir="junit/data"> - <fileset dir="junit/data"/> - <report format="frames" todir="junit/html" /> - </junitreport> - </target> + <javac debug="true" debuglevel="lines,vars,source" srcdir="src/genjava" destdir="classes" includeAntRuntime="false" classpathref="classpath"> + <compilerarg value="-Xlint" /> + <compilerarg value="-Xlint:-path" /> + </javac> + + <mkdir dir="junit" /> + <mkdir dir="junit/data" /> + + <junit printsummary="false" fork="false" haltonfailure="false" failureproperty="tests.failed" showoutput="false"> + <formatter type="xml" /> + <classpath refid="classpath" /> + <batchtest todir="junit/data"> + <fileset dir="src/genjava" /> + </batchtest> + </junit> + + <junitreport todir="junit/data"> + <fileset dir="junit/data" /> + <report format="frames" todir="junit/html" /> + </junitreport> + </target> </project> diff --git a/test/codegen/src/.gitignore b/test/codegen/src/.gitignore new file mode 100644 index 00000000..f8bfb846 --- /dev/null +++ b/test/codegen/src/.gitignore @@ -0,0 +1 @@ +/genjava/ -- GitLab