exports.cliVersion = '>=3.2'; exports.init = function (logger, config, cli, appc) { var projectdir = config.appc.opts.projectDir+"/build/android/bin"; cli.on('build.pre.construct', function (builder, next) { builder.proguard = true; logger.log('[PROGUARD] : Applying platform/android/proguard.cfg'); next(); }); cli.on('build.android.proguard', function(builder, next){ logger.log('[PROGUARD]: Removing old class files so they can not be picked up.'); appc.subprocess.findExecutable("/usr/bin/rm", function(error, remove){ appc.subprocess.run(remove, ["-r",projectdir+"/classes_raw"], function(code, res, err){ next(); }); }); }); cli.on('build.android.javac', function(builder, next){ logger.log('[PROGUARD]: Moving classes for Proguard'); appc.subprocess.findExecutable("/usr/bin/rm", function(error, remove){ appc.subprocess.run(remove, ["-r",projectdir+"/classes_raw"], function(code, res, err){ appc.subprocess.findExecutable("/usr/bin/mv", function(error, result){ if(result){ appc.subprocess.run(result, [projectdir+"/classes",projectdir+"/classes_raw"], function(code, res, err){ next(); }); } }); }); }); }); };