Skip to content

Commit

Permalink
Update grunt based build system
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgreg committed Sep 13, 2013
1 parent baa11d1 commit ab2c367
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 61 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
dist
node_modules
71 changes: 71 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
module.exports = function(grunt) {

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
dist: {
src: ['src/js/jquery-1.8.2.min.js', 'src/js/jquery.mobile-1.2.0.min.js', 'src/js/jqm.page.params.js', 'src/js/Markdown.Converter.js', 'src/js/Markdown.Sanitizer.js', 'src/js/underscore-min.js', 'src/js/thermomix-main.js', 'src/js/thermomix-data.js', 'src/js/thermomix-controller.js', 'src/js/thermomix-views.js' ],
dest: 'dist/js/thermomix-recipes.js'
}
},
uglify: {
options: {
banner: '/*! Thermomix-recipes - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
'* https://github.com/paulgreg/thermomix-recipes/\n' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> ' +
'Grégory PAUL; Licensed GPLv2 */'
},
dist: {
files: {
'dist/js/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>']
}
}
},
qunit: {
files: ['tests/*.html']
},
jshint: {
files: ['Gruntfile.js', 'src/js/thermomix-*.js'],
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true,
browser: true,
globals: {
'$': true,
'jQuery': true,
'_': true,
'alert': true,
'confirm': true,
'xhr': true,
'module': true,
'console': true,
'Markdown': true
}
},
},
watch: {
files: '<jshint.files>',
tasks: ['jshint', 'qunit']
}
});

// Default task.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');

grunt.registerTask('test', ['jshint', 'qunit']);

grunt.registerTask('default', ['jshint', 'qunit', 'concat', 'uglify']);

};
60 changes: 0 additions & 60 deletions grunt.js

This file was deleted.

12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "thermomix-recipes",
"version": "0.1.1",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-uglify": "~0.2.0",
"grunt-contrib-jshint": "~0.6.4",
"grunt-contrib-qunit": "~0.2.2",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-watch": "~0.5.3"
}
}
2 changes: 1 addition & 1 deletion rakefile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}

puts "Concatening and minifying JS files"
system "grunt concat min"
system "grunt"

puts "Removing non minified css/js files"
FileUtils.rm "#{BUILD_DIR}/js/thermomix-recipes.js"
Expand Down

0 comments on commit ab2c367

Please sign in to comment.