Skip to content

Commit 0d33455

Browse files
seriemacvrebert
authored andcommitted
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
1 parent 995add1 commit 0d33455

12 files changed

Lines changed: 898 additions & 812 deletions

File tree

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
language: node_js
22
node_js:
3-
- 0.6
3+
- 0.8
4+
before_script:
5+
- npm install -g grunt-cli

Gruntfile.js

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
module.exports = function(grunt) {
2+
3+
// Project configuration.
4+
grunt.initConfig({
5+
// Metadata.
6+
pkg: grunt.file.readJSON('package.json'),
7+
banner: '/**\n' +
8+
'* <%= pkg.name %>.js v<%= pkg.version %> by @fat and @mdo\n' +
9+
'* Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
10+
'* <%= _.pluck(pkg.licenses, "url").join(", ") %>\n' +
11+
'*/\n',
12+
// Task configuration.
13+
clean: {
14+
dist: ['dist']
15+
},
16+
concat: {
17+
options: {
18+
banner: '<%= banner %>',
19+
stripBanners: false
20+
},
21+
bootstrap: {
22+
src: ['js/*.js'],
23+
dest: 'dist/js/<%= pkg.name %>.js'
24+
}
25+
},
26+
jshint: {
27+
options: {
28+
jshintrc: 'js/.jshintrc'
29+
},
30+
gruntfile: {
31+
src: 'Gruntfile.js'
32+
},
33+
src: {
34+
src: ['js/*.js']
35+
},
36+
test: {
37+
src: ['js/tests/unit/*.js']
38+
}
39+
},
40+
recess: {
41+
options: {
42+
compile: true
43+
},
44+
bootstrap: {
45+
files: {
46+
'dist/css/bootstrap.css': ['less/bootstrap.less']
47+
}
48+
},
49+
min: {
50+
options: {
51+
compress: true
52+
},
53+
files: {
54+
'dist/css/bootstrap.min.css': ['less/bootstrap.less']
55+
}
56+
}
57+
},
58+
uglify: {
59+
options: {
60+
banner: '<%= banner %>'
61+
},
62+
bootstrap: {
63+
files: {
64+
'dist/js/<%= pkg.name %>.min.js': ['<%= concat.bootstrap.dest %>']
65+
}
66+
}
67+
},
68+
qunit: {
69+
options: {
70+
inject: 'js/tests/unit/phantom.js'
71+
},
72+
files: ['js/tests/*.html']
73+
},
74+
connect: {
75+
server: {
76+
options: {
77+
port: 3000,
78+
base: '.'
79+
}
80+
}
81+
},
82+
watch: {
83+
src: {
84+
files: '<%= jshint.src.src %>',
85+
tasks: ['jshint:src', 'qunit']
86+
},
87+
test: {
88+
files: '<%= jshint.test.src %>',
89+
tasks: ['jshint:test', 'qunit']
90+
},
91+
recess: {
92+
files: 'less/*.less',
93+
tasks: ['recess']
94+
}
95+
}
96+
});
97+
98+
99+
// These plugins provide necessary tasks.
100+
grunt.loadNpmTasks('grunt-contrib-connect');
101+
grunt.loadNpmTasks('grunt-contrib-clean');
102+
grunt.loadNpmTasks('grunt-contrib-concat');
103+
grunt.loadNpmTasks('grunt-contrib-jshint');
104+
grunt.loadNpmTasks('grunt-contrib-uglify');
105+
grunt.loadNpmTasks('grunt-contrib-qunit');
106+
grunt.loadNpmTasks('grunt-contrib-watch');
107+
grunt.loadNpmTasks('grunt-recess');
108+
109+
110+
// Test task.
111+
grunt.registerTask('test', ['jshint', 'qunit']);
112+
113+
// JS distribution task.
114+
grunt.registerTask('dist-js', ['concat', 'uglify']);
115+
116+
// CSS distribution task.
117+
grunt.registerTask('dist-css', ['recess']);
118+
119+
// Full distribution task.
120+
grunt.registerTask('dist', ['clean', 'dist-css', 'dist-js']);
121+
122+
// Default task.
123+
grunt.registerTask('default', ['test', 'dist']);
124+
};

Makefile

Lines changed: 0 additions & 107 deletions
This file was deleted.

README.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,33 +46,36 @@ Documentation for v2.3.2 has been made available for the time being at [http://g
4646

4747
## Compiling CSS and JavaScript
4848

49-
Bootstrap includes a [makefile](Makefile) with convenient methods for working with the framework. Before getting started, install [the necessary local dependencies](package.json):
49+
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):
5050

5151
```
52+
# if grunt-cli isn't already installed
53+
$ npm install -g grunt-cli
54+
5255
$ npm install
5356
```
5457

55-
When completed, you'll be able to run the various make commands provided.
58+
When completed, you'll be able to run the various grunt commands provided.
5659

5760
**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.
5861

59-
### Available makefile commands
62+
### Available grunt commands
6063

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

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

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

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

7376
### Troubleshooting dependencies
7477

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

7780

7881

dist/css/bootstrap.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4668,4 +4668,4 @@ td.visible-print {
46684668
td.hidden-print {
46694669
display: none !important;
46704670
}
4671-
}
4671+
}

dist/css/bootstrap.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)