2014-03-21 12:49:07 +04:00
|
|
|
module.exports = function(grunt) {
|
|
|
|
|
|
|
|
require('load-grunt-tasks')(grunt);
|
|
|
|
|
|
|
|
grunt.initConfig({
|
|
|
|
bump: {
|
|
|
|
options: {
|
|
|
|
files: ['package.json', 'bower.json'],
|
|
|
|
commitFiles: ['package.json', 'bower.json'],
|
|
|
|
pushTo: 'origin'
|
|
|
|
}
|
2014-05-09 17:31:40 +04:00
|
|
|
},
|
|
|
|
copy: {
|
|
|
|
prepare: {
|
|
|
|
files: [{
|
|
|
|
src: [
|
|
|
|
'**',
|
|
|
|
'!node_modules/**',
|
|
|
|
'!bower_components/**',
|
2015-12-13 17:52:49 +03:00
|
|
|
'!CONTRIBUTING.md',
|
2014-05-09 17:31:40 +04:00
|
|
|
'!Gruntfile.js',
|
2015-12-13 17:52:49 +03:00
|
|
|
'!LICENSE.md',
|
|
|
|
'!README.md',
|
2014-05-09 17:31:40 +04:00
|
|
|
'!bower.json',
|
|
|
|
'!package.json'
|
|
|
|
],
|
2014-05-09 18:56:00 +04:00
|
|
|
dest: 'temp/pres/'
|
2014-05-09 17:31:40 +04:00
|
|
|
},{
|
|
|
|
expand: true,
|
|
|
|
cwd: 'node_modules/shower-core/',
|
|
|
|
src: [
|
|
|
|
'**',
|
|
|
|
'!package.json',
|
|
|
|
'!Readme.md'
|
|
|
|
],
|
2014-05-09 18:56:00 +04:00
|
|
|
dest: 'temp/pres/shower/'
|
2014-05-09 17:31:40 +04:00
|
|
|
},{
|
|
|
|
expand: true,
|
|
|
|
cwd: 'node_modules/shower-ribbon/',
|
|
|
|
src: [
|
|
|
|
'**',
|
|
|
|
'!package.json',
|
|
|
|
'!Readme.md'
|
|
|
|
],
|
2014-05-09 18:56:00 +04:00
|
|
|
dest: 'temp/pres/shower/themes/ribbon/'
|
2014-05-09 17:31:40 +04:00
|
|
|
},{
|
|
|
|
expand: true,
|
2015-12-13 17:52:49 +03:00
|
|
|
cwd: 'node_modules/shower-material/',
|
2014-05-09 17:31:40 +04:00
|
|
|
src: [
|
|
|
|
'**',
|
|
|
|
'!package.json',
|
2015-12-13 17:52:49 +03:00
|
|
|
'!README.md'
|
2014-05-09 17:31:40 +04:00
|
|
|
],
|
2015-12-13 17:52:49 +03:00
|
|
|
dest: 'temp/pres/shower/themes/material/'
|
2014-05-09 17:31:40 +04:00
|
|
|
}]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
replace: {
|
|
|
|
core: {
|
2014-05-09 18:56:00 +04:00
|
|
|
src: 'temp/pres/index.html',
|
2014-05-09 17:31:40 +04:00
|
|
|
overwrite: true,
|
|
|
|
replacements: [{
|
|
|
|
from: /(node_modules|bower_components)\/shower-core/g,
|
|
|
|
to: 'shower'
|
|
|
|
},{
|
2015-12-13 17:52:49 +03:00
|
|
|
from: /(node_modules|bower_components)\/shower-(ribbon|material)/g,
|
2014-05-09 17:31:40 +04:00
|
|
|
to: 'shower/themes/$2'
|
|
|
|
}]
|
|
|
|
},
|
|
|
|
themes: {
|
2014-05-09 18:56:00 +04:00
|
|
|
src: 'temp/pres/shower/themes/*/index.html',
|
2014-05-09 17:31:40 +04:00
|
|
|
overwrite: true,
|
|
|
|
replacements: [{
|
|
|
|
from: '../shower-core', to: '../..'
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
'gh-pages': {
|
|
|
|
options: {
|
2014-05-09 18:56:00 +04:00
|
|
|
base: 'temp/pres',
|
|
|
|
clone: 'temp/clone'
|
2014-05-09 17:31:40 +04:00
|
|
|
},
|
|
|
|
src: ['**']
|
|
|
|
},
|
2014-05-27 15:02:58 +04:00
|
|
|
compress: {
|
|
|
|
shower: {
|
|
|
|
options: {
|
|
|
|
archive: 'archive.zip'
|
|
|
|
},
|
|
|
|
files: [{
|
|
|
|
expand: true,
|
|
|
|
cwd: 'temp/pres/',
|
|
|
|
src: '**',
|
|
|
|
dest: '.'
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
},
|
2014-05-09 17:31:40 +04:00
|
|
|
clean: ['temp']
|
2014-03-21 12:49:07 +04:00
|
|
|
});
|
|
|
|
|
2014-05-09 17:31:40 +04:00
|
|
|
grunt.registerTask('publish', [
|
|
|
|
'copy',
|
|
|
|
'replace',
|
|
|
|
'gh-pages',
|
|
|
|
'clean'
|
|
|
|
]);
|
2014-03-21 12:49:07 +04:00
|
|
|
|
2014-05-27 15:02:58 +04:00
|
|
|
grunt.registerTask('archive', [
|
|
|
|
'copy',
|
|
|
|
'replace',
|
|
|
|
'compress',
|
|
|
|
'clean'
|
|
|
|
]);
|
|
|
|
|
|
|
|
};
|