Skip to content

Commit

Permalink
Resolves #221: Adding frontend-setup target-hook. (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
grasmash authored Aug 15, 2016
1 parent cd8d204 commit 53eca01
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion phing/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<then>
<echo>Executing command in ${target-hooks.${hook-name}.dir}:</echo>
<echo>${target-hooks.${hook-name}.command}</echo>
<exec dir="${target-hooks.${hook-name}.dir}" command="${target-hooks.${hook-name}.command}" logoutput="true" checkreturn="true" />
<exec dir="${target-hooks.${hook-name}.dir}" command="${target-hooks.${hook-name}.command}" logoutput="true" checkreturn="true" passthru="true" />
</then>
<else>
<fail>The directory ${target-hooks.${hook-name}.dir} does not exist. Will not run command for ${hook-name}.</fail>
Expand Down
12 changes: 11 additions & 1 deletion phing/tasks/frontend.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
<project name="frontend" default="frontend:install">
<project name="frontend" default="frontend">

<target name="frontend" description="Runs all frontend targets"
depends="frontend:setup, frontend:build">
</target>

<target name="frontend:setup" description="Uses project.yml hooks to run custom defined commands to setup front end dependencies for frontend:build.">
<phingcall target="target-hook:invoke">
<property name="hook-name" value="frontend-setup"/>
</phingcall>
</target>

<target name="frontend:build" description="Uses project.yml hooks to run custom defined commands to build front end dependencies for custom themes.">
<phingcall target="target-hook:invoke">
Expand Down
8 changes: 7 additions & 1 deletion template/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,17 @@ drush:
# The tasks hook into BLT's existing Phing targets. Available hooks keys are:
# frontend-build, post-deploy-build, and post-setup-build.
target-hooks:
# Executed when front end dependencies should be installed.
frontend-setup:
# E.g., ${docroot}/sites/all/themes/custom/mytheme.
dir: ${docroot}
# E.g., `npm install` or `bower install`.
command: echo 'No frontend setup configured.'
# Executed when front end assets should be generated.
frontend-build:
# E.g., ${docroot}/sites/all/themes/custom/mytheme.
dir: ${docroot}
# E.g., `npm install` or `bower install`.
# E.g., `npm run build`.
command: echo 'No frontend build configured.'
# Executed after deployment artifact is created.
post-deploy-build:
Expand Down

0 comments on commit 53eca01

Please sign in to comment.