Permalink
Browse files

Use Grunt for builds

  • Loading branch information...
1 parent 1d64f1e commit df7541622797a515f54cc273e2d81f2317bf9a1c @joelfillmore joelfillmore committed Dec 3, 2012
Showing with 76 additions and 21 deletions.
  1. +0 −21 build.sh
  2. +62 −0 grunt.js
  3. +14 −0 package.json
View
@@ -1,21 +0,0 @@
-# turn off output
-set +v
-
-# vars
-JS_OUTPUT=tiles.js
-SUCCESS=0
-
-echo "Concatenating JS files"
-
-# Create or overwrite existing file with header
-echo "/*! Tiles.js | http://thinkpixellab.com/tilesjs | $(date +%Y-%m-%d) */" > $JS_OUTPUT
-
-# combine files
-cat src/Tile.js >> $JS_OUTPUT
-cat src/Template.js >> $JS_OUTPUT
-cat src/UniformTemplates.js >> $JS_OUTPUT
-cat src/Grid.js >> $JS_OUTPUT
-
-echo "Done"
-echo ""
-exit $SUCCESS
View
@@ -0,0 +1,62 @@
+/*global module:false*/
+module.exports = function(grunt) {
+
+ // Project configuration.
+ grunt.initConfig({
+ pkg: '<json:package.json>',
+ meta: {
+ banner: '/*! <%= pkg.title %> | <%= pkg.homepage %> | ' +
+ '<%= grunt.template.today("yyyy-mm-dd") %> */'
+ },
+ lint: {
+ files: [
+ 'src/Tile.js',
+ 'src/Template.js',
+ 'src/UniformTemplates.js',
+ 'src/Grid.js'
+ ]
+ },
+ concat: {
+ dist: {
+ src: [ '<banner>', '<config:lint.files>' ],
+ dest: '<%= pkg.name %>.js'
+ },
+ },
+ min: {
+ dist: {
+ src: [ '<banner>', '<config:lint.files>' ],
+ dest: '<%= pkg.name %>.min.js'
+ },
+ },
+ watch: {
+ cj: {
+ files: '<config:lint.files>',
+ tasks: 'concat min'
+ }
+ },
+ jshint: {
+ options: {
+ curly: true,
+ eqeqeq: true,
+ immed: true,
+ latedef: true,
+ newcap: true,
+ noarg: true,
+ sub: true,
+ undef: true,
+ boss: true,
+ eqnull: true,
+ browser: true
+ },
+ globals: {
+ jQuery: true,
+ Tiles: true
+ }
+ },
+ uglify: {}
+ });
+
+ // by default only concat cj files
+ grunt.registerTask('default', 'lint concat min');
+
+};
View
@@ -0,0 +1,14 @@
+{
+ "name": "tiles",
+ "title": "Tiles.js",
+ "homepage": "http://thinkpixellab.com/tilesjs",
+ "author": {
+ "name": "Pixel Lab",
+ "url": "http://thinkpixellab.com"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "grunt": "~0.3.8"
+ },
+ "keywords": []
+}

0 comments on commit df75416

Please sign in to comment.