-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
vinh.duc.nguyen
committed
Apr 27, 2016
1 parent
d9e3226
commit 94c0602
Showing
6 changed files
with
94 additions
and
26 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<project name="HelloWorld" basedir="." default="main"> | ||
|
||
<property name="src.dir" value="src"/> | ||
|
||
<property name="build.dir" value="build"/> | ||
<property name="classes.dir" value="${build.dir}/classes"/> | ||
<property name="jar.dir" value="${build.dir}/jar"/> | ||
<property name="lib.dir" value="lib"/> | ||
<property name="report.dir" value="${build.dir}/junitreport"/> | ||
|
||
<property name="main-class" value="oata.HelloWorld"/> | ||
|
||
<path id="classpath"> | ||
<fileset dir="${lib.dir}" includes="**/*.jar"/> | ||
<path location="${lib.dir}/junit-4.12.jar"/> | ||
</path> | ||
|
||
<path id="application" location="${jar.dir}/${ant.project.name}.jar"/> | ||
|
||
<target name="clean"> | ||
<delete dir="${build.dir}"/> | ||
</target> | ||
|
||
<target name="compile"> | ||
<mkdir dir="${classes.dir}"/> | ||
<javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="classpath"/> | ||
<copy todir="${classes.dir}"> | ||
<fileset dir="${src.dir}" excludes="**/*.java"/> | ||
</copy> | ||
</target> | ||
|
||
<target name="jar" depends="junit"> | ||
<mkdir dir="${jar.dir}"/> | ||
<jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}" excludes="**/*Test.class"> | ||
<manifest> | ||
<attribute name="Main-Class" value="${main-class}"/> | ||
</manifest> | ||
</jar> | ||
</target> | ||
|
||
<target name="junit" depends="compile"> | ||
<mkdir dir="${report.dir}"/> | ||
<junit printsummary="yes" haltonfailure="yes" showoutput="yes"> | ||
<classpath> | ||
<path refid="classpath"/> | ||
<path location="${classes.dir}"/> | ||
</classpath> | ||
|
||
<formatter type="xml"/> | ||
|
||
<batchtest fork="yes"> | ||
<fileset dir="${src.dir}" includes="*Test.java"/> | ||
</batchtest> | ||
</junit> | ||
</target> | ||
|
||
<target name="junitreport" depends="junit"> | ||
<junitreport todir="${report.dir}"> | ||
<fileset dir="${report.dir}" includes="TEST-*.xml"/> | ||
<report todir="${report.dir}"/> | ||
</junitreport> | ||
</target> | ||
|
||
<target name="run" depends="jar"> | ||
<java fork="true" classname="${main-class}"> | ||
<classpath> | ||
<path refid="classpath"/> | ||
<path refid="application"/> | ||
</classpath> | ||
</java> | ||
</target> | ||
|
||
<target name="clean-build" depends="clean,jar"/> | ||
|
||
<target name="main" depends="clean,run"/> | ||
|
||
</project> |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package oata; | ||
|
||
public class HelloWorld { | ||
public static void main(String[] args) { | ||
System.out.println("Hello World"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
public class HelloWorldTest extends junit.framework.TestCase { | ||
|
||
public void testNothing() { | ||
} | ||
|
||
public void testWillAlwaysFail() { | ||
fail("An error message"); | ||
} | ||
|
||
} |