Browse Source

grunt: switch amberc task to use the 'options' property introduced in Grunt 0.4

Manfred Kroehnert 11 years ago
parent
commit
f9d97a35aa
2 changed files with 10 additions and 4 deletions
  1. 1 1
      Gruntfile.js
  2. 9 3
      grunt/tasks/grunt-amberc.js

+ 1 - 1
Gruntfile.js

@@ -28,7 +28,7 @@ module.exports = function(grunt) {
     },
 
     amberc: {
-      _config: {
+      options: {
         amber_dir: process.cwd(),
         closure_jar: ''
       },

+ 9 - 3
grunt/tasks/grunt-amberc.js

@@ -29,17 +29,23 @@ module.exports = function(grunt) {
    */
   grunt.registerMultiTask('amberc', 'Compile Smalltalk files with the amberc compiler', function() {
     // mark required properties
-    this.requiresConfig('amberc._config.amber_dir');
+    this.requiresConfig('amberc.options.amber_dir');
     this.requiresConfig(['amberc', this.target, 'src']);
 
+    var options = this.options({
+      amber_dir: undefined,
+      closure_jar: '',
+      verbose: false
+    });
+
     // mark task as async task
     var done = this.async();
 
     // create and initialize amberc
-    var compiler = new amberc.Compiler(grunt.config('amberc._config.amber_dir'), grunt.config('amberc._config.closure_jar'));
+    var compiler = new amberc.Compiler(grunt.config('amberc.options.amber_dir'), grunt.config('amberc.options.closure_jar'));
 
     // generate the amberc configuration out of the given target properties
-    var configuration = generateCompilerConfiguration(this.data, grunt.config('amberc._config.amber_dir'));
+    var configuration = generateCompilerConfiguration(this.data, grunt.config('amberc.options.amber_dir'));
 
     // run the compiler
     // change back to the old working directory and call the async callback once finished