Skip to content

Commit

Permalink
Revert "[WIP] Get Grunt consistently working again (select2#5466)"
Browse files Browse the repository at this point in the history
This reverts commit 9f8b6ff.
  • Loading branch information
faraquet committed Nov 27, 2019
1 parent 5765090 commit 216376a
Show file tree
Hide file tree
Showing 2 changed files with 146 additions and 4 deletions.
129 changes: 125 additions & 4 deletions Gruntfile.js
Expand Up @@ -64,6 +64,10 @@ module.exports = function (grunt) {
grunt.initConfig({
package: grunt.file.readJSON('package.json'),

clean: {
docs: ['docs/_site']
},

concat: {
'dist': {
options: {
Expand Down Expand Up @@ -122,10 +126,88 @@ module.exports = function (grunt) {
}
},

'saucelabs-qunit': {
all: {
options: {
build: testBuildNumber,
tags: ['tests', 'qunit'],
urls: testUrls,
testTimeout: 8000,
testname: 'QUnit test for Select2',
browsers: [
{
browserName: 'internet explorer',
version: '8',
platform: 'Windows 7'
},
{
browserName: 'internet explorer',
version: '9',
platform: 'Windows 7'
},
{
browserName: 'internet explorer',
version: '10',
platform: 'Windows 7'
},

{
browserName: 'internet explorer',
version: '11',
platform: 'Windows 10'
},

{
browserName: 'firefox',
platform: 'linux'
},

{
browserName: 'chrome',
platform: 'linux'
},

{
browserName: 'opera',
version: '12',
platform: 'linux'
}
]
}
}
},

'gh-pages': {
options: {
base: 'docs',
branch: 'master',
clone: 'node_modules/grunt-gh-pages/repo',
message: 'Updated docs with master',
push: true,
repo: 'git@github.com:select2/select2.github.io.git'
},
src: '**'
},

jekyll: {
options: {
src: 'docs',
dest: 'docs/_site'
},
build: {
d: null
},
serve: {
options: {
serve: true,
watch: true
}
}
},

jshint: {
options: {
jshintrc: true,
reporterOutput: ''
jshintrc: true
},
code: {
src: ['src/js/**/*.js']
Expand Down Expand Up @@ -162,6 +244,19 @@ module.exports = function (grunt) {
}
},

symlink: {
docs: {
cwd: 'dist',
expand: true,
overwrite: false,
src: [
'*'
],
dest: 'docs/dist',
filter: 'isDirectory'
}
},

requirejs: {
'dist': {
options: {
Expand Down Expand Up @@ -240,14 +335,19 @@ module.exports = function (grunt) {
}
});

grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-contrib-symlink');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');

grunt.loadNpmTasks('grunt-gh-pages');
grunt.loadNpmTasks('grunt-jekyll');
grunt.loadNpmTasks('grunt-saucelabs');
grunt.loadNpmTasks('grunt-sass');

grunt.registerTask('default', ['compile', 'test', 'lint', 'minify']);
Expand All @@ -258,6 +358,27 @@ module.exports = function (grunt) {
'sass:dev'
]);
grunt.registerTask('minify', ['uglify', 'sass:dist']);
grunt.registerTask('lint', ['jshint']);
grunt.registerTask('test', ['connect:tests', 'qunit']);
grunt.registerTask('test', ['connect:tests', 'qunit', 'jshint']);

var ciTasks = [];

ciTasks.push('compile');
ciTasks.push('connect:tests');

/*
// grunt-saucelabs appears to be broken with Travis altogether now.
// Can't run Sauce Labs tests in pull requests
if (process.env.TRAVIS_PULL_REQUEST == 'false') {
ciTasks.push('saucelabs-qunit');
}
*/

ciTasks.push('qunit');
ciTasks.push('jshint');

grunt.registerTask('ci', ciTasks);

grunt.registerTask('docs', ['symlink:docs', 'jekyll:serve']);

grunt.registerTask('docs-release', ['default', 'clean:docs', 'gh-pages']);
};
21 changes: 21 additions & 0 deletions package.json
Expand Up @@ -47,6 +47,27 @@
}
},
"devDependencies": {
"grunt": "^0.4.5",
"grunt-cli": "^0.1.13",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-concat": "^0.4.0",
"grunt-contrib-connect": "^0.9.0",
"grunt-contrib-jshint": "^0.10.0",
"grunt-contrib-nodeunit": "~0.3.3",
"grunt-contrib-qunit": "~0.4.0",
"grunt-contrib-requirejs": "^0.4.4",
"grunt-contrib-symlink": "^0.3.0",
"grunt-contrib-uglify": "~0.4.0",
"grunt-contrib-watch": "~0.6.0",
"grunt-gh-pages": "^0.9.1",
"grunt-jekyll": "^0.4.2",
"grunt-sass": "^1.0.0",
"grunt-saucelabs": "^9.0.0",
"node-sass": "^4.5.3",
"request": "<=2.81.0",
"shrinkwrap": "^0.4.0"
},
"dependencies": {
"almond": "~0.3.1",
"grunt": "^1.0.4",
"grunt-cli": "^1.3.2",
Expand Down

0 comments on commit 216376a

Please sign in to comment.