执行ant脚本

阅读更多

1、webproject获取src下文件的方法

File file = new File(this.getClass().getClassLoader().getResource("/temp.xml").getFile());

 

File file = new File(this.getClass().getResource("/getSourceBuild.xml").getFile());

System.out.println(file.getAbsolutePath());

Project project = new Project();

project.fireBuildStarted();

project.init();

project.setProperty("remote.url", "http://172.16.132.179:8000/svn/dev/tags/code/OSP/ASOP/SmartTV/ASOP20140328_1");

project.setProperty("code.path", "/usr/asmp/compile/code/asop");

ProjectHelper projectHelper = ProjectHelper.getProjectHelper();

projectHelper.parse(project, file);

project.executeTarget(project.getDefaultTarget()); 

project.fireBuildFinished(null);

你可能感兴趣的:(执行ant脚本)