build.xml 3.5 KB
Newer Older
1
2
3
4
5
6
7
8
9
<?xml version="1.0" encoding="UTF-8"?>
<project default="xar" name="SADE" xmlns:xdb="http://exist-db.org/ant">

  <property environment="env"/>
  <property name="build.dir" value="build"/>
  <property file="local.build.properties"/>
  <property file="build.properties"/>
  <xmlproperty file="expath-pkg.xml.tmpl"/>

Mathias Goebel's avatar
Mathias Goebel committed
10
11
12
13
14
15
16
17
  <antversion property="antversion"/>

  <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"/>
  </target>

18
  <target name="xar">
19
20
21
22
23
24
25
26
27
28
29
      <copy file="expath-pkg.xml.tmpl" tofile="expath-pkg.xml" filtering="true" overwrite="true">
          <filterset>
              <filter token="project.version" value="${project.version}"/>
              <filter token="project.title" value="${project.title}"/>
              <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}"/>
30
31
      <zip basedir="." destfile="${destfile}" defaultexcludes="no"
          excludes=".git/,${build.dir}/,${test.dir}/"/>
32
33
34
35
36
37
  </target>

  <target name="cleanup">
    <delete dir="${test.dir}"/>
  </target>

38
  <target name="test" depends="antversion-test, cleanup, xar">
hynek's avatar
hynek committed
39
40
    <!-- 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" />
41
    <untar src="${build.dir}/eXist-db-${project.processorversion}.tar.bz2" dest="${test.dir}" compression="bzip2" />
42

hynek's avatar
hynek committed
43
44
45
46
    <!-- 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>
47

hynek's avatar
hynek committed
48
    <!-- task setpermissions requries at least ant 1.10.0 -->
49
    <setpermissions permissions="OWNER_READ,OWNER_WRITE,OWNER_EXECUTE,OTHERS_READ,OTHERS_EXECUTE,GROUP_READ,GROUP_EXECUTE">
Ubbo Veentjer's avatar
Ubbo Veentjer committed
50
51
      <file file="${test.dir}/eXist-db-${project.processorversion}/bin/startup.sh"/>
    </setpermissions>
52
53
54
55
56
57
58
59
60

    <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="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"/>

    <copy file="${destfile}" todir="${test.dir}/eXist-db-${project.processorversion}/autodeploy" />
  </target>
61

Mathias Goebel's avatar
Mathias Goebel committed
62
</project>