summaryrefslogtreecommitdiff
path: root/build.xml
blob: 32e6a81b9519d7478ceec6900564a9294cbac283 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?xml version="1.0" encoding="utf-8"?>
<project name="grauphel" default="zip" basedir=".">
  <!--
    grauphel phing build file. Used to create releases.
  -->

  <loadfile property="version" file="appinfo/version">
    <filterchain>
      <replaceregexp>
       <regexp pattern="\r?\n" replace=""/>
      </replaceregexp>
    </filterchain>
  </loadfile>
  <property name="zipfile"  value="${phing.project.name}-${version}.tar.bz2" />
  <property name="distfile" value="dist/${zipfile}" />

  <fileset id="fs.zip" dir=".">
   <include name="**"/>
   <exclude name="dist/"/>
   <exclude name=".git"/>
   <exclude name=".travis.yml"/>
   <exclude name="**/.gitignore"/>
   <exclude name="**/build.xml"/>
   <exclude name="**/README.html"/>
  </fileset>

  <target name="zip" description="Create zip file for release">
    <mkdir dir="dist"/>
    <if>
     <available file='${distfile}' type='file' />
     <then>
       <echo>Error: Release zip file already exists: ${distfile}</echo>
       <fail>Zip file already exists</fail>
     </then>
    </if>
    <!--<delete file="${distfile}" failonerror="false"/>-->
    <tar destfile="${distfile}" prefix="grauphel/" compression="bzip2">
      <fileset refid="fs.zip"/>
    </tar>
  </target>

</project>