root/forge/star/build.xml

Revision 1968, 4.3 kB (checked in by mikey, 3 weeks ago)

write copyright year only once if start year is same as current year

Line 
1 <?xml version="1.0" encoding="utf-8"?>
2 <project name="star" basedir="." default="main">
3   <property name="pkg.dir" value="src/main/php/org/stubbles/star"/>
4   <property name="pkg.name" value="star-${version}"/>
5   <property name="build.src.dir" value="build/${pkg.name}"/>
6   <taskdef classname="phing.tasks.ext.d51PearPkg2Task" name="d51pearpkg2"/>
7
8   <target name="main" if="version" depends="test,build,package"/>
9
10   <target name="build" if="version" depends="versioncheck,copy-files,build-archives"/>
11
12   <target name="versioncheck" unless="version">
13     <php function="file_get_contents" returnProperty="version">
14       <param value="VERSION"/>
15     </php>
16     <echo>Version to be build: ${version}</echo>
17     <property name="pkg.name" value="star-${version}" override="true"/>
18     <property name="build.src.dir" value="build/${pkg.name}" override="true"/>
19   </target>
20
21   <target name="copy-files">
22     <echo>-----------------------------</echo>
23     <echo>| Creating directory layout |</echo>
24     <echo>-----------------------------</echo>
25     <delete dir="${build.src.dir}"/>
26     <copy file="LICENSE" tofile="${build.src.dir}/LICENSE"/>
27     <append destFile="${build.src.dir}/VERSION">star version ${version}</append>
28     <copy todir="${build.src.dir}">
29       <fileset dir="src/main/php/org/stubbles/phing">
30         <include name="**/*.php"/>
31       </fileset>
32     </copy>
33   </target>
34
35   <target name="build-archives" depends="versioncheck" if="version">
36     <echo>-----------------------------</echo>
37     <echo>| Creating star files       |</echo>
38     <echo>-----------------------------</echo>
39     <php function="file_get_contents" returnProperty="StarStreamWrapper">
40       <param value="src/main/php/org/stubbles/star/StarStreamWrapper.php"/>
41     </php>
42     <php function="file_get_contents" returnProperty="StarException">
43       <param value="src/main/php/org/stubbles/star/StarException.php"/>
44     </php>
45     <php function="file_get_contents" returnProperty="StarClassRegistry">
46       <param value="src/main/php/org/stubbles/star/StarClassRegistry.php"/>
47     </php>
48     <php function="file_put_contents">
49       <param value="${build.src.dir}/starReader.php"/>
50       <param value="${StarStreamWrapper}${StarException}${StarClassRegistry}&lt;?php StarStreamWrapper::register(); ?&gt;"/>
51     </php>
52     <exec command="php &quot;build.php&quot; -i &quot;src/main/resources/build/compile-writer-archive.ini&quot; -t &quot;${build.src.dir}/starWriter.php&quot; -r &quot;${pkg.dir}&quot;" passthru="true"/>
53     <exec command="php &quot;build.php&quot; -i &quot;src/main/resources/build/compile-writer-cli.ini&quot; -t &quot;${build.src.dir}/starWriter-cli.php&quot; -r &quot;${pkg.dir}&quot;" passthru="true"/>
54   </target>
55
56   <target name="package" description="Build the pear package" depends="create-package-xml">
57     <if>
58       <available file="build/star-${version}/package.xml" property="package.xml.exists"/>
59       <then>
60         <exec command="pear package" dir="build/star-${version}"/>
61         <move file="build/star-${version}/star-${version}.tgz" tofile="build/star-${version}.tgz" overwrite="true"/>
62       </then>
63     </if>
64   </target>
65
66   <target name="create-package-xml" depends="versioncheck">
67     <d51pearpkg2 dir="build/star-${version}" baseinstalldir="star">
68       <name>star</name>
69       <summary>Stubbles Archive file builder.</summary>
70       <channel>pear.php-tools.net</channel>
71       <description>
72         Tools to read and write stubbles archive (star) files.
73       </description>
74       <lead user="mikey" name="Frank Kleine" email="mikey@stubbles.net"/>
75       <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
76       <version release="${version}" api="${version}"/>
77       <stability release="alpha" api="alpha"/>
78       <dependencies>
79         <php minimum_version="5.2.0"/>
80         <pear minimum_version="1.6.0"/>
81       </dependencies>
82       <ignore>LICENSE</ignore>
83       <ignore>VERSION</ignore>
84
85       <changelog version="0.9.1" date="2008-12-19">
86         - write copyright year only once if start year is same as current year
87       </changelog>
88
89       <changelog version="0.9.0" date="2008-12-17">
90         - initial release as pear package
91       </changelog>
92
93     </d51pearpkg2>
94   </target>
95
96   <target name="test" description="run test suite">
97     <exec passthru="true" command="phpunit src_test_AllTests"/>
98   </target>
99 </project>
Note: See TracBrowser for help on using the browser.