2014-06-19 21:50:29 +02:00
|
|
|
module.exports = function(grunt) {
|
|
|
|
grunt.initConfig({
|
|
|
|
pkg: grunt.file.readJSON('package.json'),
|
|
|
|
|
|
|
|
sass: {
|
|
|
|
options: {
|
2014-08-06 21:43:03 +02:00
|
|
|
includePaths: ['bower_components/foundation/scss',
|
|
|
|
'bower_components/ionic/scss']
|
2014-06-19 21:50:29 +02:00
|
|
|
},
|
|
|
|
dist: {
|
|
|
|
options: {
|
|
|
|
// outputStyle: 'compressed'
|
|
|
|
outputStyle: 'expanded'
|
|
|
|
},
|
|
|
|
files: {
|
|
|
|
'css/app.css': 'scss/app.scss',
|
|
|
|
'css/SOGoRootPage.css': 'scss/SOGoRootPage.scss',
|
2014-08-06 21:43:03 +02:00
|
|
|
'css/ContactsUI.css': 'scss/ContactsUI.scss',
|
2014-11-25 22:09:55 +01:00
|
|
|
'css/MailerUI.css': 'scss/MailerUI.scss',
|
2014-08-06 21:43:03 +02:00
|
|
|
'css/mobile.css': 'scss/mobile.scss'
|
2014-06-19 21:50:29 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
watch: {
|
|
|
|
grunt: { files: ['Gruntfile.js'] },
|
|
|
|
|
|
|
|
sass: {
|
|
|
|
files: 'scss/**/*.scss',
|
|
|
|
tasks: ['sass']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
grunt.loadNpmTasks('grunt-sass');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
|
|
|
|
2014-09-15 16:13:02 +02:00
|
|
|
grunt.task.registerTask('static', function() {
|
2014-08-06 21:43:03 +02:00
|
|
|
var options = {
|
|
|
|
'src': 'bower_components',
|
2014-08-12 02:34:47 +02:00
|
|
|
'js_dest': 'js/vendor/',
|
2014-09-15 16:13:02 +02:00
|
|
|
'fonts_dest': 'fonts/'
|
2014-08-06 21:43:03 +02:00
|
|
|
};
|
2014-08-12 02:34:47 +02:00
|
|
|
var js = [
|
2014-09-15 16:13:02 +02:00
|
|
|
'<%= src %>/angular/angular{,.min}.js{,.map}',
|
|
|
|
'<%= src %>/angular-animate/angular-animate{,.min}.js{,.map}',
|
|
|
|
'<%= src %>/angular-sanitize/angular-sanitize{,.min}.js{,.map}',
|
|
|
|
'<%= src %>/angular-ui-router/release/angular-ui-router{,.min}.js',
|
2014-11-23 07:09:04 +01:00
|
|
|
'<%= src %>/angular-recursion/angular-recursion{,.min}.js',
|
2014-11-23 07:17:51 +01:00
|
|
|
'<%= src %>/angular-vs-repeat/src/angular-vs-repeat{,.min}.js',
|
2014-09-15 16:13:02 +02:00
|
|
|
'<%= src %>/angular-foundation/mm-foundation-tpls{,.min}.js',
|
|
|
|
'<%= src %>/foundation/js/foundation{,.min}.js',
|
2014-10-01 22:10:53 +02:00
|
|
|
'<%= src %>/ionic/release/js/ionic.bundle{,.min}.js',
|
2014-08-20 21:30:59 +02:00
|
|
|
'<%= src %>/underscore/underscore-min.{js,map}'
|
2014-08-06 21:43:03 +02:00
|
|
|
];
|
2014-08-13 21:56:29 +02:00
|
|
|
for (var j = 0; j < js.length; j++) {
|
|
|
|
var files = grunt.file.expand(grunt.template.process(js[j], {data: options}))
|
|
|
|
for (var i = 0; i < files.length; i++) {
|
|
|
|
var src = files[i];
|
|
|
|
var paths = src.split('/');
|
|
|
|
var dest = options.js_dest + paths[paths.length-1];
|
|
|
|
grunt.file.copy(src, dest);
|
|
|
|
grunt.log.ok("copy " + src + " => " + dest);
|
|
|
|
}
|
2014-08-12 02:34:47 +02:00
|
|
|
}
|
|
|
|
var fonts = grunt.file.expand(
|
|
|
|
grunt.template.process('<%= src %>/ionic/release/fonts/ionicons.*',
|
|
|
|
{data: options})
|
|
|
|
);
|
|
|
|
for (var i = 0; i < fonts.length; i++) {
|
|
|
|
var src = fonts[i];
|
|
|
|
var paths = src.split('/');
|
|
|
|
var dest = options.fonts_dest + paths[paths.length-1];
|
2014-08-06 21:43:03 +02:00
|
|
|
grunt.file.copy(src, dest);
|
|
|
|
grunt.log.ok("copy " + src + " => " + dest);
|
|
|
|
}
|
|
|
|
});
|
2014-09-15 16:13:02 +02:00
|
|
|
grunt.task.registerTask('build', ['static', 'sass']);
|
|
|
|
grunt.task.registerTask('default', ['build','watch']);
|
2014-06-19 21:50:29 +02:00
|
|
|
}
|