Skip to content

Instantly share code, notes, and snippets.

@zo0m
Last active January 14, 2018 18:27
Show Gist options
  • Save zo0m/70f8ede3af64d9285fe4 to your computer and use it in GitHub Desktop.
Save zo0m/70f8ede3af64d9285fe4 to your computer and use it in GitHub Desktop.
Gruntfile for sharing: start Grunt look , raw version --- TODO: remove reduntant tasks
module.exports = function(grunt) {
grunt.initConfig({
sync: {
main: {
files: [{
cwd : 'app',
src: [
'**', /* Include everything */
],
dest: '/Users/admin/Documents/Appcelerator_Studio_Workspace/gevar/app'
}],
verbose: true
},
app: {
files: [{
src: [
'app/assets/core/*.*',
'app/assets/gevar/*.*',
'app/assets/images/*.*',
'app/assets/iphone/*.*',
'app/assets/android/*.*',
'app/controllers/*.*',
'app/views/*.*',
'app/styles/*.*',
'app/widgets/**',
'app/lib/**',
],
dest: '/Users/admin/Documents/Appcelerator_Studio_Workspace/gevar'
}],
verbose: true
}
},
watch: {
app: {
files: [
'app/assets/core/*.*',
'app/assets/gevar/*.*',
'app/assets/images/*.*',
'app/assets/iphone/*.*',
'app/assets/android/*.*',
'app/controllers/*.*',
'app/views/*.*',
'app/styles/*.*',
'app/widgets/**',
'app/widgets/**',
'app/lib/**',
],
tasks: ['sync:app'],
options: {
spawn: false
}
}
},
shell: {
run_shadow: {
command: function (isShadow) {
isShadow = isShadow || false;
return 'appc run ' +
'-p ios ' +
'-T device ' +
'-V "#################3" ' +
'-P "######################" ' +
'-l trace ' +
'-d /Users/admin/Documents/Appcelerator_Studio_Workspace/gevar/ ' +
((isShadow) ? '--shadow' : '');
},
options: {
execOptions: {
maxBuffer: Infinity
}
}
}
}
});
grunt.loadNpmTasks('grunt-sync');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default' , ['sync:main']);
grunt.registerTask('shadow' , ['sync:main', 'shell:run_shadow:true' ]);
grunt.registerTask('run' , ['sync:main', 'shell:run_shadow:false']);
grunt.registerTask('look' , ['watch:app']);
grunt.registerTask('sync_app' , ['sync:app' ]);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment