Skip to content
Permalink
Browse files

Replace Makefile with GruntJS

A rebase (against soon-to-be 3.0.0-rc.1) & squash of
#7786 AKA
#7786
originally by
@seriema
@mokkabonna
@jojohess

Rebased by @cvrebert
  • Loading branch information
seriema authored and cvrebert committed May 4, 2013
1 parent 995add1 commit 0d33455ef486d0cf06cb29d427efda57f42f7ea9
Showing with 898 additions and 812 deletions.
  1. +3 −1 .travis.yml
  2. +124 −0 Gruntfile.js
  3. +0 −107 Makefile
  4. +14 −11 README.md
  5. +1 −1 dist/css/bootstrap.css
  6. +1 −1 dist/css/bootstrap.min.css
  7. +664 −651 dist/js/bootstrap.js
  8. +4 −4 dist/js/bootstrap.min.js
  9. +0 −3 js/tests/index.html
  10. +8 −7 js/tests/unit/button.js
  11. +69 −21 js/tests/unit/phantom.js
  12. +10 −5 package.json
@@ -1,3 +1,5 @@
language: node_js
node_js:
- 0.6
- 0.8
before_script:
- npm install -g grunt-cli
@@ -0,0 +1,124 @@
module.exports = function(grunt) {

// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('package.json'),
banner: '/**\n' +
'* <%= pkg.name %>.js v<%= pkg.version %> by @fat and @mdo\n' +
'* Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
'* <%= _.pluck(pkg.licenses, "url").join(", ") %>\n' +
'*/\n',
// Task configuration.
clean: {
dist: ['dist']
},
concat: {
options: {
banner: '<%= banner %>',
stripBanners: false
},
bootstrap: {
src: ['js/*.js'],
dest: 'dist/js/<%= pkg.name %>.js'
}
},
jshint: {
options: {
jshintrc: 'js/.jshintrc'
},
gruntfile: {
src: 'Gruntfile.js'
},
src: {
src: ['js/*.js']
},
test: {
src: ['js/tests/unit/*.js']
}
},
recess: {
options: {
compile: true
},
bootstrap: {
files: {
'dist/css/bootstrap.css': ['less/bootstrap.less']
}
},
min: {
options: {
compress: true
},
files: {
'dist/css/bootstrap.min.css': ['less/bootstrap.less']
}
}
},
uglify: {
options: {
banner: '<%= banner %>'
},
bootstrap: {
files: {
'dist/js/<%= pkg.name %>.min.js': ['<%= concat.bootstrap.dest %>']
}
}
},
qunit: {
options: {
inject: 'js/tests/unit/phantom.js'
},
files: ['js/tests/*.html']
},
connect: {
server: {
options: {
port: 3000,
base: '.'
}
}
},
watch: {
src: {
files: '<%= jshint.src.src %>',
tasks: ['jshint:src', 'qunit']
},
test: {
files: '<%= jshint.test.src %>',
tasks: ['jshint:test', 'qunit']
},
recess: {
files: 'less/*.less',
tasks: ['recess']
}
}
});


// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-recess');


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

// JS distribution task.
grunt.registerTask('dist-js', ['concat', 'uglify']);

// CSS distribution task.
grunt.registerTask('dist-css', ['recess']);

// Full distribution task.
grunt.registerTask('dist', ['clean', 'dist-css', 'dist-js']);

// Default task.
grunt.registerTask('default', ['test', 'dist']);
};
107 Makefile

This file was deleted.

@@ -46,33 +46,36 @@ Documentation for v2.3.2 has been made available for the time being at [http://g

## Compiling CSS and JavaScript

Bootstrap includes a [makefile](Makefile) with convenient methods for working with the framework. Before getting started, install [the necessary local dependencies](package.json):
Bootstrap uses [GruntJS](http://gruntjs.com/) with convenient methods for working with the framework. Before getting started, be sure to have `grunt-cli` installed globally (`npm install -g grunt-cli`) and then install [the necessary local dependencies](package.json):

```
# if grunt-cli isn't already installed
$ npm install -g grunt-cli
$ npm install
```

When completed, you'll be able to run the various make commands provided.
When completed, you'll be able to run the various grunt commands provided.

**Unfamiliar with `npm`? Don't have node installed?** That's a-okay. npm stands for [node packaged modules](http://npmjs.org/) and is a way to manage development dependencies through node.js. [Download and install node.js](http://nodejs.org/download/) before proceeding.

### Available makefile commands
### Available grunt commands

#### Build - `make`
`make` runs the Recess compiler to rebuild the `/less` files and compile the docs. **Requires recess and uglify-js.**
#### Build - `grunt`
`grunt` runs the Recess compiler to rebuild the `/less` files and compile the docs. **Requires recess and uglify-js.**

#### Compile CSS, JS, and fonts - `make bootstrap`
`make bootstrap` creates the `/bootstrap` directory with compiled files. **Requires recess and uglify-js.**
#### Compile CSS, JS, and fonts - `grunt bootstrap`
`grunt bootstrap` creates the `/bootstrap` directory with compiled files. **Requires recess and uglify-js.**

#### Tests - `make test`
#### Tests - `grunt test`
Runs jshint and qunit tests headlessly in [phantomjs](http://code.google.com/p/phantomjs/) (used for ci). **Requires phantomjs.**

#### Watch - `make watch`
This is a convenience method for watching just Less files and automatically building them whenever you save. **Requires the watchr gem.**
#### Watch - `grunt watch`
This is a convenience method for watching just Less files and automatically building them whenever you save.

### Troubleshooting dependencies

Should you encounter problems with installing dependencies or running makefile commands, uninstall all previous dependency versions (global and local). Then, rerun `npm install`.
Should you encounter problems with installing dependencies or running grunt commands, uninstall all previous dependency versions (global and local). Then, rerun `npm install`.



@@ -4668,4 +4668,4 @@ td.visible-print {
td.hidden-print {
display: none !important;
}
}
}

Large diffs are not rendered by default.

0 comments on commit 0d33455

Please sign in to comment.
You can’t perform that action at this time.