Skip to content

Commit

Permalink
Update build script with versioning and gulp tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
iMattPro committed Aug 27, 2015
1 parent 24e0eba commit 7fbfcc0
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,22 @@
</then>
</if>

<phingcall target="gulp-task">
<property name="dir" value="${package-directory}" />
</phingcall>

<phingcall target="clean-package">
<property name="dir" value="${package-directory}" />
</phingcall>

<!-- Try setting the package version property from composer.json -->
<exec dir="${package-directory}"
command='php -r "\$j = json_decode(file_get_contents(\"composer.json\")); echo (isset(\$j->version) ? \$j->version : \"${version}\");"'
checkreturn="true"
outputProperty='package-version' />

<phingcall target="wrap-package">
<property name="destination-filename" value="${build-directory}/upload/${vendor-name}_${extension-name}-${version}" />
<property name="destination-filename" value="${build-directory}/upload/${vendor-name}_${extension-name}_${package-version}" />
</phingcall>
</target>

Expand All @@ -105,4 +115,19 @@
<echo msg="Creating archives (${vendor-name}/${extension-name} ${version})" />
<zip basedir="${build-directory}/package/" destfile="${destination-filename}.zip" />
</target>

<!--
npm installation
-->
<target name="npm-install" description="npm-install target: install node modules">
<exec command="npm install" dir="${package-directory}" passthru="true" checkreturn="true" />
</target>

<!--
Run gulp task
-->
<target name="gulp-task" depends="npm-install">
<exec command="gulp" dir="${package-directory}" passthru="true" checkreturn="true" />
</target>

</project>

0 comments on commit 7fbfcc0

Please sign in to comment.