Examples of AntRunner


Examples of org.eclipse.ant.core.AntRunner

  protected void createFile(
      IResource resource,
      String fileName,
      IProgressMonitor monitor)
  throws CoreException {
    AntRunner runner = new AntRunner();
    ForrestPlugin plugin = ForrestPlugin.getDefault();
    String strPluginDir = plugin.getBundle().getLocation();
    if (strPluginDir.startsWith("update@")) {
      strPluginDir = strPluginDir.substring(8);
    }
    runner.setBuildFileLocation(strPluginDir + resourceAntScript);
    String strPath = resource.getLocation().toOSString();
    StringBuffer sb = new StringBuffer("-Dresource.dir=");
    sb.append(strPath);
    sb.append(" ");
    sb.append("-Dresource.name=");
    sb.append(fileName);
    runner.setArguments(sb.toString());
    runner.run(monitor);
      resource.refreshLocal(IProject.DEPTH_INFINITE, monitor);
  }
View Full Code Here

Examples of org.eclipse.ant.core.AntRunner

    if (cmdString != null) {
      String fhome = ForrestPlugin.getDefault().getPluginPreferences()
          .getString(ForrestPreferences.FORREST_HOME);
      String antFile = fhome + File.separatorChar + "main"
          + File.separatorChar + "forrest.build.xml";
      AntRunner runner = new AntRunner();
      runner.setCustomClasspath(getAntClasspath());
      runner.addBuildListener(AntBuildListener.class.getName());
      runner.setMessageOutputLevel(Project.MSG_INFO);
      try {
        runner.setBuildFileLocation(antFile);
        runner.setArguments(cmdString);
        logger.info("Running ANT with command string = " + cmdString);
        runner.run(monitor);
      } catch (CoreException e) {
        String userMsg;
        String errMsg = e.getMessage();
        if (errMsg.indexOf(VALIDATION_ERROR_MESSAGE) > 0) {
          String file = errMsg.substring(errMsg
View Full Code Here

Examples of org.eclipse.ant.core.AntRunner

  protected void createFile(
      IResource resource,
      String fileName,
      IProgressMonitor monitor)
  throws CoreException {
    AntRunner runner = new AntRunner();
    ForrestPlugin plugin = ForrestPlugin.getDefault();
    String strPluginDir = plugin.getBundle().getLocation();
    if (strPluginDir.startsWith("update@")) {
      strPluginDir = strPluginDir.substring(8);
    }
    runner.setBuildFileLocation(strPluginDir + resourceAntScript);
    String strPath = resource.getLocation().toOSString();
    StringBuffer sb = new StringBuffer("-Dresource.dir=");
    sb.append(strPath);
    sb.append(" ");
    sb.append("-Dresource.name=");
    sb.append(fileName);
    sb.append(" ");
    sb.append("-verbose");
    runner.setArguments(sb.toString());
    runner.run(monitor);
      resource.refreshLocal(IProject.DEPTH_INFINITE, monitor);
  }
View Full Code Here

Examples of org.eclipse.ant.core.AntRunner

        }

        obrComplete = false;

        File buildFile;
        final AntRunner runner = new AntRunner();

        try {
            buildFile = getAntBuildFile();

            runner.setBuildFileLocation(buildFile.getAbsolutePath());
            runner.setArguments("-Dobr.filename=" + obrFile.getAbsolutePath());
            runner.run(monitor);
        } catch (final CoreException e) {
            monitor.setCanceled(true);

            return Status.CANCEL_STATUS;
        } catch (final IOException e) {
View Full Code Here

Examples of org.milyn.test.ant.AntRunner

    private Archive buildBindingModel(String urn, String[] messages) throws IOException, SAXException, IllegalNameException, ClassNotFoundException {
        ClassLoader origTCCL = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(mappingModelClassLoader);
        try {
            AntRunner antRunner = new AntRunner("build.xml");
            EJCExecutor ejc = new EJCExecutor();
            File destDir = new File("target/ejc/src");

            antRunner.run("delete");

            if(messages != null && messages.length != 0) {
                ejc.setMessages(CollectionsUtil.toSet(messages));
            }
            ejc.setDestDir(destDir);
            ejc.setEdiMappingModel("urn:" + urn);
            ejc.setPackageName(EJCTestUtil.ORG_SMOOKS_EJC_TEST);

            // Build the source...
            ejc.execute();

            // Compile it...
            antRunner.run("compile");

            // Build and return an archive instance from the compiled sources...
            return new Archive(new ZipInputStream(new FileInputStream("./target/ejc/ejc.jar")));
        } finally {
            Thread.currentThread().setContextClassLoader(origTCCL);
View Full Code Here

Examples of org.milyn.test.ant.AntRunner

    public static Archive buildModelArchive(InputStream mappingModel, String modelJavaPackage) throws EDIConfigurationException, ClassNotFoundException, IOException, SAXException, IllegalNameException {
        BeanWriter.setGenerateFromEDINR(true);

        try {
            AntRunner antRunner = new AntRunner("build.xml");
            EJC ejc = new EJC();

            antRunner.run("delete");
            ejc.compile(mappingModel, modelJavaPackage, "./target/ejc/src");
            antRunner.run("compile");

            return new Archive(new ZipInputStream(new FileInputStream("./target/ejc/ejc.jar")));
        } finally {
            BeanWriter.setGenerateFromEDINR(false);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.