Skip to content

Commit

Permalink
distribute target works
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jan 8, 2012
1 parent af5fe31 commit ca99ebf
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 deletions.
2 changes: 2 additions & 0 deletions build.properties
Expand Up @@ -8,3 +8,5 @@ git.remote =
build.dir = build
dist.dir = dist

# Server
pirum.dir = /home/cakephp/www-live/pear.cakephp.org
39 changes: 23 additions & 16 deletions build.xml
Expand Up @@ -48,11 +48,7 @@
</target>

<!-- makes directories and sets properties -->
<target name="prepare" depends="clean">
<echo msg="Creating build + dist directories." />
<mkdir dir="${build.dir}" />
<mkdir dir="${dist.dir}" />

<target name="prepare">
<exec executable="php" outputProperty="version">
<arg value="-r" />
<arg value="$fh = file('./lib/Cake/VERSION.txt'); echo array_pop($fh);" />
Expand Down Expand Up @@ -81,18 +77,25 @@
<arg value="echo str_replace(array('-'), array(''), '${version}');" />
</exec>

<!-- Used for other targets -->
<property name="pear.package" value="${project.name}-${pear.version}" />

<echo msg="Preparing package of ${version} (${pear.version}+${pear.stability})" />
</target>

<!--
Copy all the files to build/ so they can be packaged up.
-->
<target name="copy-files" depends="prepare">
<target name="copy-files" depends="clean,prepare">
<echo msg="Creating build + dist directories." />
<mkdir dir="${build.dir}" />
<mkdir dir="${dist.dir}" />

<echo msg="Copying files to build directory" />
<copy todir="${build.dir}/${project.name}-${version}/Cake">
<copy todir="${build.dir}/${pear.package}/Cake">
<fileset refid="libs" />
</copy>
<copy todir="${build.dir}/${project.name}-${version}/bin">
<copy todir="${build.dir}/${pear.package}/bin">
<fileset refid="cli" />
</copy>
</target>
Expand All @@ -101,10 +104,10 @@
Define the package.xml. Using xml to make xml is fun!
-->
<target name="define-pear-package" depends="copy-files">
<d51pearpkg2 baseinstalldir="/" dir="${build.dir}/${project.name}-${version}">
<d51pearpkg2 baseinstalldir="/" dir="${build.dir}/${pear.package}">
<name>CakePHP</name>
<summary>CakePHP Rapid Development Framework</summary>
<channel>pear.php.net</channel>
<channel>pear.cakephp.org</channel>
<description>CakePHP is a application development framework for PHP 5.2+</description>
<lead user="mark_story" name="Mark Story" email="mark@mark-story.com" />
<lead user="lorenzo" name="José Lorenzo Rodríguez" email="jose.zap@gmail.com" />
Expand All @@ -129,9 +132,9 @@

<!-- Generate the PEAR package from a directory and move the files to the dist folder -->
<target name="generate-package" depends="define-pear-package">
<exec command="pear package" dir="${build.dir}/${project.name}-${version}" passthru="true"/>
<echo msg="Moving ${project.name}-${pear.version}.tgz"/>
<move file="${build.dir}/${project.name}-${version}/${project.name}-${pear.version}.tgz" todir="${dist.dir}" />
<exec command="pear package" dir="${build.dir}/${pear.package}" passthru="true"/>
<echo msg="Moving ${pear.package}.tgz"/>
<move file="${build.dir}/${pear.package}/${pear.package}.tgz" todir="${dist.dir}" />
</target>

<!--
Expand Down Expand Up @@ -161,7 +164,7 @@
<condition property="noshipit" value="1">
<not>
<equals arg1="y" arg2="${shipit}" casesensitive="false" />
</not>
</not>"
</condition>
<fail if="noshipit" msg="You said not to ship it." />

Expand All @@ -173,8 +176,12 @@
<!--
Upload to pirum pear channel.
-->
<target name="distribute">

<target name="distribute" depends="prepare">
<echo msg="Uploading tgz file to cakephp.org" />
<exec command="scp ${dist.dir}/${pear.package}.tgz cakephp@cakephp.org:${pirum.dir}" dir="." />

<echo msg="Adding new release to pirum" />
<exec command="ssh cakephp@cakephp.org pirum add ${pirum.dir} ${pirum.dir}/${pear.package}.tgz" />
</target>

<!--
Expand Down

0 comments on commit ca99ebf

Please sign in to comment.