scratch – Blame information for rev 117

Subversion Repositories:
Rev:
Rev Author Line No. Line
115 office 1 <?xml version="1.0"?>
2 <project name="DoctrineCommonCache" default="build" basedir=".">
3 <property file="build.properties" />
4  
5 <target name="php">
6 <exec executable="which" outputproperty="php_executable">
7 <arg value="php" />
8 </exec>
9 </target>
10  
11 <target name="prepare">
12 <mkdir dir="build" />
13 </target>
14  
15 <target name="build" depends="check-git-checkout-clean,prepare,php,composer">
16 <exec executable="${php_executable}">
17 <arg value="build/composer.phar" />
18 <arg value="archive" />
19 <arg value="--dir=build" />
20 </exec>
21 </target>
22  
23 <target name="composer" depends="php,composer-check,composer-download">
24 <exec executable="${php_executable}">
25 <arg value="build/composer.phar" />
26 <arg value="install" />
27 </exec>
28 </target>
29  
30 <target name="composer-check" depends="prepare">
31 <available file="build/composer.phar" property="composer.present"/>
32 </target>
33  
34 <target name="composer-download" unless="composer.present">
35 <exec executable="wget">
36 <arg value="-Obuild/composer.phar" />
37 <arg value="http://getcomposer.org/composer.phar" />
38 </exec>
39 </target>
40  
41 <target name="make-release" depends="check-git-checkout-clean,prepare,php">
42 <replace file="${project.version_file}" token="-DEV" value="" failOnNoReplacements="true" />
43 <exec executable="git" failonerror="true" outputproperty="current_git_branch">
44 <arg value="rev-parse" />
45 <arg value="--abbrev-ref" />
46 <arg value="HEAD" />
47 </exec>
48 <exec executable="${php_executable}" outputproperty="doctrine.current_version" failonerror="true">
49 <arg value="-r" />
50 <arg value="require_once '${project.version_file}';echo ${project.version_class}::VERSION;" />
51 </exec>
52 <exec executable="${php_executable}" outputproperty="doctrine.next_version" failonerror="true">
53 <arg value="-r" />
54 <arg value="$parts = explode('.', str_ireplace(array('-DEV', '-ALPHA', '-BETA'), '', '${doctrine.current_version}'));
55 if (count($parts) != 3) {
56 throw new \InvalidArgumentException('Version is assumed in format x.y.z, ${doctrine.current_version} given');
57 }
58 if ('${current_git_branch}' === 'master') {
59 $parts[1]++;
60 } else {
61 $parts[2]++;
62 }
63 echo implode('.', $parts);
64 " />
65 </exec>
66  
67 <git-commit file="${project.version_file}" message="Release ${doctrine.current_version}" />
68 <git-tag version="${doctrine.current_version}" />
69 <replace file="${project.version_file}" token="${doctrine.current_version}" value="${doctrine.next_version}-DEV" />
70 <git-commit file="${project.version_file}" message="Bump version to ${doctrine.next_version}" />
71 </target>
72  
73 <target name="check-git-checkout-clean">
74 <exec executable="git" failonerror="true">
75 <arg value="diff-index" />
76 <arg value="--quiet" />
77 <arg value="HEAD" />
78 </exec>
79 </target>
80  
81 <macrodef name="git-commit">
82 <attribute name="file" default="NOT SET"/>
83 <attribute name="message" default="NOT SET"/>
84  
85 <sequential>
86 <exec executable="git">
87 <arg value="add" />
88 <arg value="@{file}" />
89 </exec>
90 <exec executable="git">
91 <arg value="commit" />
92 <arg value="-m" />
93 <arg value="@{message}" />
94 </exec>
95 </sequential>
96 </macrodef>
97  
98 <macrodef name="git-tag">
99 <attribute name="version" default="NOT SET" />
100  
101 <sequential>
102 <exec executable="git">
103 <arg value="tag" />
104 <arg value="-m" />
105 <arg value="v@{version}" />
106 <arg value="v@{version}" />
107 </exec>
108 </sequential>
109 </macrodef>
110 </project>