summaryrefslogtreecommitdiff
path: root/build.xml
blob: f878eae074a8b7ca6839189c1dc108dfd83fc159 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?xml version="1.0" encoding="utf-8"?>
<project name="SemanticScuttle" default="dist" basedir=".">
  <!--
    SemanticScuttle phing build file.
    This script should provide a one-stop tool for all administrative
    tasks around SemanticScuttle, like creating a release version,
    tagging a release, running unit tests etc.
  -->
  <property file="build.properties" />

  <property name="version"    value="0.95" />
  <property name="distfile"   value="dist/${phing.project.name}-${version}.zip" />
  <property name="sfproject"  value="SemanticScuttle" />
  <property name="sffilepath" value="s/se/semanticscuttle/" />

  <target name="dist" depends="check"
   description="Create zip file for release"
   >
    <!--
      The release file is for end users, so it is safe to
      remove anything developer-related.

      Test your zip with: unzip -l SemanticScuttle-0.95.0.zip
    -->
    <mkdir dir="dist" />
    <echo msg="Creating distribution zip for SemanticScuttle ${version}"/>
    <delete file="${distfile}" failonerror="false"/>
    <zip destfile="${distfile}" prefix="${phing.project.name}-${version}/">
      <fileset dir=".">
        <include name="**"/>
        <exclude name="**/.gitignore"/>
        <exclude name="**/.svn/"/>
        <exclude name=".git/"/>
        <exclude name="cache/"/>
        <exclude name="tests/"/>
        <exclude name="scripts/"/>
        <exclude name="build.xml"/>
        <exclude name="data/config.php"/>
        <exclude name="data/locales/messages.po"/>
        <exclude name="data/locales/*/LC_MESSAGES/messages.po"/>
        <exclude name="doc/developers/"/>
        <exclude name="SemanticScuttle-*"/>
        <exclude name="src/php-gettext/examples/" />
        <exclude name="src/php-gettext/bin/"/>
      </fileset>
    </zip>
  </target>


  <!--
  /home/frs/project/s/se/semanticscuttle/SemanticScuttle/v0.94/
  /home/frs/project/s/se/semanticscuttle/SemanticScuttle/v0.94/SemanticScuttle-v0.94.zip
  /home/frs/project/s/se/semanticscuttle/SemanticScuttle/v0.94/SemanticScuttle-v0.94.1.zip
  -->
  <target name="deploy-sf" depends="check,dist"
   description="Upload release to sourceforge"
   >
    <delete dir="dist/deploy-sf" /><!-- make empty -->
    <mkdir dir="dist/deploy-sf" />
    <mkdir dir="dist/deploy-sf/v${version}" />
    <copy file="${distfile}" tofile="dist/deploy-sf/v${version}/${distfile}"/>
    <!-- test
    <exec command="rsync -av dist/deploy-sf/ /tmp/test/" escape="false" />
    -->
    <exec
     command="rsync -av -e ssh dist/deploy-sf/ ${sfuser},${sfproject}@frs.sourceforge.net:/home/frs/project/${sffilepath}/${sfproject}/"
     escape="false" checkreturn="true"
     />
  </target>


  <target name="check"
   description="Check variables"
   >
    <fail unless="version" message="Version not defined!" />
    <fail unless="sfuser" message="Sourceforge username not defined!" />
    <fail unless="sfproject" message="Sourceforge project name not defined!" />
    <fail unless="sffilepath" message="Sourceforge project file path not defined!" />
  </target>

</project>