Skip to content

Commit

Permalink
Merge branch 'feature/grunt-build' into release-1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam A.G. Shamblin committed Apr 10, 2014
2 parents ad308fa + e48ae43 commit 3feffbf
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 34 deletions.
1 change: 0 additions & 1 deletion .travis.yml
@@ -1,7 +1,6 @@
language: node_js
node_js:
- "0.10"
- "0.8"
notifications:
recipients:
- ci@imulus.com
67 changes: 67 additions & 0 deletions Gruntfile.js
@@ -0,0 +1,67 @@
module.exports = function (grunt) {
'use strict';

var addBanner = function (content, srcPath) {
var banner = grunt.config.get('banner');
banner = grunt.template.process(banner);
return banner.concat('\n', content);
};

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

banner: grunt.file.read('banner.txt'),
year: (function () {
return new Date().getFullYear();
})(),

clean: ['build', 'pkg'],

copy: {
README: {
src: 'README.md',
dest: 'build/README.md'
},
js: {
src: 'src/retina.js',
dest: 'build/js/retina-<%= pkg.version %>.js',
options: {
process: addBanner
}
},
less: {
src: 'src/retina.less',
dest: 'build/less/retina-<%= pkg.version %>.less',
options: {
process: addBanner
}
}
},

uglify: {
build: {
files: {
'build/js/retina-<%= pkg.version %>.min.js': ['src/retina.js']
}
}
},

compress: {
pkg: {
options: {
archive: 'pkg/retina-<%= pkg.version %>.zip'
},
files: [
{src: ['**'], cwd: 'build/', dest: '/', expand: true }
]
}
}
});

grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-compress');

grunt.registerTask('default', ['clean', 'copy', 'uglify', 'compress']);
};
32 changes: 0 additions & 32 deletions Makefile

This file was deleted.

9 changes: 9 additions & 0 deletions banner.txt
@@ -0,0 +1,9 @@
/*!
* Retina.js v<%= pkg.version %>
*
* Copyright <%= year %> Imulus, LLC
* Released under the MIT license
*
* Retina.js is an open source script that makes it easy to serve
* high-resolution images to devices with retina displays.
*/
7 changes: 6 additions & 1 deletion package.json
Expand Up @@ -5,7 +5,12 @@
"mocha": "*",
"should": "*",
"less": "*",
"node-sass": "*"
"node-sass": "*",
"grunt": "~0.4.4",
"grunt-contrib-copy": "~0.5.0",
"grunt-contrib-uglify": "~0.4.0",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-compress": "~0.7.0"
},
"main": "./src/retina",
"scripts": {
Expand Down

0 comments on commit 3feffbf

Please sign in to comment.