diff -r 044383f39525 -r be27ed110b50 buildframework/helium/tools/compile/compile.antlib.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/buildframework/helium/tools/compile/compile.antlib.xml Wed Oct 28 14:39:48 2009 +0000 @@ -0,0 +1,324 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + dbPath: ${metadata.dbfile} + logpath: @{logfile} + ant: antProperties() + + + + + + + + + + + + + + Errors after compile-main: ${build.errors.total} + + + + +errorsTotal = project.getProperty("build.errors.total") +errorsLimit = project.getProperty("build.errors.limit") +if int(errorsLimit) > -1: + if int(errorsTotal) > int(errorsLimit): + self.setValue(1) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + self.setTaskName("emake"); + // check attributes + if (attributes.get("name") == null) + throw new org.apache.tools.ant.BuildException("name attribute is not defined"); + self.log("Name: " + attributes.get("name")); + if (attributes.get("makefile") == null) + throw new org.apache.tools.ant.BuildException("makefile attribute is not defined"); + self.log("Makefile: " + attributes.get("makefile")); + String target = "all"; + String custom = ""; + if (attributes.get("target") != null) + target = attributes.get("target"); + self.log("Target: " + target); + if (attributes.get("custom") != null) + custom = attributes.get("custom"); + if (attributes.get("root") != null) + root = attributes.get("root"); + else + root = ""; + self.log("Custom: " + custom); + + // Create and configure exec target + org.apache.tools.ant.taskdefs.ExecTask task = new org.apache.tools.ant.taskdefs.ExecTask(); + task.setTaskName(self.getTaskName()); + String emake = com.nokia.ant.util.Helper.getProperty(project, "ec.emake"); + task.setExecutable(emake); + if (attributes.get("failonerror") != null) { + task.setFailonerror(Boolean.parseBoolean(attributes.get("failonerror"))); + } else { + task.setFailonerror(true); + } + String buildDrive = com.nokia.ant.util.Helper.getProperty(project, "build.drive"); + task.setDir(new java.io.File(buildDrive + "/")); + if (attributes.get("log") != null) { + self.log("Log: " + attributes.get("log")); + task.setOutput(new java.io.File(attributes.get("log"))); + } + if (attributes.get("dir") != null) { + self.log("dir: " + attributes.get("dir")); + task.setDir(new java.io.File(attributes.get("dir"))); + } + String buildId = com.nokia.ant.util.Helper.getProperty(project, "build.id"); + task.createArg().setValue("--emake-build-label=" + buildId + "-" + attributes.get("name")); + String eclass = com.nokia.ant.util.Helper.getProperty(project, "ec.build.class"); + task.createArg().setValue("--emake-class=" + eclass); + String eroot = com.nokia.ant.util.Helper.getProperty(project, "env.EMAKE_ROOT"); + String heliumDir = com.nokia.ant.util.Helper.getProperty(project, "helium.dir"); + if (attributes.get("root") != null) { + self.log("--emake-root=" + eroot + ";" + heliumDir + ";" + root); + } + task.createArg().setValue("--emake-root=" + eroot + ";" + heliumDir + ";" + root); + if (attributes.get("annodetail") != null) { + task.createArg().setValue("--emake-annodetail=" + attributes.get("annodetail")); + task.createArg().setValue("--emake-annofile=" + com.nokia.ant.util.Helper.getProperty(project, "build.log.dir") + "/" + buildId + "-" + attributes.get("name") + ".anno.xml"); + } + task.createArg().setLine(custom); + task.createArg().setLine("-f " + attributes.get("makefile")); + task.createArg().setLine(target); + // Execute. + task.execute(); + + + + + + + + + + + + + + + + + + + +