use of org.apache.tools.ant.DefaultLogger in project Gargoyle by callakrsos.
the class AntJavaCompiler method parse.
/**
*
* build.xml파일을 파싱처리하여
* 빌드처리 준비상태로 처리한다.
* 이후 run 함수를 호출하여 빌드를 실행할 수 있다.
*
* @작성자 : KYJ
* @작성일 : 2017. 3. 7.
*/
public void parse() {
p = new Project();
p.setUserProperty("ant.file", buildFile.getAbsolutePath());
p.setUserProperty("encoding", encoding.displayName());
p.init();
helper = ProjectHelper.getProjectHelper();
p.addReference("ant.projectHelper", helper);
if (baseDir != null && baseDir.exists())
p.setBaseDir(baseDir);
else
p.setBaseDir(buildFile.getParentFile());
//setting console
DefaultLogger consoleLogger = getLogger();
consoleLogger.setOutputPrintStream(new PrintStream(out));
consoleLogger.setErrorPrintStream(new PrintStream(err));
consoleLogger.setMessageOutputLevel(Project.MSG_VERBOSE);
p.addBuildListener(consoleLogger);
//parse build.xml
helper.parse(p, buildFile);
LOGGER.debug(" ##### base dir : " + p.getBaseDir());
LOGGER.debug(" ##### default target : " + p.getDefaultTarget());
//append build debugger.
BuildListener buildListener = getBuildListener();
if (buildListener != null)
p.addBuildListener(buildListener);
wasParse = true;
}
Aggregations