Skip to content

Commit

Permalink
initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
rbouckaert committed Sep 28, 2015
1 parent 91cdec4 commit fce29cb
Show file tree
Hide file tree
Showing 11 changed files with 2,511 additions and 0 deletions.
203 changes: 203 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
<!-- Build Babel. It is also used by Hudson Babel project. JUnit test is available for this build. -->
<project basedir="." default="addon" name="BUILD_Babel">
<description>
Build Babel.
Also used by Hudson Babel project.
JUnit test is available for this build.
$Id: build_Babel.xml $
</description>

<!-- set global properties for this build -->
<property name="srcBabel" location="src" />
<property name="buildBabel" location="build" />
<property name="libBabel" location="lib" />
<property name="release_dir" value="release" />
<property name="distBabel" location="${buildBabel}/dist" />
<property name="beast2path" location="../beast2" />
<property name="libBeast2" location="${beast2path}/lib" />
<property name="srcBeast2" location="${beast2path}/src" />
<property name="beast2classpath" location="${beast2path}/build" />
<property name="Add_on_dir" value="${release_dir}/add-on" />
<property name="version" value="1.2.4" />

<import file="${beast2path}/build.xml" />

<property name="main_class_BEAST" value="beast.app.BeastMCMC" />
<property name="report" value="${buildBabel}/junitreport"/>

<path id="classpath">
<pathelement path="${buildBabel}"/>
<fileset dir="${libBeast2}" includes="junit-4.8.2.jar"/>
<fileset dir="${libBeast2}" includes="beagle.jar"/>
<fileset dir="${libBeast2}" includes="antlr-runtime-4.5.jar"/>
<fileset dir="${libBeast2}" includes="beagle.jar"/>
<pathelement path="${beast2classpath}"/>
</path>

<!-- start -->
<target name="initBabel">
<echo message="${ant.project.name}: ${ant.file}" />
</target>

<target name="cleanBabel">
<delete dir="${buildBabel}" />
</target>

<!-- clean previous build, and then compile Java source code, and Juint test -->
<target name="build_all_Babel" depends="cleanBabel,compile-allBabel,junitBabel"
description="Clean and Build all run-time stuff">
</target>

<!-- clean previous build, compile Java source code, and Junit test, and make the beast.jar and beauti.jar -->
<target name="build_jar_all_Babel" depends="cleanBabel,compile-allBabel,junitBabel,dist_all_Babel"
description="Clean and Build all run-time stuff">
</target>


<!-- No JUnit Test, clean previous build, compile Java source code, and make the Babel.jar and beauti.jar -->
<target name="build_jar_all_Babel_NoJUnitTest" depends="cleanBabel,compile-allBabel,dist_all_Babel"
description="Clean and Build all run-time stuff">
</target>

<!-- compile Java source code -->
<target name="compile-allBabel" depends="initBabel,compile-all">


<!-- Capture the path as a delimited property using the refid attribute -->
<property name="myclasspath" refid="classpath"/>
<!-- Emit the property to the ant console -->
<echo message="Classpath = ${myclasspath}"/>

<mkdir dir="${buildBabel}" />

<!-- Compile the java code from ${srcBabel} into ${buildBabel} /bin -->
<javac srcdir="${srcBabel}" destdir="${buildBabel}" classpathref="classpath"
fork="true"
memoryinitialsize="256m"
memorymaximumsize="256m">
<!--source="1.6"
target="1.6"-->
<include name="beast/**/**" />
<!-- compile JUnit test classes -->
<include name="test/beast/**" />
</javac>
<echo message="Successfully compiled." />
</target>

<!-- make the beast.jar and beauti.jar -->
<target name="dist_all_Babel" depends="compile-allBabel" description="create Babel jar">
<!-- Create the distribution directory -->
<mkdir dir="${distBabel}" />

<!-- Put everything in ${buildBabel} into the beast.jar file -->
<jar jarfile="${distBabel}/Babel.jar">
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="${main_class_BEAST}" />
</manifest>
<fileset dir="${buildBabel}">
<include name="beast/**/*.class" />
</fileset>
<fileset dir="${beast2classpath}">
<include name="beast/**/*.class" />
<include name="beast/**/*.properties" />
<include name="beast/**/*.png" />
<include name="beagle/**/*.class" />
<include name="org/**/*.class" />
</fileset>
</jar>
<jar jarfile="${distBabel}/Babel.src.jar">
<fileset dir="${srcBabel}">
<include name="beast/**/*.java" />
<include name="beast/**/*.png" />
<include name="beast/**/*.xsl" />
</fileset>
</jar>
<jar jarfile="${distBabel}/Babel.addon.jar">
<manifest>
<attribute name="Built-By" value="${user.name}" />
</manifest>
<fileset dir="${buildBabel}">
<include name="beast/**/*.class" />
<include name="util/**/*.class" />
<include name="**/*.properties" />
</fileset>
</jar>
</target>

<!-- run beast.jar -->
<target name="run_Babel">
<java jar="${distBabel}/Babel.jar" fork="true" />
</target>


<!-- JUnit test -->
<target name="junitBabel">
<mkdir dir="${report}" />
<junit printsummary="yes"> <!--showoutput='yes'-->
<classpath>
<path refid="classpath" />
<path location="${buildBabel}" />
</classpath>

<formatter type="xml" />

<batchtest fork="yes" todir="${report}">
<fileset dir="${srcBabel}">
<include name="test/**/*Test.java"/>
</fileset>
<fileset dir="${srcBeast2}">
<include name="test/beast/integration/**/*Test.java"/>
<exclude name="test/beast/integration/**/ResumeTest.java"/>
</fileset>
</batchtest>
</junit>
<echo message="JUnit test finished." />
</target>

<target name="junitreport">
<junitreport todir="${report}">
<fileset dir="${report}" includes="*.xml"/>
<report format="frames" todir="${report}"/>
</junitreport>
<echo message="JUnit test report finished." />
</target>


<target name="addon"
depends="build_jar_all_Babel_NoJUnitTest"
description="release BEAST 2 add-on version of Babel">

<delete dir="${Add_on_dir}" />
<!-- Create the release directory -->
<mkdir dir="${Add_on_dir}" />
<mkdir dir="${Add_on_dir}/lib" />
<mkdir dir="${Add_on_dir}/examples" />
<mkdir dir="${Add_on_dir}/templates" />

<copy todir="${Add_on_dir}">
<fileset file="version.xml"/>
</copy>
<copy todir="${Add_on_dir}/examples">
<fileset dir="examples" />
</copy>
<copy todir="${Add_on_dir}/lib">
<fileset dir="${distBabel}" includes="Babel.addon.jar" />
</copy>
<copy todir="${Add_on_dir}">
<fileset dir="${distBabel}" includes="Babel.src.jar" />
</copy>
<copy todir="${Add_on_dir}/templates">
<fileset file="templates/Babel.xml" />
<fileset file="templates/AutoPartition.xml" />
</copy>

<jar jarfile="${distBabel}/Babel.addon.v${version}.zip">
<fileset dir="${Add_on_dir}">
<include name="**/*" />
</fileset>
</jar>
<echo message="Add-on version v${version} release is finished." />
</target>

</project>
12 changes: 12 additions & 0 deletions src/babel/spanningtrees/Cognate.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package babel.spanningtrees;

import java.util.ArrayList;
import java.util.List;

public class Cognate {
int GlossID;
int MultistateCode;
List<String> languages = new ArrayList<String>();
List<String> word = new ArrayList<String>();
List<Integer> edges = new ArrayList<Integer>(); // encoded as (0,1) (0,3) entries in languages list
}
Loading

0 comments on commit fce29cb

Please sign in to comment.