Skip to content

Commit

Permalink
Add 'banner' info when compiling/minifying sources
Browse files Browse the repository at this point in the history
  • Loading branch information
emmenko committed Jun 10, 2013
1 parent 6656a5e commit 6ebbda0
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 31 deletions.
36 changes: 34 additions & 2 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,26 @@ module.exports = (grunt)->
# load package information
pkg: grunt.file.readJSON 'package.json'

meta:
banner: "/* ===========================================================\n" +
"# <%= pkg.name %> - v<%= pkg.version %>\n" +
"# <%= pkg.homepage %>\n" +
"# ==============================================================\n" +
"# Copyright 2012-2013 <%= pkg.author.name %>\n" +
"#\n" +
"# Licensed under the Apache License, Version 2.0 (the \"License\");\n" +
"# you may not use this file except in compliance with the License.\n" +
"# You may obtain a copy of the License at\n" +
"#\n" +
"# http://www.apache.org/licenses/LICENSE-2.0\n" +
"#\n" +
"# Unless required by applicable law or agreed to in writing, software\n" +
"# distributed under the License is distributed on an \"AS IS\" BASIS,\n" +
"# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" +
"# See the License for the specific language governing permissions and\n" +
"# limitations under the License.\n" +
"*/\n"

coffeelint:
options:
indentation:
Expand All @@ -23,7 +43,16 @@ module.exports = (grunt)->
default: "build"
test: "test/build"

concat:
options:
banner: "<%= meta.banner %>"
default:
src: "build/js/bootstrap-tour.js"
dest: "build/js/bootstrap-tour.js"

coffee:
options:
banner: "<%= meta.banner %>"
default:
src: "src/coffee/bootstrap-tour.coffee"
dest: "build/js/bootstrap-tour.js"
Expand All @@ -45,6 +74,8 @@ module.exports = (grunt)->
yuicompress: true

uglify:
options:
banner: "<%= meta.banner %>"
default:
src: "build/js/bootstrap-tour.js"
dest: "build/js/bootstrap-tour.min.js"
Expand All @@ -53,7 +84,7 @@ module.exports = (grunt)->
watch:
default:
files: ["src/coffee/*.coffee"]
tasks: ["clean:default", "coffeelint:default", "coffee:default", "uglify"]
tasks: ["clean:default", "coffeelint:default", "coffee:default", "concat", "uglify"]
test:
files: ["test/spec/*.coffee"]
tasks: ["clean:test", "coffeelint:test", "coffee:test", "jasmine"]
Expand Down Expand Up @@ -106,6 +137,7 @@ module.exports = (grunt)->
# load plugins that provide the tasks defined in the config
grunt.loadNpmTasks "grunt-coffeelint"
grunt.loadNpmTasks "grunt-contrib-clean"
grunt.loadNpmTasks "grunt-contrib-concat"
grunt.loadNpmTasks "grunt-contrib-coffee"
grunt.loadNpmTasks "grunt-contrib-less"
grunt.loadNpmTasks "grunt-contrib-uglify"
Expand All @@ -117,6 +149,6 @@ module.exports = (grunt)->

# register tasks
grunt.registerTask "run", ["connect", "open", "watch:doc"]
grunt.registerTask "build", ["clean:default", "coffeelint", "coffee:default", "coffee:doc", "less", "uglify", "copy"]
grunt.registerTask "build", ["clean:default", "coffeelint", "coffee:default", "coffee:doc", "concat", "less", "uglify", "copy"]
grunt.registerTask "test", ["clean:test", "coffeelint:test", "coffee:test", "jasmine"]
grunt.registerTask "default", ["watch:default"]
8 changes: 3 additions & 5 deletions build/js/bootstrap-tour.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ============================================================
# bootstrap-tour.js v0.4.0
# http://bootstraptour.com/
/* ===========================================================
# bootstrap-tour - v0.4.0
# http://bootstraptour.com
# ==============================================================
# Copyright 2012-2013 Ulrich Sossou
#
Expand All @@ -16,8 +16,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
*/


(function() {
(function($, window) {
var Tour, document;
Expand Down
18 changes: 18 additions & 0 deletions build/js/bootstrap-tour.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions docs/assets/js/bootstrap-tour.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ============================================================
# bootstrap-tour.js v0.4.0
# http://bootstraptour.com/
/* ===========================================================
# bootstrap-tour - v0.4.0
# http://bootstraptour.com
# ==============================================================
# Copyright 2012-2013 Ulrich Sossou
#
Expand All @@ -16,8 +16,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
*/


(function() {
(function($, window) {
var Tour, document;
Expand Down
Loading

0 comments on commit 6ebbda0

Please sign in to comment.