Commit 6f86c9de authored by Adrian Kosmaczewski's avatar Adrian Kosmaczewski

Restored ant build

parent 4c5c2f02
= Java
== Maven
This application is written with Java 14 preview features, and can be built using the `mvn package` command. To run it, use the `java -jar --enable-preview target/conway-1.0-SNAPSHOT.jar`.
== Ant
To build with `ant`, https://github.com/junit-team/junit4/wiki/Download-and-Install[download and install] Junit 4 in the `lib` folder, and run the `ant package` command. Then run the application by using the `java --enable-preview -jar out/conway.jar`.
== Tests
The Java application can be tested by running `mvn test` at the root of the folder.
If built with `ant`, use the `ant test` command.
<?xml version="1.0"?>
<project name="Conway" default="package">
<property name="src.dir" value="src"/>
<property name="build.dir" value="out"/>
<property name="lib.dir" value="lib"/>
<target name="clean">
<echo>Cleaning output</echo>
<delete dir="${build.dir}" />
</target>
<target name="test" depends="package">
<echo>Executing unit tests</echo>
<junit printsummary="on" haltonfailure="yes" fork="true">
<jvmarg line="--enable-preview"/>
<classpath>
<path location="${build.dir}/conway.jar"/>
<pathelement location="${lib.dir}/junit-4.13.1.jar"/>
<pathelement location="${lib.dir}/hamcrest-core-1.3.jar"/>
</classpath>
<formatter type="brief" usefile="false" />
<batchtest>
<fileset dir="${build.dir}" includes="ma/akos/Conway/Tests.class" />
</batchtest>
</junit>
</target>
<target name="build">
<echo>Building application</echo>
<mkdir dir="${build.dir}"/>
<javac destdir="${build.dir}">
<classpath>
<pathelement location="${lib.dir}/junit-4.13.1.jar"/>
</classpath>
<compilerarg value="--enable-preview" />
<compilerarg value="--source=15" />
<src path="${src.dir}"/>
</javac>
</target>
<target name="package" depends="build">
<echo>Packaging application</echo>
<jar destfile="${build.dir}/conway.jar"
basedir="${build.dir}"
includes="**/*.class">
<manifest>
<attribute name="Main-Class" value="Main"/>
</manifest>
</jar>
</target>
</project>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment