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',
|
|
|
|
'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');
|
|
|
|
|
|
|
|
grunt.registerTask('build', ['sass']);
|
|
|
|
grunt.registerTask('default', ['build','watch']);
|
2014-08-12 02:34:47 +02:00
|
|
|
grunt.registerTask('static', function(dev) {
|
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/',
|
|
|
|
'fonts_dest': 'fonts/',
|
2014-08-06 21:43:03 +02:00
|
|
|
'min': (dev? '' : '.min')
|
|
|
|
};
|
2014-08-12 02:34:47 +02:00
|
|
|
var js = [
|
2014-08-06 21:43:03 +02:00
|
|
|
'<%= src %>/angular/angular<%= min %>.js',
|
|
|
|
'<%= src %>/angular-sanitize/angular-sanitize<%= min %>.js',
|
|
|
|
'<%= src %>/angular-ui-router/release/angular-ui-router<%= min %>.js',
|
|
|
|
'<%= src %>/angular-foundation/mm-foundation-tpls<%= min %>.js',
|
|
|
|
'<%= src %>/foundation/js/foundation<%= min %>.js',
|
|
|
|
'<%= src %>/ionic/release/js/ionic<%= min %>.js',
|
2014-08-13 21:56:29 +02:00
|
|
|
'<%= src %>/underscore/underscore-min.*'
|
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-06-19 21:50:29 +02:00
|
|
|
}
|