Browse files

Added support for specifying revision to check out when cloning repos…

…itories.

NB: This required changes to property files. Updated default properties accordingly.
  • Loading branch information...
1 parent 424041d commit 2e9de7f0843c3640c92ab8ae2a313ba6c2ce828c @kasperg kasperg committed Oct 10, 2011
Showing with 34 additions and 17 deletions.
  1. +7 −4 build.default.properties
  2. +27 −13 build.xml
View
11 build.default.properties
@@ -24,10 +24,11 @@ project.code.prefix = your_prefix
project.code.custom = your_theme other_module
# The repository to clone for Phing PHPLoc task
-phing.phploc.repository = https://github.com/raphaelstolt/phploc-phing.git
+phing.phploc.repository.url = https://github.com/raphaelstolt/phploc-phing.git
+phing.phploc.repository.revision = 1.6.1
# The repository to clone for Phing Drush task
-phing.drush.repository = http://git.drupal.org/sandbox/mongolito404/1157574.git
+phing.drush.repository.url = http://git.drupal.org/sandbox/mongolito404/1157574.git
# The repository to clone for PHP CodeSniffer coding standards task
# NB: This is only required if using the phpcs target / PHP_Codesniffer
@@ -37,12 +38,14 @@ phpcs.drupalcs.repository = https://github.com/ericduran/drupalcs.git
jslint4java.url = http://jslint4java.googlecode.com/files/jslint4java-2.0.0-dist.zip
# The version of jslint to use
-jslint.repository = https://github.com/mikewest/JSLint.git
+jslint.repository.url = https://github.com/mikewest/JSLint.git
# The file within the repository containing jslint
jslint.file = fulljslint.js
# The version of csslint to use
-csslint.repository = https://github.com/stubbornella/csslint.git
+csslint.repository.url = https://github.com/stubbornella/csslint.git
+csslint.repository.revision = v0.6.1
+
# The csslint rules to use
# The current selection is based on discussion here: http://mattwilcox.net/archive/entry/id/1054/
csslint.rules = empty-rules,display-property-grouping,zero-units,vendor-prefix,gradients,box-model,import,important,compatible-vendor-prefixes,duplicate-properties
View
40 build.xml
@@ -270,7 +270,7 @@ from parent `lint-js` targets. -->
unless="project.jslint.setup">
<phingcall target="setup-git-repo">
<property name="repo.dir" value="${project.toolsdir}/jslint"/>
- <property name="repo.url" value="${jslint.repository}" />
+ <property name="repo.url" value="${jslint.repository.url}" />
</phingcall>
<!-- Other targets use this property to determine the location of the jslint
@@ -360,8 +360,12 @@ from parent `lint-css` targets. -->
depends="init"
unless="project.csslint.setup">
<phingcall target="setup-git-repo">
- <property name="repo.dir" value="${project.toolsdir}/csslint"/>
- <property name="repo.url" value="${csslint.repository}" />
+ <property name="repo.dir"
+ value="${project.toolsdir}/csslint"/>
+ <property name="repo.url"
+ value="${csslint.repository.url}" />
+ <property name="repo.revision"
+ value="${csslint.repository.revision}" />
</phingcall>
<!-- Other targets use this property to determine the location of the
@@ -525,7 +529,7 @@ statistics. -->
<!-- Clone the project -->
<phingcall target="setup-git-repo">
<property name="repo.dir" value="${project.toolsdir}/phing-phploc"/>
- <property name="repo.url" value="${phing.phploc.repository}" />
+ <property name="repo.url" value="${phing.phploc.repository.url}" />
</phingcall>
<!-- Register the custom Phing task -->
<taskdef name="phploc" classname="PHPLocTask"
@@ -687,7 +691,7 @@ Consequently `coder-review-d6/7` and not `phpcs` is used for the main targets.
PHP_CodeSniffer. -->
<phingcall target="setup-git-repo">
<property name="repo.dir" value="${project.toolsdir}/drupalcs"/>
- <property name="repo.url" value="${phpcs.drupalcs.repository}" />
+ <property name="repo.url" value="${phpcs.drupalcs.repository.url}" />
</phingcall>
<!-- There is no Phing task for PHP Codesniffer in v2.4.6.
It's coming for v2.5. Execute while we wait. -->
@@ -1169,12 +1173,18 @@ Configuration of which installation profile and database to use in done in
<if>
<not><available file="${repo.dir}" /></not>
<then>
- <echo>Cloning ${repo.url} into ${repo.dir}</echo>
- <!-- The [`gitclone` task](http://www.phing.info/docs/guide/stable/chapters/appendixes/AppendixC-OptionalTasks.html#GitCloneTask)
- does not seem to work. Use exec instead.
+ <if>
+ <not><isset property="repo.revision"/></not>
+ <then>
+ <property name="repo.revision" value="HEAD" />
+ </then>
+ </if>
- Do a [shallow copy](https://git.wiki.kernel.org/index.php/GitFaq#How_do_I_do_a_quick_clone_without_history_revisions.3F) to improve efficiency. -->
- <exec command="git clone ${repo.url} ${repo.dir} --depth 1" />
+ <echo>Cloning ${repo.url} ${repo.revision} into ${repo.dir}</echo>
+ <!-- The [`gitclone` task](http://www.phing.info/docs/guide/stable/chapters/appendixes/AppendixC-OptionalTasks.html#GitCloneTask)
+ does not seem to work. Use exec instead. -->
+ <exec command="git clone ${repo.url} ${repo.dir}" />
+ <exec command="git checkout ${repo.revision}" dir="${repo.dir}"/>
</then>
</if>
</target>
@@ -1201,10 +1211,14 @@ Configuration of which installation profile and database to use in done in
<!-- ### Setup Phing Drush integration -->
<target name="setup-phing-drush"
depends="setup-dirs" >
- <!-- Clone the project from Drupal.org -->
+ <!-- Clone the project -->
<phingcall target="setup-git-repo">
- <property name="repo.dir" value="${project.toolsdir}/phing-drush"/>
- <property name="repo.url" value="${phing.drush.repository}" />
+ <property name="repo.dir"
+ value="${project.toolsdir}/phing-drush"/>
+ <property name="repo.url"
+ value="${phing.drush.repository.url}" />
+ <property name="repo.revision"
+ value="${phing.drush.repository.revision}" />
</phingcall>
<!-- Register as custom Phing task -->

0 comments on commit 2e9de7f

Please sign in to comment.