Permalink
Browse files

more grunt tasks

  • Loading branch information...
weikinhuang committed Mar 7, 2013
1 parent ba7657e commit 42cf8198ffbd1bfd5d597b54549ba0f6e55db535
Showing with 11 additions and 147 deletions.
  1. +8 −2 Gruntfile.js
  2. +1 −144 config.js
  3. +2 −1 package.json
View
@@ -68,13 +68,19 @@ module.exports = function(grunt) {
}
});
- // grunt.loadNpmTasks("grunt-compare-size");
+ grunt.loadNpmTasks("grunt-compare-size");
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-qunit");
+ // grunt.loadNpmTasks("grunt-contrib-nodeunit");
grunt.loadNpmTasks("grunt-qunit-cov");
// Default grunt
- grunt.registerTask("default", [ "concat", "jshint", "uglify", "qunit", "qunit-cov" ]);
+ grunt.registerTask("default", [ "concat", "jshint", "uglify" ]);
+
+ // Other tasks
+ grunt.registerTask("lint", [ "concat", "jshint" ]);
+ grunt.registerTask("test", [ "qunit" ]);
+ grunt.registerTask("coverage", [ "qunit", "qunit-cov" ]);
};
View
145 config.js
@@ -1,88 +1,12 @@
module.exports = function(build) {
- // set basic info about the repo
- build.setNameVersion("classify", "0.10.1");
-
- // set the url of this repo
- build.setRepoName("https://github.com/weikinhuang/Classify");
-
- // adds a list of files that will be parsed
- build.addSourceFile("core.js", "create.js", "mutator.static.js", "mutator.nowrap.js", "mutator.alias.js", "mutator.bind.js", "observer.js", "mutator.observable.js", "namespace.js", "export.js");
-
- // adds a list of unit tests files that will be run
- build.addUnitTestFile("core.js", "create.js", "mutator.static.js", "mutator.nowrap.js", "mutator.alias.js", "mutator.bind.js", "observer.js", "mutator.observable.js", "namespace.js", "export.js");
-
// adds a list of benchmark tests that will be run
build.addBenchmarkFile("create.js");
- // adds any dependencies that are required
- build.addExternalFile();
-
- // adds any copy, headers, footers to the js file
- build.addCopyright("copyright.js");
- build.addSourceWrap("wrap.js");
-
// sets the list of environments that this code can run against
build.enableEnvironment("node", "web");
// set the default set of tasks that should be run by default when called with no build args
- build.setDefaultTasks("lint", "unit", "size", "clean", "concat", "min");
-
- // set linting options
- build.addTaskOptions("lint", {
- // run the linter on a per file basis
- perFile : false,
- // the options to run the linter with
- options : {
- latedef : true,
- noempty : true,
- undef : true,
- strict : true,
- node : true,
- browser : true,
- quotmark : "double",
- maxcomplexity : 7,
- predef : []
- }
- });
-
- // set uglify minification options
- build.addTaskOptions("min", {
- strict_semicolons : true,
- unsafe : true,
- lift_vars : true,
- consolidate : false,
- mangle : {
- toplevel : false,
- defines : {},
- except : [],
- no_functions : false
- },
- squeeze : {
- make_seqs : true,
- dead_code : true
- },
- generate : {
- ascii_only : false,
- beautify : false,
- indent_level : 4,
- indent_start : 0,
- quote_keys : false,
- space_colon : false,
- inline_script : false
- },
- // function to run to modify any code before the minification process
- preparse : function(src) {
- // Previously done in sed but reimplemented here due to portability issues
- src = src.replace(/^(\s*\*\/)(.+)/m, "$1\n$2");
-
- var proto = (/(\w+)\s*=\s*"prototype"/).exec(src);
- if (proto) {
- src = src.replace(/\.prototype\b/g, "[" + proto[1] + "]");
- }
-
- return src;
- }
- });
+ build.setDefaultTasks("unit", "size");
// set options for the documentation generator
build.addTaskOptions("doc", {
@@ -104,71 +28,4 @@ module.exports = function(build) {
"examples/mutator.static.js"
]
});
-
- // set options for the package file generator
- build.addTaskOptions("pkg", {
- file : "package.json",
- desc : {
- name : "classifyjs",
- description : "Classify.js is a library that allows for cross platform and cross browser Object Oriented Javascript class definitions using classical inheritance and namespaces behind the prototype syntax in an easy to use interface function.",
- keywords : [ "util", "functional", "server", "client", "browser", "prototype", "object-oriented", "class", "classes", "inheritance", "abstraction" ],
- author : "Wei Kin Huang <wei@closedinterval.com>",
- version : "@VERSION",
- homepage : "http://classifyjs.com",
- repository : {
- type : "git",
- url : "https://github.com/weikinhuang/Classify.git"
- },
- bugs : {
- url : "https://github.com/weikinhuang/Classify/issues"
- },
- licenses : [ {
- type : "MIT",
- url : "https://github.com/weikinhuang/Classify/blob/master/MIT-LICENSE.txt"
- } ],
- main : "dist/classify"
- }
- });
-
- // set the options for running unit tests against browserstack
- build.addTaskOptions("browserstack", {
- browsers : [
- // win - ie
- { browser : "ie", version : "6.0", os : "win" },
- { browser : "ie", version : "7.0", os : "win" },
- { browser : "ie", version : "8.0", os : "win" },
- { browser : "ie", version : "9.0", os : "win" },
- { browser : "ie", version : "10.0", os : "win" },
- // win - chrome
- { browser : "chrome", version : "17.0", os : "win" },
- { browser : "chrome", version : "20.0", os : "win" },
- // win - firefox
- { browser : "firefox", version : "3.6", os : "win" },
- { browser : "firefox", version : "4.0", os : "win" },
- { browser : "firefox", version : "13.0", os : "win" },
- // win - opera
- { browser : "opera", version : "10.0", os : "win" },
- { browser : "opera", version : "11.6", os : "win" },
- // win - safari
- { browser : "safari", version : "4.0", os : "win" },
- { browser : "safari", version : "5.1", os : "win" },
- // mac - safari
- { browser : "safari", version : "4.0", os : "mac" },
- { browser : "safari", version : "5.1", os : "mac" },
- // mac - chrome
- { browser : "chrome", version : "19.0", os : "mac" },
- // mac - firefox
- { browser : "firefox", version : "5.0", os : "mac" },
- { browser : "firefox", version : "13.0", os : "mac" },
- // mac - opera
- { browser : "opera", version : "11.6", os : "mac" },
- { browser : "opera", version : "12.0", os : "mac" },
- // mobile
- { device: 'iPad 2', version: '4.3.2', os: 'ios' },
- { device: 'Samsung Galaxy Nexus', version: '4.0.3', os: 'android' },
- { device: 'Samsung Galaxy S II', version: '2.3', os: 'android' },
- { device: 'Google Nexus 7', version: '4.1', os: 'android' },
- { device: 'Samsung Galaxy S II', version: '480x800', os: 'opera' }
- ]
- });
};
View
@@ -41,6 +41,7 @@
"grunt-compare-size": "0.3.1",
"grunt-benchmark": "~0.1.3",
"grunt-qunit-cov": "~0.3.2",
- "grunt-lib-phantomjs": "~0.2.0"
+ "grunt-lib-phantomjs": "~0.2.0",
+ "grunt-contrib-yuidoc": "~0.4.0"
}
}

0 comments on commit 42cf819

Please sign in to comment.