mirror of
https://github.com/less/less.js.git
synced 2026-01-22 13:48:03 -05:00
re-organise the grunt tasks a little and update readme
This commit is contained in:
43
Gruntfile.js
43
Gruntfile.js
@@ -43,7 +43,7 @@ module.exports = function(grunt) {
|
||||
footer: '\n})(window);'
|
||||
},
|
||||
// Browser versions
|
||||
browser: {
|
||||
browsertest: {
|
||||
src: ['<%= build.browser %>'],
|
||||
dest: 'test/browser/less.js'
|
||||
},
|
||||
@@ -55,6 +55,10 @@ module.exports = function(grunt) {
|
||||
src: ['<%= build.browser %>'],
|
||||
dest: 'dist/less-<%= pkg.version %>-beta.js'
|
||||
},
|
||||
stable: {
|
||||
src: ['<%= build.browser %>'],
|
||||
dest: 'dist/less-<%= pkg.version %>.js'
|
||||
},
|
||||
// Rhino
|
||||
rhino: {
|
||||
options: {
|
||||
@@ -78,10 +82,6 @@ module.exports = function(grunt) {
|
||||
banner: '<%= meta.banner %>',
|
||||
mangle: true
|
||||
},
|
||||
browser: {
|
||||
src: ['<%= concat.browser.src %>'],
|
||||
dest: 'dist/less-<%= pkg.version %>.min.js'
|
||||
},
|
||||
alpha: {
|
||||
src: ['<%= concat.alpha.src %>'],
|
||||
dest: 'dist/less-<%= pkg.version %>-alpha.min.js'
|
||||
@@ -89,6 +89,10 @@ module.exports = function(grunt) {
|
||||
beta: {
|
||||
src: ['<%= concat.beta.src %>'],
|
||||
dest: 'dist/less-<%= pkg.version %>-beta.min.js'
|
||||
},
|
||||
stable: {
|
||||
src: ['<%= concat.browser.src %>'],
|
||||
dest: 'dist/less-<%= pkg.version %>.min.js'
|
||||
}
|
||||
},
|
||||
|
||||
@@ -202,11 +206,9 @@ module.exports = function(grunt) {
|
||||
}
|
||||
},
|
||||
|
||||
// Before running tests, clean out the results
|
||||
// of any previous tests. (this will need to be
|
||||
// setup based on configuration of browser tests).
|
||||
// Clean the version of less built for the tests
|
||||
clean: {
|
||||
test: ['test/browser/test-runner-*.htm']
|
||||
test: ['test/browser/less.js']
|
||||
}
|
||||
});
|
||||
|
||||
@@ -216,10 +218,9 @@ module.exports = function(grunt) {
|
||||
// Actually load this plugin's task(s).
|
||||
grunt.loadTasks('build/tasks');
|
||||
|
||||
// Default task to build Less.js
|
||||
// by default, run tests
|
||||
grunt.registerTask('default', [
|
||||
'concat:browser',
|
||||
'uglify:browser'
|
||||
'test'
|
||||
]);
|
||||
|
||||
// Alpha
|
||||
@@ -234,18 +235,30 @@ module.exports = function(grunt) {
|
||||
'uglify:beta'
|
||||
]);
|
||||
|
||||
// Run all tests
|
||||
grunt.registerTask('browser', [
|
||||
// Beta
|
||||
grunt.registerTask('stable', [
|
||||
'concat:stable',
|
||||
'uglify:stable'
|
||||
]);
|
||||
|
||||
// Run all browser tests
|
||||
grunt.registerTask('browsertest', [
|
||||
'connect',
|
||||
'jasmine'
|
||||
]);
|
||||
|
||||
// Create the browser version of less.js
|
||||
grunt.registerTask('browser', [
|
||||
'concat:browsertest'
|
||||
]);
|
||||
|
||||
// Run all tests
|
||||
grunt.registerTask('test', [
|
||||
'clean',
|
||||
'jshint',
|
||||
'shell:test',
|
||||
'browser'
|
||||
'browser',
|
||||
'browsertest'
|
||||
]);
|
||||
|
||||
// Run benchmark
|
||||
|
||||
35
README.md
35
README.md
@@ -1,4 +1,4 @@
|
||||
# [Less.js v1.4.2](http://lesscss.org)
|
||||
# [Less.js v1.5.0-b1](http://lesscss.org)
|
||||
|
||||
> The **dynamic** stylesheet language. [http://lesscss.org](http://lesscss.org).
|
||||
|
||||
@@ -280,33 +280,38 @@ and then `cd less`.
|
||||
|
||||
#### Install dependencies
|
||||
|
||||
Tests and benchmarking require Grunt `~0.4.1`. If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to install and use Grunt plugins, which are necessary for development with Less.js.
|
||||
|
||||
To install Grunt and other necessary dependencies run:
|
||||
To install all the dependencies for less development, run:
|
||||
|
||||
```shell
|
||||
npm install
|
||||
```
|
||||
|
||||
You should now be able to build Less.js, run tests, benchmarking, and other tasks listed in the Gruntfile.
|
||||
|
||||
|
||||
## Building Less.js
|
||||
|
||||
The Less.js [Gruntfile](Gruntfile.js) is configured with the following "convenience tasks" (you must first install [the necessary local dependencies](package.json)):
|
||||
If you haven't run grunt before, install grunt-cli globally so you can just run `grunt`
|
||||
|
||||
```shell
|
||||
$ npm install
|
||||
npm install grunt-cli -g
|
||||
```
|
||||
|
||||
When all of the necessary dependencies are installed you may run the various Grunt.js commands provided:
|
||||
You should now be able to build Less.js, run tests, benchmarking, and other tasks listed in the Gruntfile.
|
||||
|
||||
#### build - `grunt`
|
||||
Build Less.js from from the `/lib/less` source files.
|
||||
## Using Less.js Grunt
|
||||
|
||||
#### test - `grunt test`
|
||||
Tests, benchmarking and building is done using Grunt `~0.4.1`. If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to install and use Grunt plugins, which are necessary for development with Less.js.
|
||||
|
||||
The Less.js [Gruntfile](Gruntfile.js) is configured with the following "convenience tasks" :
|
||||
|
||||
#### test - `grunt`
|
||||
Runs jshint, nodeunit and headless jasmine tests using [phantomjs](http://code.google.com/p/phantomjs/). You must have phantomjs installed for the jasmine tests to run.
|
||||
|
||||
#### test - `grunt benchmark`
|
||||
Runs the benchmark suite.
|
||||
|
||||
#### build for testing browser - 'grunt browser'
|
||||
This builds less.js and puts it in 'test/browser/less.js'
|
||||
|
||||
#### build - `grunt stable | grunt beta | grunt alpha`
|
||||
Builds Less.js from from the `/lib/less` source files. This is done by the developer releasing a new release, do not do this if you are creating a pull request.
|
||||
|
||||
#### readme - `grunt readme`
|
||||
Build the README file from [a template](build/README.md) to ensure that metadata is up-to-date and (more likely to be) correct.
|
||||
|
||||
|
||||
@@ -280,33 +280,38 @@ and then `cd less`.
|
||||
|
||||
#### Install dependencies
|
||||
|
||||
Tests and benchmarking require Grunt `<%= pkg.devDependencies.grunt %>`. If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to install and use Grunt plugins, which are necessary for development with Less.js.
|
||||
|
||||
To install Grunt and other necessary dependencies run:
|
||||
To install all the dependencies for less development, run:
|
||||
|
||||
```shell
|
||||
npm install
|
||||
```
|
||||
|
||||
You should now be able to build Less.js, run tests, benchmarking, and other tasks listed in the Gruntfile.
|
||||
|
||||
|
||||
## Building Less.js
|
||||
|
||||
The Less.js [Gruntfile](Gruntfile.js) is configured with the following "convenience tasks" (you must first install [the necessary local dependencies](package.json)):
|
||||
If you haven't run grunt before, install grunt-cli globally so you can just run `grunt`
|
||||
|
||||
```shell
|
||||
$ npm install
|
||||
npm install grunt-cli -g
|
||||
```
|
||||
|
||||
When all of the necessary dependencies are installed you may run the various Grunt.js commands provided:
|
||||
You should now be able to build Less.js, run tests, benchmarking, and other tasks listed in the Gruntfile.
|
||||
|
||||
#### build - `grunt`
|
||||
Build Less.js from from the `/lib/less` source files.
|
||||
## Using Less.js Grunt
|
||||
|
||||
#### test - `grunt test`
|
||||
Tests, benchmarking and building is done using Grunt `<%= pkg.devDependencies.grunt %>`. If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to install and use Grunt plugins, which are necessary for development with Less.js.
|
||||
|
||||
The Less.js [Gruntfile](Gruntfile.js) is configured with the following "convenience tasks" :
|
||||
|
||||
#### test - `grunt`
|
||||
Runs jshint, nodeunit and headless jasmine tests using [phantomjs](http://code.google.com/p/phantomjs/). You must have phantomjs installed for the jasmine tests to run.
|
||||
|
||||
#### test - `grunt benchmark`
|
||||
Runs the benchmark suite.
|
||||
|
||||
#### build for testing browser - 'grunt browser'
|
||||
This builds less.js and puts it in 'test/browser/less.js'
|
||||
|
||||
#### build - `grunt stable | grunt beta | grunt alpha`
|
||||
Builds Less.js from from the `/lib/less` source files. This is done by the developer releasing a new release, do not do this if you are creating a pull request.
|
||||
|
||||
#### readme - `grunt readme`
|
||||
Build the README file from [a template](build/README.md) to ensure that metadata is up-to-date and (more likely to be) correct.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user