| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- <?xml version="1.0" encoding="utf-8"?>
- <project name="CakePHP" default="build">
- <!--
- Build.xml file for CakePHP
- Uses phing to create releases.
- Based off of build.xml in doctrine.
- Use the `release` task to update VERSION.txt, and create a new tag.
- -->
- <property file="build.properties" />
- <!-- Read the current version, so we can replace it -->
- <target name="current-version">
- <exec executable="php" outputProperty="version">
- <arg value="-r" />
- <arg value="$fh = file('./VERSION.txt'); echo array_pop($fh);" />
- </exec>
- </target>
- <!--
- Updates the local copy to the latest head.
- -->
- <target name="update-branch">
- <echo msg="Updating to latest master." />
- <exec executable="git pull">
- <arg value="${git.remote}" />
- <arg value="master" />
- </exec>
- </target>
- <!--
- Bump the version number and commit that.
- -->
- <target name="next-version" depends="current-version">
- <echo msg="Incrementing version." />
- <propertyprompt propertyName="release_version" defaultValue="${version}" promptText="Enter version to be released."/>
- <echo msg="$file = file_get_contents('./VERSION.txt'); $file = str_replace('${version}', '${release_version}', $file); file_put_contents('./VERSION.txt', $file);" />
- <exec executable="php">
- <arg value="-r" />
- <arg value="$file = file_get_contents('./VERSION.txt'); $file = str_replace('${version}', '${release_version}', $file); file_put_contents('./VERSION.txt', $file);" />
- </exec>
- <echo msg="Version number updated." />
- <property name="version" value="${release_version}" override="true" />
- </target>
- <!--
- Create the release commit that updates the version number and pushes the commits.
- -->
- <target name="release-commit" depends="update-branch,next-version">
- <echo msg="Creating new release commit" />
- <exec command="git add ./VERSION.txt" logoutput="true" checkreturn="true" />
- <exec command="git commit -m 'Update version number to ${release_version}'" logoutput="true" checkreturn="true" />
- <exec command="git tag -s ${release_version} -m 'CakePHP ${release_version}'" logoutput="true" checkreturn="true" />
- <propertyprompt propertyName="shipit" defaultValue="n" promptText="Ship the new commit and tag?" />
- <condition property="noshipit" value="1">
- <equals arg1="n" arg2="${shipit}" casesensitive="false" />
- </condition>
- <fail if="noshipit" msg="You said not to ship it." />
- <echo msg="Pushing commit and tag." />
- <exec command="git push ${git.remote}" logoutput="true" checkreturn="true" />
- <exec command="git push ${git.remote} ${release_version}" logoutput="true" checkreturn="true" />
- <echo msg="Push complete." />
- </target>
- <target name="codestyle" description="Check codestyle (human readable format)">
- <phpcodesniffer
- standard="CakePHP"
- allowedFileExtensions="php">
- <fileset refid="libs" />
- </phpcodesniffer>
- </target>
- <target name="reports-ci">
- <phpcodesniffer
- standard="CakePHP"
- allowedFileExtensions="php">
- <fileset refid="libs" />
- <formatter type="checkstyle" outfile="checkstyle.xml" />
- </phpcodesniffer>
- <phpcpd
- minLines="4"
- minTokens="50">
- <fileset refid="libs" />
- <formatter type="pmd" outfile="pmd-cpd.xml"/>
- </phpcpd>
- <phpdepend>
- <fileset refid="libs" />
- <logger type="jdepend-xml" outfile="jdepend.xml"/>
- </phpdepend>
- <phpmd rulesets="codesize,unusedcode,design">
- <fileset refid="libs" />
- <formatter type="xml" outfile="reports/pmd.html"/>
- </phpmd>
- </target>
- <!--
- Top level easy to type targets
- -->
- <target name="release" depends="release-commit" description="Release a new version of CakePHP" />
- <target name="code-reports" depends="reports-ci"
- description="Run the code reports, generating XML output for CI server use." />
- </project>
|