Created
March 21, 2016 21:18
-
-
Save eltonkola/f010e0a5daffb8a60863 to your computer and use it in GitHub Desktop.
Apache exec run gradle to build android app, printing log output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void execute(){ | |
String mcd_val = "/pathtoproject/gradlew -q -b /pathtoproject/appfolder/build.gradle assembleRelease"; | |
try { | |
PumpStreamHandler psh = new PumpStreamHandler(new LogOutputStream() { | |
@Override | |
protected void processLine(String arg0, int arg1) { | |
System.out.println(arg0 + " - " + arg1); | |
} | |
}); | |
CommandLine cl = CommandLine.parse(mcd_val); | |
DefaultExecutor exec = new DefaultExecutor(); | |
exec.setStreamHandler(psh); | |
exec.execute(cl); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment