Target target = new Target();
target.setName("compile");
project.addTarget("compile", target);
MxmlcTask mxmlcTask = new MxmlcTask();
mxmlcTask.setTaskName("mxmlc");
mxmlcTask.setFile(mxmlFileLocation + mxmlFile + ".mxml");
mxmlcTask.setFork(true);
mxmlcTask.setDynamicAttribute("services", servicesFilePath);
mxmlcTask.setDynamicAttribute("keep-generated-actionscript", "false");
mxmlcTask.setDynamicAttribute("debug", project.getProperty("debug"));
mxmlcTask.setDynamicAttribute("context-root", project.getProperty("contextRoot"));
((NestedAttributeElement)mxmlcTask.createDynamicElement("load-config")).setDynamicAttribute("filename", flexConfigPath);
mxmlcTask.setProject(project);
target.addTask(mxmlcTask);
HtmlWrapperTask htmlTask = new HtmlWrapperTask();
htmlTask.setTaskName("html-wrapper");
htmlTask.setTitle( mxmlFile+ " Flex Application");