Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue-221: Adds a frontend:setup task and also passthru for target-hooks #259

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion template/build/core/phing/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<if>
<available file="${target-hooks.${hook-name}.dir}" type="dir" property="dirExists" />
<then>
<exec dir="${target-hooks.${hook-name}.dir}" command="${target-hooks.${hook-name}.command}" logoutput="true" checkreturn="true" />
<exec dir="${target-hooks.${hook-name}.dir}" passthru="true" command="${target-hooks.${hook-name}.command}" logoutput="true" checkreturn="true" />
</then>
<else>
<fail>The directory ${target-hooks.${hook-name}.dir} does not exist. Will not run command for ${hook-name}.</fail>
Expand Down
8 changes: 7 additions & 1 deletion template/build/core/phing/tasks/frontend.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<project name="frontend" default="frontend:install">
<project name="frontend" default="frontend:setup">

<target name="frontend:setup" description="Uses project.yml hooks to run custom defined commands to setup front end dependencies for frontend:build.">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to update description.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@grasmash It is different, is "Uses project.yml hooks to run custom defined commands to setup front end dependencies for frontend:build." confusing?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, I guess I see what you did there. The frontend:build reference confused me initially.

<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 @@ -46,11 +46,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