Dear Gitlab users, due to maintenance reasons, Gitlab will not be available on Thursday 30.09.2021 from 5:00 pm to approximately 5:30 pm.

Verified Commit 5fb13e40 authored by hynek's avatar hynek 🤤
Browse files

build(ant): refactor `build.xml`



build is now configured with environment variables, not property files
Co-authored-by: default avatarbarth23 <florian.barth@uni-goettingen.de>
Co-authored-by: sendler's avatarsendler <sendler@sub.uni-goettingen.de>
parent 0a60e0e3
<?xml version="1.0" encoding="UTF-8"?>
<project default="xar" name="SADE" xmlns:xdb="http://exist-db.org/ant">
<property environment="env"/>
<!-- bind environment variables to 'env'//-->
<property environment="env" />
<!-- default values for building outside CI //-->
<property name="project.abbrev" value="sade" />
<property name="project.name" value="http://sade.textgrid.de/ns/${project.abbrev}" />
<condition property="project.version" value="${env.RELEASE_VERSION}" else="${env.PREVIOUS_VERSION}+${env.LAST_COMMIT_SHORT_SHA}">
<isset property="env.RELEASE_VERSION" />
</condition>
<property name="project.title" value="Scalable Architecture for Digital Editions powered by TextGrid" />
<property name="project.processorversion" value="5.2.0" />
<property name="build.dir" value="build"/>
<property file="local.build.properties"/>
<property file="build.properties"/>
<property name="test.dir" value="test"/>
<property name="exist.root" value="${test.dir}/exist-distribution-${project.processorversion}"/>
<property name="destfile" value="${build.dir}/${project.abbrev}-${project.version}.xar" />
<xmlproperty file="expath-pkg.xml.tmpl"/>
<antversion property="antversion"/>
......@@ -12,7 +25,7 @@
<target name="antversion-test">
<antversion property="antversionReady" atleast="1.10"/>
<fail unless="antversionReady">installed version of ant (${antversion}) is lower than the required one (1.10.0)</fail>
<echo message="installed version of ant (${antversion}) is satisfying"/>
<echo message="installed version of ant (${antversion}) is satisfied"/>
</target>
<target name="xar">
......@@ -23,12 +36,11 @@
<filter token="project.abbrev" value="${project.abbrev}"/>
<filter token="project.name" value="${project.name}"/>
<filter token="project.processorversion" value="${project.processorversion}"/>
<filter token="dependency.track" value="${dependency.track}"/>
</filterset>
</copy>
<mkdir dir="${build.dir}"/>
<zip basedir="." destfile="${destfile}" defaultexcludes="no"
excludes=".git/,${build.dir}/,${test.dir}/"/>
includes="docs/**, modules/**, templates/**, textgrid/**, CHANGELOG.md, collection.xconf, config.xml, controller.xql, expath-pkg.xml, icon.png, lang.xml, LICENSE, navigation.xml, post-install.xq, pre-install.xq, README.md, repo.xml, search-hits.xslt, test.xq, test.xqm" />
</target>
<target name="cleanup">
......@@ -37,26 +49,23 @@
<target name="test" depends="antversion-test, cleanup, xar">
<!-- this path may be and is subject to change! -->
<get src="https://bintray.com/existdb/releases/download_file?file_path=exist-distribution-${project.processorversion}-unix.tar.bz2" dest="${build.dir}/eXist-db-${project.processorversion}.tar.bz2" skipexisting="true" />
<get src="https://github.com/eXist-db/exist/releases/download/eXist-${project.processorversion}/exist-distribution-${project.processorversion}-unix.tar.bz2"
dest="${build.dir}/eXist-db-${project.processorversion}.tar.bz2"
skipexisting="true" />
<untar src="${build.dir}/eXist-db-${project.processorversion}.tar.bz2" dest="${test.dir}" compression="bzip2" />
<!-- directory name changed: exist-distribution-5.0.0-->
<move todir="${test.dir}/eXist-db-${project.processorversion}">
<fileset dir="${test.dir}/exist-distribution-${project.processorversion}" />
</move>
<!-- task setpermissions requries at least ant 1.10.0 -->
<setpermissions permissions="OWNER_READ,OWNER_WRITE,OWNER_EXECUTE,OTHERS_READ,OTHERS_EXECUTE,GROUP_READ,GROUP_EXECUTE">
<file file="${test.dir}/eXist-db-${project.processorversion}/bin/startup.sh"/>
<file file="${exist.root}/bin/startup.sh"/>
</setpermissions>
<get src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=${assets.abbrev}&amp;processor=${project.processorversion}" dest="${test.dir}/eXist-db-${project.processorversion}/autodeploy/sade_assets-latest.xar" ignoreerrors="true"/>
<get src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=${code-viewer.abbrev}&amp;processor=${project.processorversion}" dest="${test.dir}/eXist-db-${project.processorversion}/autodeploy/codeview-latest.xar" ignoreerrors="true"/>
<get src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=sade_assets&amp;processor=${project.processorversion}" dest="${exist.root}/autodeploy/sade_assets-latest.xar" ignoreerrors="true"/>
<get src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=cv&amp;processor=${project.processorversion}" dest="${exist.root}/autodeploy/codeview-latest.xar" ignoreerrors="true"/>
<get src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=markdown&amp;processor=${project.processorversion}" dest="${test.dir}/eXist-db-${project.processorversion}/autodeploy/markdown-latest.xar" ignoreerrors="true"/>
<get src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=functx&amp;processor=${project.processorversion}" dest="${test.dir}/eXist-db-${project.processorversion}/autodeploy/functx-latest.xar" ignoreerrors="true"/>
<get src="http://exist-db.org/exist/apps/public-repo/public/markdown-0.6.xar" dest="${exist.root}/autodeploy/markdown-latest.xar" ignoreerrors="true"/>
<get src="http://exist-db.org/exist/apps/public-repo/public/functx-1.0.1.xar" dest="${exist.root}/autodeploy/functx-latest.xar" ignoreerrors="true"/>
<copy file="${destfile}" todir="${test.dir}/eXist-db-${project.processorversion}/autodeploy" />
<copy file="${destfile}" todir="${exist.root}/autodeploy" />
</target>
</project>
......@@ -7,7 +7,7 @@
<title>@project.title@</title>
<dependency processor="http://exist-db.org" semver-min="@project.processorversion@"/>
<dependency package="http://exist-db.org/apps/shared"/>
<dependency package="https://sade.textgrid.de/ns/assets@dependency.track@" semver-min="2.0.0"/>
<dependency package="https://sade.textgrid.de/ns/assets" semver-min="2.0.0"/>
<dependency package="http://www.functx.com"/>
<dependency package="http://exist-db.org/apps/markdown"/>
</package>
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