Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## v0.5.0

- Moving main Grunt Drupal Tasks library code from Gruntfile.js to bootstrap.js
- Adding integration with OS notification features with grunt-notify
- Adding documentation for use with a continuous integration system
- Many dependency updates
- Other minor improvements
Expand Down
15 changes: 15 additions & 0 deletions CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,21 @@ This is an example of the settings for Drush tasks:
**drush.make.args**: An array of arguments to pass to Drush for the make
operation.

### Notify Settings

This is an example of the settings for the notify feature:

```
{
"notify": {
"threshold": 3
}
}
```

**notify.threshold**: Minimum number of seconds a task must execute for a
notification to be triggered when the task ends.

### Theme Settings

This is an example of the settings for theme tasks:
Expand Down
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,26 @@
"main": "bootstrap.js",
"dependencies": {
"grunt": "~0.4.5",
"grunt-available-tasks": "~0.5.0",
"grunt-composer": "~0.4.4",
"grunt-contrib-clean": "~0.6.0",
"grunt-contrib-copy": "~0.7.0",
"grunt-contrib-compass": "^1.0.1",
"grunt-contrib-compress": "~0.12.0",
"grunt-contrib-copy": "~0.7.0",
"grunt-contrib-symlink": "~0.3.0",
"grunt-contrib-watch": "~0.6.1",
"grunt-drush": "~0.0.3",
"grunt-mkdir": "~0.1.1",
"grunt-newer": "~0.8.0",
"grunt-shell": "^1.1.1",
"grunt-notify": "git+https://github.com/grayside/grunt-notify.git#0.5.0",
"grunt-parallel": "^0.3.1",
"grunt-parallel-behat": "~0.3.6",
"grunt-phplint": "~0.0.5",
"grunt-phpcs": "git+https://github.com/grayside/grunt-phpcs.git#0.3.0",
"grunt-contrib-compress": "~0.12.0",
"grunt-phplint": "~0.0.5",
"grunt-phpmd": "~0.1.0",
"time-grunt": "^1.0.0",
"grunt-parallel": "^0.3.1",
"grunt-available-tasks": "~0.5.0",
"lodash": "^2.4.1"
"grunt-shell": "^1.1.1",
"lodash": "^2.4.1",
"time-grunt": "^1.0.0"
},
"keywords": [
"build",
Expand All @@ -33,6 +34,6 @@
],
"repository": {
"type": "git",
"url" : "https://github.com/phase2/grunt-drupal-tasks.git"
"url": "https://github.com/phase2/grunt-drupal-tasks.git"
}
}
29 changes: 29 additions & 0 deletions tasks/notify.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module.exports = function(grunt) {

/**
* Define "notify" tasks.
*/
if (grunt.option('quiet') || process.env.GRUNT_DRUPAL_QUIET) {
return;
}

grunt.loadNpmTasks('grunt-notify');
var guessProjectName = require('grunt-notify/lib/util/guessProjectName');

grunt.config('notify_hooks', {
options: {
// title needs to be reset to the same as the grunt-notify default because
// the guessing mechanism thinks that grunt-drupal-tasks is the project.
title: guessProjectName(),
// Only trigger success messages if the process has taken longer than the
// configured notifyThreshold.
success: true,
threshold: grunt.config.get('config.notify.threshold') || 10,
duration: 5
}
});

// This is required if you use any options.
grunt.task.run('notify_hooks');

};