Skip to content

Instantly share code, notes, and snippets.

@dbolser-ebi
Last active October 16, 2018 14:40
Show Gist options
  • Save dbolser-ebi/7777b7269f60100bb133b346afe7376d to your computer and use it in GitHub Desktop.
Save dbolser-ebi/7777b7269f60100bb133b346afe7376d to your computer and use it in GitHub Desktop.
<?xml version="1.0"?>
<!--
Targets for checking out dependencies for the healthchecks.
Use
ant clean
to delete the directory with the checkouts.
-->
<project name="checkoutDependencies" default="checkoutPerlDependencies" basedir="..">
<property file="buildfiles/build.properties" />
<!--
Directory where checkout will be placed
-->
<property name="perlDependencyCheckoutDir" value="perlcode" />
<target
name = "setPermissions"
description = "Adds run permissions to th perl/run_healthcheck.pl program which is necessary for running perl based healthchecks."
>
<chmod file="./perl/run_healthcheck.pl" perm="u+x" />
</target>
<target
name = "checkoutPerlDependencies"
description = ""
depends = "checkoutBioperlDependency, checkoutEnsemblDependency, setPermissions"
/>
<!--
All checkouts go into this directory
-->
<target name="createPerlDependencyDir" description="">
<mkdir dir="${perlDependencyCheckoutDir}" />
</target>
<!--
Deletes the directory with the checkouts
-->
<target name="clean" description="">
<delete dir="${perlDependencyCheckoutDir}"/>
</target>
<!--
Checkouts of the Ensembl API
-->
<target name="checkoutEnsemblDependency" description="" depends="createPerlDependencyDir">
<exec dir="." executable="git" os="Linux,Mac OS X">
<arg line="clone --branch master https://github.com/Ensembl/ensembl-variation ${perlDependencyCheckoutDir}/ensembl-variation" />
</exec>
<exec dir="." executable="git" os="Linux,Mac OS X">
<arg line="clone --branch master https://github.com/Ensembl/ensembl-funcgen ${perlDependencyCheckoutDir}/ensembl-funcgen" />
</exec>
<exec dir="." executable="git" os="Linux,Mac OS X">
<arg line="clone --branch master https://github.com/Ensembl/ensembl ${perlDependencyCheckoutDir}/ensembl" />
</exec>
</target>
<!--
Checkouts of Bioperl
-->
<target name="checkoutBioperlDependency" description="" depends="createPerlDependencyDir">
<mkdir dir="${perlDependencyCheckoutDir}/bioperl"/>
<exec dir="." executable="git" os="Linux,Mac OS X">
<arg line="clone --branch v1.6.x https://github.com/bioperl/bioperl-live ${perlDependencyCheckoutDir}/bioperl" />
</exec>
</target>
</project>
name = ensj-healthcheck
version =
build.name = ${name}
build.compiler = modern
src = src/
target = target/
build = ${target}/build/
dist = ${target}/dist/
doc = doc/
lib = lib/
images = images/
test = test/
src.java.dir = ${src}
test.class.dir = ${build}
class.dir = ${build}
lib.dir.runtime = ${lib}
lib.dir.devel = ${lib}
test.dir = ${test}
test.class.dir = ${test.dir}classes
test.report.dir = ${test.dir}report
test.checkstyle.dir = ${test.dir}checkstyle
test.java.dir = ${test.dir}src
#
# The next two (logConfig, resources.runtime) are also in the
# ./run-configurable-testrunner.sh If changed here, must be changed there as
# well.
#
logConfig = config/logger/logging.properties
resources.runtime = resources/runtime
resources.docs = resources/docs
automatic_documentation = doc/
<?xml version="1.0"?>
<project name="ConfigurableTestRunner" default="compile" basedir="..">
<property file="buildfiles/build.properties" />
<import file = "build.checkoutDependencies.xml" />
<path id="compile.classpath">
<pathelement location="${class.dir}" />
<pathelement location="${lib.dir.devel}/stringtemplate-3.2.1.jar" />
<pathelement location="${lib.dir.devel}/antlr-2.7.7.jar" />
<fileset dir="${lib.dir.runtime}" includes="*.jar" />
</path>
<path id="run.classpath">
<pathelement location="${resources.runtime}" />
<path refid="compile.classpath" />
</path>
<path id="test.classpath">
<path refid="compile.classpath" />
<pathelement location="${test.class.dir}" />
<pathelement location="${test.dir}/testData" />
</path>
<path id="sourcepath.code">
<pathelement location="${src.java.dir}" />
</path>
<target
name = "docs"
description = "Creates technical documentation for the testgroups."
depends = "doc_overview, javadoc.api"
/>
<target name="javadoc.api" description="Creates javadoc documentation.">
<mkdir dir="${automatic_documentation}/api"/>
<javadoc
destdir = "${automatic_documentation}/api"
author = "true"
version = "true"
use = "true"
sourcepathref = "sourcepath.code"
classpathref = "compile.classpath"
excludepackagenames = "org.ensembl.healthcheck.test.*"
windowtitle = "EG Healthchecks">
<fileset dir="${src.java.dir}" defaultexcludes="yes" />
</javadoc>
</target>
<target name="javadoc.uml.api" description="An alternative to javadoc.api that creates javadoc documentation with uml inheritance diagrams. Requires the program dot to be installed.">
<mkdir dir="${automatic_documentation}/api"/>
<javadoc
destdir = "docs/api"
author = "true"
version = "true"
use = "true"
sourcepathref = "sourcepath.code"
classpathref = "compile.classpath"
excludepackagenames = "org.ensembl.healthcheck.test.*"
windowtitle = "EG Healthchecks">
<fileset dir="${src.java.dir}" defaultexcludes="yes" />
<doclet name="org.umlgraph.doclet.UmlGraphDoc" path="${lib.dir.devel}/UmlGraph-5.3.jar" >
<param name="-inferrel" />
<param name="-inferdep" />
<param name="-hide" value="java.*" />
<param name="-collpackages" value="java.util.*" />
<param name="-postfixpackage" />
<param name="-qualify" />
<param name="-attributes" />
<param name="-operations" />
<param name="-enumerations" />
<param name="-enumconstants" />
<param name="-visibility" />
</doclet>
</javadoc>
</target>
<target name="doc_overview" description="Copies static content for the docs.">
<copy
todir = "${automatic_documentation}">
<fileset dir="${resources.docs}/static/"/>
</copy>
</target>
<target name="init">
<mkdir dir="${class.dir}"/>
<mkdir dir="${test.class.dir}"/>
</target>
<target name="clean" description="Erases contents of classes dir">
<delete dir="${class.dir}" />
<delete dir="${test.class.dir}" />
<delete dir="${automatic_documentation}" />
</target>
<target name="run" depends="compile" description="Runs the ConfigurableTestRunner using the command line arguments stored in cmdline.">
<echo>Running ${cmdline}</echo>
<echo>Logging to ${logConfig}</echo>
<java
classname = "org.ensembl.healthcheck.ConfigurableTestRunner"
fork = "true"
classpathref = "run.classpath"
>
<arg line = "${cmdline}" />
<jvmarg line = "-Djava.util.logging.config.file=${logConfig}" />
</java>
</target>
<target name="run.createTestGroupsFromScratch" depends="compile" description="Builds testgroups from the groups as which testcases register">
<java
classname = "org.ensembl.healthcheck.TestsInGroups"
fork = "true"
classpathref = "compile.classpath"
>
<arg line = "org.ensembl.healthcheck.testcase src/ org.ensembl.healthcheck.testgroup" />
<jvmarg line = "-Djava.util.logging.config.file=${logConfig}" />
</java>
</target>
</project>
<?xml version="1.0"?>
<project name="ConfigurableTestRunnerDevel" default="compile" basedir=".">
<!--
Configure the command line here in the cmdline property, if
you want to run the tests using ant. This is passed to the
org.ensembl.healthcheck.ConfigurableTestRunner when it is run.
Start the testrunner by typing "ant" on the command line.
-->
<property name="cmdline" value="
--group
testgroup.AllComparaTests
--less
testgroup.ProblemTests
testgroup.ExpectedToFailOnEGComparaBacteria
--conf
config/healthchecks/database.external_db.properties
config/healthchecks/database.secondary.external_db.properties
--output.databases
ensembl_compara_bacteria_5_58
--output.database
healthchecks_mnuhn
--reporterType
Database
"/>
<!-- Not used by ant, just a repository for copy and paste operations. -->
<property name="OldCmdline" value="
-group
testgroup.AllVariationTests
-less
testgroup.ProblemTests
testgroup.ExpectedToFailOnEGComparaBacteria
-output.databases
arabidopsis_thaliana_variation_5_58_9
-group
testgroup.AllComparaTests
-less
testgroup.ProblemTests
testgroup.ExpectedToFailOnEGComparaBacteria
-conf
database.mnuhn.properties
configfiles/database.external_db.properties
configfiles/database.secondary.external_db.properties
CheckTaxon
-group
testgroup.AllEGCore
-test
org.ensembl.healthcheck.testcase.compara.CheckTopLevelDnaFrag
-less
testgroup.ExpectedToFailOnEGComparaBacteria
-conf
database.mnuhn.properties
configfiles/database.cp3.properties
configfiles/database.secondary.ensmirror.properties
"/>
<property file="build.properties" />
<path id="compile.classpath">
<pathelement location="${class.dir}" />
<pathelement location="${lib.dir.devel}/stringtemplate-3.2.1.jar" />
<pathelement location="${lib.dir.devel}/antlr-2.7.7.jar" />
<fileset dir="${lib.dir.runtime}" includes="*.jar" />
</path>
<path id="run.classpath">
<pathelement location="${resources.runtime}" />
<path refid="compile.classpath" />
</path>
<path id="test.classpath">
<path refid="compile.classpath" />
<pathelement location="${test.class.dir}" />
<pathelement location="${test.dir}/testData" />
</path>
<path id="sourcepath.code">
<pathelement location="${src.java.dir}" />
<pathelement location="${src_new.java.dir}" />
<pathelement location="${src.healthcheck.groups}" />
<pathelement location="${src.testcases}" />
</path>
<path id="sourcepath.test">
<pathelement location="${src.healthcheck.groups}" />
</path>
<target
name = "docs"
description = "Creates technical documentation for the testgroups."
depends = "doc_overview, javadoc.testgroups, javadoc.testcases, javadoc.api"
/>
<target name="javadoc.api" description="Creates javadoc documentation.">
<mkdir dir="docs/api"/>
<javadoc
destdir = "docs/api"
author = "true"
version = "true"
use = "true"
sourcepathref = "sourcepath.code"
classpathref = "compile.classpath"
excludepackagenames = "org.ensembl.healthcheck.test.*"
windowtitle = "EG Healthchecks">
<fileset dir="${src_new.java.dir}" defaultexcludes="yes" />
<doclet name="org.umlgraph.doclet.UmlGraphDoc" path="${lib.dir.devel}/UmlGraph-5.3.jar" >
<param name="-inferrel" />
<param name="-inferdep" />
<param name="-hide" value="java.*" />
<param name="-collpackages" value="java.util.*" />
<param name="-postfixpackage" />
<param name="-qualify" />
<param name="-attributes" />
<param name="-operations" />
<param name="-enumerations" />
<param name="-enumconstants" />
<param name="-visibility" />
</doclet>
</javadoc>
</target>
<target name="javadoc.testcases" description="Creates javadoc files for the testgroups.">
<mkdir dir="docs/testcases"/>
<javadoc
destdir = "docs/testcases"
author = "true"
version = "true"
use = "true"
sourcepath = "${src.testcases}"
classpathref = "compile.classpath"
packagenames = "org.ensembl.healthcheck.testcase.*"
windowtitle = "Test groups"
>
<!--
sourcepathref = "sourcepath.code"
-->
<doclet name="org.umlgraph.doclet.UmlGraphDoc" path="${lib.dir.devel}/UmlGraph-5.3.jar" />
</javadoc>
</target>
<target name="doc_overview" description="Copies static content for the docs.">
<copy
todir = "${automatic_documentation}">
<fileset dir="${resources.docs}/static/"/>
</copy>
</target>
<target name="javadoc.testgroups" description="Creates javadoc files for the testgroups.">
<mkdir dir="docs/testgroups"/>
<javadoc
destdir = "docs/testgroups"
author = "true"
version = "true"
use = "true"
sourcepathref = "sourcepath.code"
classpathref = "compile.classpath"
packagenames = "testgroup.*"
overview = "${resources.docs}/testgroups/overview.html"
excludepackagenames = "org.*"
linksource = "yes"
windowtitle = "Test groups"
>
<doclet name="org.umlgraph.doclet.UmlGraphDoc" path="${lib.dir.devel}/UmlGraph-5.3.jar" />
</javadoc>
</target>
<target name="publish" description="Copies this directory to the public_html directory. More a kind of backup.">
<delete dir="/homes/mnuhn/public_html/configurableTestRunner.old" />
<move
file = "/homes/mnuhn/public_html/configurableTestRunner"
tofile = "/homes/mnuhn/public_html/configurableTestRunner.old"
/>
<copy todir="/homes/mnuhn/public_html/configurableTestRunner">
<fileset dir="."/>
</copy>
</target>
<target name="createTestDB" description="Creates an empty database with the test database schema. For developmental purposes only.">
<sql
driver = "org.gjt.mm.mysql.Driver"
url = "jdbc:mysql://mysql-cluster-eg-prod-1.ebi.ac.uk:4238/"
userid = "ensrw"
password = "writ3rp1"
classpathref = "compile.classpath"
>
drop database if exists healthchecks_mnuhn;
create database healthchecks_mnuhn;
</sql>
<sql
driver = "org.gjt.mm.mysql.Driver"
url = "jdbc:mysql://mysql-cluster-eg-prod-1.ebi.ac.uk:4238/healthchecks_mnuhn"
userid = "ensrw"
password = "writ3rp1"
classpathref = "compile.classpath"
src = "${resources.runtime}/table.sql"
>
</sql>
</target>
<target name="compile" depends="init" description="Compiles all source code. Use this for compiling your test groups.">
<javac
srcdir = "${src.java.dir}"
destdir = "${class.dir}"
classpathref = "compile.classpath"
debug = "true"
debuglevel = "lines,vars,source"
>
</javac>
<javac
srcdir = "${src.testcases}"
destdir = "${class.dir}"
classpathref = "compile.classpath"
debug = "true"
debuglevel = "lines,vars,source"
>
</javac>
<javac
srcdir = "${src_new.java.dir}"
destdir = "${class.dir}"
classpathref = "compile.classpath"
debug = "true"
debuglevel = "lines,vars,source"
>
</javac>
<javac
srcdir = "${test.class.dir}"
destdir = "${class.dir}"
classpathref = "compile.classpath"
debug = "true"
debuglevel = "lines,vars,source"
>
</javac>
<javac
srcdir = "${src.healthcheck.groups}"
destdir = "${class.dir}"
classpathref = "compile.classpath"
debug = "true"
debuglevel = "lines,vars,source"
>
</javac>
</target>
<target name="init">
<mkdir dir="${class.dir}"/>
<mkdir dir="${test.class.dir}"/>
</target>
<target name="clean" description="Erases contents of classes dir">
<delete dir="${class.dir}" />
<delete dir="${test.class.dir}" />
<delete dir="${automatic_documentation}" />
</target>
<target name="compile-tests" depends="compile" description="Compiles tests code.">
<javac
srcdir = "${test.java.dir}"
destdir = "${test.class.dir}"
classpathref = "test.classpath"
>
</javac>
</target>
<target name="test" depends="compile-tests" description="Runs the tests.">
<junit
printsummary = "true"
haltonfailure = "true"
fork = "true"
>
<classpath refid="test.classpath" />
<formatter type="plain" usefile="false" />
<batchtest
fork = "yes"
todir = "${test.report.dir}"
>
<fileset dir="${test.java.dir}">
<include name="**/*" />
</fileset>
</batchtest>
</junit>
</target>
<target name="run" depends="compile" description="Runs the ConfigurableTestRunner using the command line arguments stored in cmdline.">
<echo>Running ${cmdline}</echo>
<echo>Logging to ${logConfig}</echo>
<java
classname = "org.ensembl.healthcheck.ConfigurableTestRunner"
fork = "true"
classpathref = "run.classpath"
>
<arg line = "${cmdline}" />
<jvmarg line = "-Djava.util.logging.config.file=${logConfig}" />
</java>
</target>
<target name="run.createTestGroupsFromScratch" depends="compile" description="Builds testgroups from the groups as which testcases register">
<java
classname = "org.ensembl.healthcheck.TestsInGroups"
fork = "true"
classpathref = "compile.classpath"
>
<arg line = "org.ensembl.healthcheck.testcase src/testgroups testgroup.autogeneratedlegacy" />
<jvmarg line = "-Djava.util.logging.config.file=${logConfig}" />
</java>
</target>
</project>
<?xml version="1.0"?>
<!--
-->
<project name="setPermissions" default="setPermissions" basedir="..">
<!--
-->
<target name="setPermissions" description="" depends="">
<chmod file="perl/run_healthcheck.pl" perm="u+x"/>
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment