Examples of Ant


Examples of com.chkris.ant.model.Ant

        }
    }

    public void sentAllAnts(Graph graph) {
            for(int i=0; i < antAlgorithmSettings.getMaximalNumberOfAnts(); i++) {
                antList.add(new Ant());
            }

            for (Ant ant : antList) {
                sendAnt(graph, ant);
                pheromoneEvaporation(graph, ant);
View Full Code Here

Examples of hudson.tasks.Ant

        Ant.AntInstallation ant = configureDefaultAnt();
        String antPath = ant.getHome();
        Jenkins.getInstance().getDescriptorByType(Ant.DescriptorImpl.class).setInstallations(new AntInstallation("ant", "THIS IS WRONG"));

        project.setScm(new SingleFileSCM("build.xml", "<project name='foo'/>"));
        project.getBuildersList().add(new Ant("-version", "ant", null,null,null));
        configureDumpEnvBuilder();

        Build build = project.scheduleBuild2(0).get();
        assertBuildStatus(Result.FAILURE, build);
View Full Code Here

Examples of hudson.tasks.Ant

            for (String key : additionalProperties.stringPropertyNames()) {
                properties.append("\n");
                properties.append(key).append("=").append(additionalProperties.getProperty(key));
            }
        }
        return new Ant(getCalculatedTargets(overrideTargets == null ? targets : overrideTargets, environments), antName,
                getCalculatedAntOpts(environments), buildFile, properties.length() == 0 ? null : properties.toString());
    }
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.Ant

        File f = getBuildFile(event);
        if (f.exists()) {
            if (onlyOnce && isBuilt(f)) {
                Message.verbose("target build file already built, skipping: " + f);
            } else {
                Ant ant = new Ant();
                Project project = (Project) IvyContext
                        .peekInContextStack(IvyTask.ANT_PROJECT_CONTEXT_KEY);
                if (project == null) {
                    project = new Project();
                    project.init();
                }

                ant.setProject(project);
                ant.setTaskName("ant");

                ant.setAntfile(f.getAbsolutePath());
                ant.setInheritAll(false);
                String target = getTarget();
                if (target != null) {
                    ant.setTarget(target);
                }
                Map atts = event.getAttributes();
                for (Iterator iter = atts.keySet().iterator(); iter.hasNext();) {
                    String key = (String) iter.next();
                    String value = (String) atts.get(key);
                    if (value != null) {
                        Property p = ant.createProperty();
                        p.setName(prefix == null ? key : prefix + key);
                        p.setValue(value);
                    }
                }

                Message.verbose("triggering build: " + f + " target=" + target + " for " + event);
                try {
                    ant.execute();
                } catch (BuildException e) {
                    Message.verbose("Exception occurred while executing target " + target);
                    throw e;
                }
                markBuilt(f);
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.Ant

                         final Project project )
        throws BuildException
    {
        validate();

        final Ant ant = (Ant)project.createTask( "ant" );
        ant.setInheritAll( false );
        ant.setAntfile( m_antfile.getName() );

        try
        {
            final File dir =
                m_antfile.getParentFile().getCanonicalFile();
            ant.setDir( dir );
        }
        catch( final IOException ioe )
        {
            throw new BuildException( ioe.getMessage(), ioe );
        }

        if( null != m_target )
        {
            ant.setTarget( m_target );
        }

        ant.execute();

        return m_destfile;
    }
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.Ant

    public File resolve(final Extension extension,
                         final Project project)
        throws BuildException {
        validate();

        final Ant ant = (Ant) project.createTask("ant");
        ant.setInheritAll(false);
        ant.setAntfile(m_antfile.getName());

        try {
            final File dir =
                m_antfile.getParentFile().getCanonicalFile();
            ant.setDir(dir);
        } catch (final IOException ioe) {
            throw new BuildException(ioe.getMessage(), ioe);
        }

        if (null != m_target) {
            ant.setTarget(m_target);
        }

        ant.execute();

        return m_destfile;
    }
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.Ant

      }
      System.out.println();
    }
   
    for (BuildBundleDescriptor descriptor : buildOrder) {
      Ant antTask = new Ant(this);
      File buildFile = descriptor.getBuildFile();
      System.out.println("Building " + buildFile);
      antTask.setAntfile(buildFile.toString());
      antTask.setDir(buildFile.getParentFile());
      if (buildTarget != null) {
        antTask.setTarget(buildTarget);
      }
      antTask.setInheritAll(inheritAll);
      antTask.setInheritRefs(inheritRefs);
      antTask.execute();
    }
   
  }
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.Ant

        File f = getBuildFile(event);
        if (f.exists()) {
            if (onlyOnce && isBuilt(f)) {
                Message.verbose("target build file already built, skipping: " + f);
            } else {
                Ant ant = new Ant();
                Project project = (Project) IvyContext.peekInContextStack(
                    IvyTask.ANT_PROJECT_CONTEXT_KEY);
                if (project == null) {
                    project = new Project();
                    project.init();
                }

                ant.setProject(project);
                ant.setTaskName("ant");

                ant.setAntfile(f.getAbsolutePath());
                ant.setInheritAll(false);
                String target = getTarget();
                if (target != null) {
                    ant.setTarget(target);
                }
                Map atts = event.getAttributes();
                for (Iterator iter = atts.keySet().iterator(); iter.hasNext();) {
                    String key = (String) iter.next();
                    String value = (String) atts.get(key);
                    Property p = ant.createProperty();
                    p.setName(prefix == null ? key : prefix + key);
                    p.setValue(value);
                }

                Message.verbose("triggering build: " + f + " target=" + target + " for " + event);
                try {
                    ant.execute();
                } catch (BuildException e) {
                    Message.verbose("Exception occurred while executing target " + target);
                    e.printStackTrace(); // TODO: remove when finished debugging
                    throw e;
                }
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.Ant

        File f = getBuildFile(event);
        if (f.exists()) {
            if (onlyOnce && isBuilt(f)) {
                Message.verbose("target build file already built, skipping: " + f);
            } else {
                Ant ant = new Ant();
                Project project = (Project) IvyContext.getContext().peek(
                    IvyTask.ANT_PROJECT_CONTEXT_KEY);
                if (project == null) {
                    project = new Project();
                    project.init();
                }

                ant.setProject(project);
                ant.setTaskName("ant");

                ant.setAntfile(f.getAbsolutePath());
                ant.setInheritAll(false);
                String target = getTarget();
                if (target != null) {
                    ant.setTarget(target);
                }
                Map atts = event.getAttributes();
                for (Iterator iter = atts.keySet().iterator(); iter.hasNext();) {
                    String key = (String) iter.next();
                    String value = (String) atts.get(key);
                    Property p = ant.createProperty();
                    p.setName(prefix == null ? key : prefix + key);
                    p.setValue(value);
                }

                Message.verbose("triggering build: " + f + " target=" + target + " for " + event);
                MessageImpl impl = IvyContext.getContext().getMessageImpl();
                try {
                    IvyContext.getContext().setMessageImpl(null);
                    try {
                        ant.execute();
                    } catch (BuildException e) {
                        Message.verbose("Exception occurred while executing target " + target);
                        e.printStackTrace(); // TODO: remove when finished debugging
                        throw e;
                    }
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.Ant

    File f = getBuildFile(event);
    if (f.exists()) {
      if (_onlyonce && isBuilt(f)) {
        Message.verbose("target build file already built, skipping: "+f);
      } else {
        Ant ant = new Ant();
        Project project = (Project)IvyContext.getContext().get(IvyTask.ANT_PROJECT_CONTEXT_KEY);
        if (project == null) {
          project = new Project();
          project.init();
        }
       
        ant.setProject(project);
        ant.setTaskName("ant");
       
        ant.setAntfile(f.getAbsolutePath());
        ant.setInheritAll(false);
        String target = getTarget();
        if (target != null) {
          ant.setTarget(target);
        }
        Map atts = event.getAttributes();
        for (Iterator iter = atts.keySet().iterator(); iter.hasNext();) {
          String key = (String) iter.next();
          String value = (String) atts.get(key);
          Property p = ant.createProperty();
          p.setName(_prefix == null?key:_prefix+key);
          p.setValue(value);
        }
       
        Message.verbose("triggering build: "+f+" target="+target+" for "+event);
                MessageImpl impl = IvyContext.getContext().getMessageImpl();
                try {
                  IvyContext.getContext().setMessageImpl(null);
                  try {
                    ant.execute();
                  } catch (BuildException e) {
                    Message.verbose("Exception occurred while executing target " + target);
                    e.printStackTrace(); // TODO: remove when finished debugging
                    throw e;
                  }
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.