Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature/dynamic-con…
Browse files Browse the repository at this point in the history
…currency

Conflicts:
	CHANGELOG.md
	example/Gruntconfig.json
	test/test_assets/Gruntconfig.json
  • Loading branch information
Grayside committed Mar 18, 2015
2 parents 456058b + 4ac779a commit 56d95d0
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 30 deletions.
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,20 @@

### Upgrade Notes

- Remove --concurrency flag from your Gruntconfig. It will no logner be respected.
- Remove `--concurrency` flag from your Gruntconfig. It will no longer be respected.
- Ruby (bundler) will now install dependencies into `vendor/bundle`.
- Ruby and PHP upstream binaries are placed or symlinked from `vendor/bin`.
This frees up `bin/` for custom project scripts.
- Moving more default Gruntconfig.json into code for a slimmer project Gruntconfig.

### Upgrade Notes

- If you are using the default `Gruntconfig.json` example for bin paths on PHP
scripts, you should be fine.
- You may need to run `rm -Rf .bundle` to clear bundler configuration to make
way for the new install location.
- Gruntconfig.json no longer needs the `buildPaths` config key. Elements of
`buildPaths` added to your project Gruntconfig will override default behavior.

## v0.5.2 [2015/01/24]

Expand Down
18 changes: 17 additions & 1 deletion CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Drupal project. To download this template, you can use the following two
commands:

1. In an empty directory, run:
`npm install grunt grunt-drupal-tasks`
`npm install grunt-drupal-tasks`

2. Copy the contents of node_modules/grunt-drupal-tasks/example to your starting
directory, by running:
Expand Down Expand Up @@ -276,6 +276,22 @@ directly to
[grunt-contrib-compass](https://github.com/gruntjs/grunt-contrib-compass)
for this theme.

#### Setting Up Gem Dependencies

In order for compass compilation to work, you will need to create a Gemfile
at your project root. The presence of this Gemfile will activate the `grunt
bundle-install` task and automatically add it to the build process.

A typical Gemfile focused on SASS support might look like the following:

```ruby
source 'https://rubygems.org'

gem 'sass', '~>3.3.0'
gem 'compass', '~> 1.0.1'
gem 'json', '~>1.8.2'
```

### Validate Settings

This is an example of the settings for the validate tasks:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Code Status (master branch):
[![Travis CI status](https://travis-ci.org/phase2/grunt-drupal-tasks.svg?branch=master)](https://travis-ci.org/phase2/grunt-drupal-tasks)
[![Dependency Status](https://david-dm.org/phase2/grunt-drupal-tasks.svg)](https://david-dm.org/phase2/grunt-drupal-tasks)
[![Peer Dependency Status](https://david-dm.org/phase2/grunt-drupal-tasks/peer-status.svg)](https://david-dm.org/phase2/grunt-drupal-tasks#peer-badge-embed)
[![npm version](https://badge.fury.io/js/grunt-drupal-tasks.svg)](https://www.npmjs.com/package/grunt-drupal-tasks)

## Requirements
Expand Down
13 changes: 13 additions & 0 deletions bootstrap.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
var _ = require('lodash');

module.exports = function(grunt) {
// Initialize global configuration variables.
var config = grunt.file.readJSON('Gruntconfig.json');
Expand All @@ -11,6 +13,17 @@ module.exports = function(grunt) {
grunt.config('help', config.help);
}

// Set implicit global configuration.
var buildPaths = grunt.config('config.buildPaths');
buildPaths = _.extend({
build: 'build',
html: 'build/html',
package: 'build/packages',
reports: 'build/reports',
temp: 'build/temp'
});
grunt.config('config.buildPaths', buildPaths);

// Wrap Grunt's loadNpmTasks() function to change the current directory to
// grunt-drupal-tasks, so that module dependencies of it are found.
grunt._loadNpmTasks = grunt.loadNpmTasks;
Expand Down
2 changes: 2 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules
vendor

13 changes: 3 additions & 10 deletions example/Gruntconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@
"make": "src/project.make",
"drupal": "src"
},
"buildPaths": {
"build": "build",
"html": "build/html",
"package": "build/packages",
"reports": "build/reports",
"temp": "build/temp"
},
"siteUrls": {
"default": "http://project.local"
},
Expand All @@ -18,13 +11,13 @@
"projFiles": ["README*", "bin/**"]
},
"phpcs": {
"path": "bin/phpcs"
"path": "vendor/bin/phpcs"
},
"phpmd": {
"path": "bin/phpmd"
"path": "vendor/bin/phpmd"
},
"drush": {
"cmd": "bin/drush"
"cmd": "vendor/bin/drush"
},
"behat": {
"flags": "--tags ~@wip"
Expand Down
3 changes: 0 additions & 3 deletions example/composer.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"name": "client/project",
"description": "{Project} drupal codebase for {client}.",
"config": {
"bin-dir": "bin"
},
"require-dev": {
"behat/mink-zombie-driver": "~1.2",
"drupal/drupal-extension": "~3.0",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"grunt-phpcs": "git+https://github.com/grayside/grunt-phpcs.git#0.3.0",
"grunt-phplint": "0.0.5",
"grunt-phpmd": "0.1.1",
"grunt-shell": "1.1.1",
"grunt-shell": "1.1.2",
"lodash": "2.4.1",
"time-grunt": "1.0.0"
"time-grunt": "1.1.0"
},
"peerDependencies": {
"grunt": ">= 0.4.5 < 0.5"
Expand Down
2 changes: 1 addition & 1 deletion tasks/behat.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module.exports = function(grunt) {
options: _.extend({
config: './test/behat.yml',
maxProcesses: 5,
bin: './bin/behat',
bin: 'vendor/bin/behat',
debug: true,
env: {
"BEHAT_PARAMS": "{\"extensions\": {\"Drupal\\\\DrupalExtension\": {\"drupal\": {\"drupal_root\": \"./" + config.buildPaths.html + "\"}}, \"Behat\\\\MinkExtension\": {\"base_url\": \"" + config.siteUrls[key] + "\", \"zombie\": {\"node_modules_path\": \"" + process.cwd() + "/node_modules/\"}}}}"
Expand Down
2 changes: 1 addition & 1 deletion tasks/bundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = function(grunt) {

if (grunt.file.exists('Gemfile')) {
grunt.config(['shell', 'bundle-install'], {
command: "bundle install --binstubs=gems/bin"
command: "bundle install --binstubs=vendor/bin --path=vendor/bundle"
});
grunt.registerTask('bundleInstall', ['shell:bundle-install']);
grunt.registerTask('bundle-install', ['shell:bundle-install']);
Expand Down
3 changes: 2 additions & 1 deletion tasks/quality.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ module.exports = function(grunt) {
logConcurrentOutput: true
}
});
grunt.registerTask('analyze', ['concurrent:analyze']);

grunt.registerTask('analyze', ['mkdir:init', 'concurrent:analyze']);
}

grunt.config('help.validate', {
Expand Down
13 changes: 3 additions & 10 deletions test/test_assets/Gruntconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@
"make": "src/project.make",
"drupal": "src"
},
"buildPaths": {
"build": "build",
"html": "build/html",
"package": "build/packages",
"reports": "build/reports",
"temp": "build/temp"
},
"siteUrls": {
"default": "http://project.local"
},
Expand All @@ -18,13 +11,13 @@
"projFiles": ["README*", "bin/**"]
},
"phpcs": {
"path": "bin/phpcs"
"path": "vendor/bin/phpcs"
},
"phpmd": {
"path": "bin/phpmd"
"path": "vendor/bin/phpmd"
},
"drush": {
"cmd": "bin/drush"
"cmd": "vendor/bin/drush"
},
"behat": {
"flags": "--tags ~@wip"
Expand Down

0 comments on commit 56d95d0

Please sign in to comment.