Navigation Menu

Skip to content

Commit

Permalink
fixed build.xml for travis.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars authored and Lars committed May 13, 2016
1 parent 0ea889f commit e939e9f
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 92 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
@@ -1,4 +1,6 @@
language: java
script: ant test -file build/build.ant
script: ant test
jdk:
- oraclejdk8
notifications:
slack: husacct:YpeL7dIr0OEKvPRCVIV03XCd
185 changes: 95 additions & 90 deletions build/build.ant → build.xml
@@ -1,91 +1,96 @@
<project name="HUSACCT" basedir="../" default="main">

<property name="src.dir" value="src"/>
<property name="build.dir" value="build"/>
<property name="lib.dir" value="lib" />

<property name="conf.dir" value="${build.dir}/conf"/>
<property name="bin.dir" value="${build.dir}/bin"/>
<property name="jar.dir" value="${build.dir}/jar"/>
<property name="reports.dir" value="${build.dir}/reports" />

<property name="main-class" value="husacct.Main"/>

<path id="classpath">
<pathelement location="${bin.dir}" />
<pathelement location="${src.dir}" />
<fileset dir="${lib.dir}" includes="*.jar" />
</path>

<target name="main" depends="clean,compile,extractlib,jar,addresources"/>

<!-- Cleanup working directory -->
<target name="clean">
<delete dir="${bin.dir}"/>
<delete dir="${jar.dir}"/>
<delete dir="${reports.dir}"/>
</target>

<!-- Compile source -->
<target name="compile">
<mkdir dir="${bin.dir}"/>
<javac srcdir="${src.dir}" destdir="${bin.dir}" debug="true" deprecation="on" includeantruntime="false">
<classpath refid="classpath" />
</javac>
</target>

<!-- Extract external libraries -->
<target name="extractlib">
<unzip dest="${bin.dir}">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</unzip>
</target>

<!-- Create runnable Jars -->
<target name="jar">
<mkdir dir="${jar.dir}"/>
<jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${bin.dir}" excludes="husaccttest/**">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
</jar>
</target>

<!-- Add resources -->
<target name="addresources">
<taskdef classpath="${lib.dir}/rscbundlecheck-1.31-bin.jar" resource="task.properties"/>
<resourceCheck>
<fileset dir="${src.dir}/husacct/common/resources/locale/">
<include name="husacct_*.properties"/>
</fileset>
<checks>
<include name="cross bundle check"/>
<include name="empty value check"/>
<include name="line end check"/>
<include name="empty key check"/>
<include name="duplicate key check"/>
</checks>
</resourceCheck>
<jar jarfile="${jar.dir}/${ant.project.name}.jar" update="true">
<fileset dir="${src.dir}" >
<include name="husacct/common/resources/**/*" />
</fileset>
</jar>
</target>

<target name="test" depends="clean,compile,extractlib,addresources">
<junit fork="yes" printsummary="on" haltonfailure="yes">
<!-- Project classpath, must include junit.jar -->
<classpath>
<path refid="classpath" />
<pathelement location="${src.dir}/husaccttest/TestAll.java" />
</classpath>
<formatter type="brief" usefile="false" />
<test name="husaccttest.TestAll" haltonfailure="yes"/>

</junit>
</target>

<project name="HUSACCT" basedir="." default="main">

<property name="src.dir" value="src"/>
<property name="build.dir" value="build"/>
<property name="lib.dir" value="lib" />

<property name="conf.dir" value="${build.dir}/conf"/>
<property name="bin.dir" value="${build.dir}/bin"/>
<property name="jar.dir" value="${build.dir}/jar"/>
<property name="reports.dir" value="${build.dir}/reports" />

<property name="main-class" value="husacct.Main"/>

<path id="classpath">
<pathelement location="${bin.dir}" />
<pathelement location="${src.dir}" />
<fileset dir="${lib.dir}" includes="*.jar" />
</path>

<path id="classpath.test">
<pathelement location="${bin.dir}" />
<pathelement location="${src.dir}" />
</path>

<target name="main" depends="addresources"/>

<!-- Cleanup working directory -->
<target name="clean">
<delete dir="${bin.dir}"/>
<delete dir="${jar.dir}"/>
<delete dir="${reports.dir}"/>
</target>

<!-- Compile source -->
<target name="compile" depends="clean">
<mkdir dir="${bin.dir}"/>
<javac srcdir="${src.dir}" destdir="${bin.dir}" debug="true" deprecation="on" includeantruntime="false">
<classpath refid="classpath" />
</javac>
</target>

<!-- Run test classes -->
<target name="test" depends="compile">
<junit fork="yes" printsummary="on" haltonfailure="yes">
<!-- Project classpath, must include junit.jar -->
<classpath>
<path refid="classpath" />
</classpath>
<formatter type="brief" usefile="false" />
<test name="husaccttest.TestAll" haltonfailure="yes"/>

</junit>
</target>

<!-- Extract external libraries -->
<target name="extractlib" depends="test">
<unzip dest="${bin.dir}">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</unzip>
</target>

<!-- Create runnable Jars -->
<target name="jar" depends="extractlib">
<mkdir dir="${jar.dir}"/>
<jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${bin.dir}" excludes="husaccttest/**">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
</jar>
</target>

<!-- Add resources -->
<target name="addresources" depends="jar">
<taskdef classpath="${lib.dir}/rscbundlecheck-1.31-bin.jar" resource="task.properties"/>
<resourceCheck>
<fileset dir="${src.dir}/husacct/common/resources/locale/">
<include name="husacct_*.properties"/>
</fileset>
<checks>
<include name="cross bundle check"/>
<include name="empty value check"/>
<include name="line end check"/>
<include name="empty key check"/>
<include name="duplicate key check"/>
</checks>
</resourceCheck>
<jar jarfile="${jar.dir}/${ant.project.name}.jar" update="true">
<fileset dir="${src.dir}" >
<include name="husacct/common/resources/**/*" />
</fileset>
</jar>
</target>

</project>
2 changes: 1 addition & 1 deletion src/husaccttest/TestResourceFinder.java
Expand Up @@ -37,7 +37,7 @@ public static String findSourceCodeDirectory(String languageFolder, String proje
public static String findHusacctWorkspace(String languageFolder, String workspaceName){

String buildPrefix = ".." + File.separator;
String simplePath = testprojectFolder + File.separator + languageFolder + File.separator + "workspaces" + File.separator + workspaceName;
String simplePath = testprojectFolder + File.separator + languageFolder + File.separator + "workspaces" + File.separator + workspaceName;
String pathFromBuild = buildPrefix + simplePath;

String selectedPath = simplePath;
Expand Down

0 comments on commit e939e9f

Please sign in to comment.