Merge "Ace: Handle updates via npm and grunt"

This commit is contained in:
jenkins-bot 2018-08-19 15:40:01 +00:00 committed by Gerrit Code Review
commit bd280f06af
3 changed files with 41 additions and 20 deletions

View file

@ -9,7 +9,10 @@
module.exports = function ( grunt ) {
var conf = grunt.file.readJSON( 'extension.json' );
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-contrib-clean' );
grunt.loadNpmTasks( 'grunt-contrib-copy' );
grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadNpmTasks( 'grunt-exec' );
grunt.loadNpmTasks( 'grunt-stylelint' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
@ -38,9 +41,42 @@ module.exports = function ( grunt ) {
'!node_modules/**',
'!vendor/**'
]
},
exec: {
'npm-update-ace': {
cmd: 'npm update ace-builds',
callback: function ( error, stdout, stderr ) {
grunt.log.write( stdout );
if ( stderr ) {
grunt.log.write( 'Error: ' + stderr );
}
if ( error !== null ) {
grunt.log.error( 'update error: ' + error );
}
}
}
},
clean: {
ace: [ 'modules/ace/*' ]
},
copy: {
ace: {
expand: true,
cwd: 'node_modules/ace-builds/src-noconflict/',
src: [ '**' ],
dest: 'modules/ace/'
},
'ace-license': {
expand: true,
cwd: 'node_modules/ace-builds/',
src: [ 'LICENSE' ],
dest: 'modules/ace/'
}
}
} );
grunt.registerTask( 'update-ace', [ 'exec:npm-update-ace', 'clean:ace', 'copy:ace', 'copy:ace-license' ] );
grunt.registerTask( 'test', [ 'eslint', 'stylelint', 'jsonlint', 'banana' ] );
grunt.registerTask( 'default', 'test' );
};

View file

@ -1,19 +0,0 @@
# Helper to pull the ace goodies
.PHONY: all clean refresh
all: refresh
clean:
rm -rf modules/ace ace-git
refresh: ace-git
test -d modules/ace || mkdir modules/ace
(cd ace-git && git checkout master && git pull origin master)
(cd ace-git && npm install && node ./Makefile.dryice.js -nc)
rsync -av ace-git/build/src-noconflict/ modules/ace/
cp ace-git/LICENSE modules/ace/LICENSE
ace-git:
git clone git://github.com/ajaxorg/ace.git ace-git

View file

@ -7,10 +7,14 @@
"test": "grunt test"
},
"devDependencies": {
"ace-builds": "1.2.9",
"eslint-config-wikimedia": "0.5.0",
"grunt": "1.0.1",
"grunt": "1.0.3",
"grunt-banana-checker": "0.6.0",
"grunt-contrib-clean": "1.1.0",
"grunt-contrib-copy": "1.0.0",
"grunt-eslint": "20.1.0",
"grunt-exec": "3.0.0",
"grunt-jsonlint": "1.1.0",
"grunt-stylelint": "0.9.0",
"postcss-less": "1.1.3",