Skip to content

Commit

Permalink
Upgrade to Buffy build script version
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvainhalle committed Jan 8, 2023
1 parent c6dddc6 commit 1a5d4b1
Showing 1 changed file with 55 additions and 42 deletions.
97 changes: 55 additions & 42 deletions Source/Buffy/build.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
AntRun, a general-purpose Ant build script
Copyright (C) 2015-2021 Sylvain Hallé
Copyright (C) 2015-2022 Sylvain Hallé
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -23,7 +23,7 @@
xmlns:jacoco="antlib:org.jacoco.ant">

<!-- The build script's version number. Do not edit! -->
<property name="antrun.version" value="1.6.1"/>
<property name="antrun.version" value="1.7.3"/>

<!-- Load project properties from XML file -->
<xmlproperty file="config.xml"/>
Expand All @@ -41,7 +41,7 @@
<property name="build.version" value="1.0"/>

<!-- The target JDK version for the build -->
<property name="build.targetjdk" value="1.6"/>
<property name="build.targetjdk" value="1.8"/>

<!-- The folder where libraries (ant-contrib, etc.) will be downloaded
if necessary -->
Expand Down Expand Up @@ -94,13 +94,16 @@
<!-- Base name of the jar to produce (used by the "zip" target) -->
<basename property="build.jar.basename" file="${build.jar.filename}" suffix=".jar"/>

<!-- The filename pattern to recognize test files -->
<property name="build.test.filenamepattern" value="**/*.java"/>
<!-- The filename pattern to recognize test source files -->
<property name="build.test.filenamepattern.src" value="**/*Test.java"/>

<!-- The filename pattern to recognize test binary files -->
<property name="build.test.filenamepattern.bin" value="**/*Test.class"/>

<!-- Location of the Java boot classpath. If this is not set, the compiler
will resort to the default boot classpath. -->
<property environment="env"/>
<property name="java6.boot.classpath" value="${env.JAVA6_BOOTCLASSES}"/>
<property name="java8.boot.classpath" value="${env.JAVA8_BOOTCLASSES}"/>

<!-- The location of rt.jar, if it is there -->
<property name="build.rtlocation">rt.jar</property>
Expand Down Expand Up @@ -167,8 +170,8 @@
<echo message="Local bootstrap JAR is not present"/>
</else>
</if>
<var name="java6.boot.classpath" unset="true"/>
<property name="java6.boot.classpath" value="${build.rtlocation}"/>
<var name="java8.boot.classpath" unset="true"/>
<property name="java8.boot.classpath" value="${build.rtlocation}"/>
</target>

<!-- Target: zip
Expand All @@ -193,18 +196,15 @@
<mkdir dir="${build.bindir}"/>
<javac
target="${build.targetjdk}" source="${build.targetjdk}"
bootclasspath="${java6.boot.classpath}"
bootclasspath="${java8.boot.classpath}"
srcdir="${build.srcdir}"
destdir="${build.bindir}"
debug="${build.debug}"
includeantruntime="false">
<classpath refid="build.classpath"/>
</javac>
<copy todir="${build.bindir}" includeemptydirs="false">
<fileset dir="${build.srcdir}">
<exclude name="**/*.java"/>
<exclude name="**/doc-files/**"/>
</fileset>
<fileset dir="${build.srcdir}" excludes="**/*.java,doc-files/**"/>
</copy>
</target>

Expand All @@ -214,16 +214,16 @@
<target name="compile-tests" depends="init,compile,junit" description="Compile the test sources">
<mkdir dir="${build.test.bindir}"/>
<javac
target="1.6" source="1.6"
bootclasspath="${java6.boot.classpath}"
target="${build.targetjdk}" source="${build.targetjdk}"
bootclasspath="${java8.boot.classpath}"
srcdir="${build.test.srcdir}"
destdir="${build.test.bindir}"
debug="${build.debug}"
includeantruntime="false">
<classpath refid="build.classpath"/>
</javac>
<copy todir="${build.test.bindir}" includeemptydirs="false">
<fileset dir="${build.test.srcdir}" excludes="**/*.java"/>
<fileset dir="${build.test.srcdir}" excludes="**/doc-files/*.*"/>
<fileset dir="${build.test.srcdir}" excludes="**/*.java,doc-files/**"/>
</copy>
</target>

Expand Down Expand Up @@ -275,7 +275,12 @@
<attribute name="Built-Date" value="${TODAY}"/>
<attribute name="Implementation-Version" value="${build.version}"/>
</manifest>
<fileset dir="${build.bindir}"/>
<fileset dir="${build.bindir}">
<filename name="**/*"/>
<not>
<filename name="${build.test.filenamepattern.bin}"/>
</not>
</fileset>
<zipgroupfileset dir="${build.depdir}">
<include name="**/*.jar" if="${build.jar.withdeps}"/>
</zipgroupfileset>
Expand All @@ -298,19 +303,15 @@
<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
<classpath path="${build.libdir}/jacocoant.jar"/>
</taskdef>
<jacoco:coverage destfile="${test.reportdir}/jacoco.exec">
<junit printsummary="yes" haltonfailure="false" fork="true"
failureproperty="test.failed">
<classpath refid="build.test.classpath"/>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
<batchtest fork="yes" todir="${test.reportdir}">
<fileset dir="${build.test.srcdir}">
<include name="${build.test.filenamepattern}"/>
</fileset>
</batchtest>
</junit>
</jacoco:coverage>
<!-- Run jUnit. Since the jacoco task does not support the nested
junitlauncher task (required by jUnit5), we run jUnit manually and
pass the JaCoCo agent as a parameter to the JVM. -->
<jacoco:agent property="agentvmparam" enabled="true" destfile="${test.reportdir}/jacoco.exec" />
<java classpathref="build.test.classpath" classname="org.junit.platform.console.ConsoleLauncher" fork="true" failonerror="true">
<jvmarg value="${agentvmparam}" />
<arg line="--scan-classpath" />
<arg line="--reports-dir ${test.reportdir}" />
</java>
<!-- jUnit report -->
<junitreport todir="${test.reportdir}">
<fileset dir="${test.reportdir}">
Expand All @@ -332,6 +333,7 @@
</sourcefiles>
</structure>
<html destdir="${coverage.reportdir}"/>
<xml destfile="${test.reportdir}/report.xml"/>
</jacoco:report>
<!-- Fail if some test has failed -->
<fail if="test.failed"/>
Expand Down Expand Up @@ -363,6 +365,7 @@
</delete>
<delete dir="${build.libdir}"/>
<delete dir="${build.bindir}"/>
<delete dir="${build.test.bindir}"/>
<delete dir="${build.docdir}"/>
<delete dir="${build.depdir}"/>
<delete dir="${test.reportdir}"/>
Expand All @@ -378,6 +381,7 @@
<fileset dir="." includes="**/*~"/>
</delete>
<delete dir="${build.bindir}"/>
<delete dir="${build.test.bindir}"/>
<delete dir="${test.reportdir}"/>
<delete dir="${coverage.reportdir}"/>
<delete file="jacoco.exec"/>
Expand Down Expand Up @@ -448,28 +452,37 @@
<get src="http://sylvainhalle.github.io/AntRun/dependencies/xmltask.jar" dest="${build.libdir}/${xmltask.jarname}"/>
</target>

<!-- Target: download-rt6
Download boot classpath for Java 1.6 and put it in the root folder
<!-- Target: download-rt8
Download boot classpath for Java 1.8 and put it in the root folder
-->
<target name="download-rt6">
<get src="http://sylvainhalle.github.io/AntRun/dependencies/1.6.0_45/rt.jar" dest="${build.rtlocation}"/>
<condition property="rt8.absent" value="false" else="true">
<available file="${build.rtlocation}"/>
</condition>
<target name="download-rt8" if="${rt8.absent}">
<get src="http://sylvainhalle.github.io/AntRun/dependencies/1.8.0_201/rt.jar" dest="${build.rtlocation}"/>
</target>

<!-- Target: junit
Download jUnit JARs if not present, and puts them in the lib folder
-->
<property name="junit.jarname" value="junit-4.13.2.jar"/>
<property name="junit.hamcrest" value="hamcrest-core-1.3.jar"/>
<condition property="junit.absent" value="false" else="true">
<and>
<available file="${build.libdir}/${junit.jarname}"/>
<available file="${build.libdir}/${junit.hamcrest}"/>
<available file="${build.libdir}/junit-jupiter-api-5.7.2.jar"/>
<available file="${build.libdir}/junit-jupiter-engine-5.7.2.jar"/>
<available file="${build.libdir}/junit-jupiter-params-5.7.2.jar"/>
<available file="${build.libdir}/junit-platform-console-standalone-1.7.2.jar"/>
<available file="${build.libdir}/junit-vintage-engine-5.7.2.jar"/>
<available file="${build.libdir}/apiguardian-api-1.1.2.jar"/>
</and>
</condition>
<target name="junit" if="${junit.absent}" description="Install jUnit if not present">
<mkdir dir="${build.libdir}"/>
<get src="https://repo1.maven.org/maven2/junit/junit/4.13.2/${junit.jarname}" dest="${build.libdir}/${junit.jarname}"/>
<get src="https://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/${junit.hamcrest}" dest="${build.libdir}/${junit.hamcrest}"/>
<get src="https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-api/5.7.2/junit-jupiter-api-5.7.2.jar" dest="${build.libdir}/junit-jupiter-api-5.7.2.jar"/>
<get src="https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-engine/5.7.2/junit-jupiter-engine-5.7.2.jar" dest="${build.libdir}/junit-jupiter-engine-5.7.2.jar"/>
<get src="https://repo1.maven.org/maven2/org/junit/jupiter/junit-jupiter-params/5.7.2/junit-jupiter-params-5.7.2.jar" dest="${build.libdir}/junit-jupiter-params-5.7.2.jar"/>
<get src="https://repo1.maven.org/maven2/org/junit/platform/junit-platform-console-standalone/1.7.2/junit-platform-console-standalone-1.7.2.jar" dest="${build.libdir}/junit-platform-console-standalone-1.7.2.jar"/>
<get src="https://repo1.maven.org/maven2/org/junit/vintage/junit-vintage-engine/5.7.2/junit-vintage-engine-5.7.2.jar" dest="${build.libdir}/junit-vintage-engine-5.7.2.jar"/>
<get src="https://repo1.maven.org/maven2/org/apiguardian/apiguardian-api/1.1.2/apiguardian-api-1.1.2.jar" dest="${build.libdir}/apiguardian-api-1.1.2.jar"/>
</target>

<!-- Target: jacoco
Expand Down Expand Up @@ -594,4 +607,4 @@
</sequential>
</target>
</project>
<!-- :tabWidth=2: -->
<!-- :tabWidth=2: -->

0 comments on commit 1a5d4b1

Please sign in to comment.