Java Code Examples for org.apache.tools.ant.Task#maybeConfigure()

The following examples show how to use org.apache.tools.ant.Task#maybeConfigure() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IncrementalDeploymentTask.java    From aws-ant-tasks with Apache License 2.0 6 votes vote down vote up
/**
 * Deploys all apps in this deployment group, then waits for all the
 * deployments in the group to succeed. Deployments in a group will run
 * in parallel.
 */
public void deployApps() {
    for (Task deployAppTask : deployAppTasks) {
        
        // This is in case of a rare bug that occurs in some JVM implementations
        if (deployAppTask instanceof UnknownElement) {
            deployAppTask.maybeConfigure();
            deployAppTask = ((UnknownElement) deployAppTask).getTask();
        }
        if (!deployAppTask.getTaskName().equals("deploy-opsworks-app")) {
            throw new BuildException(
                    "Only <deploy-opsworks-app> elements are supported");
        }
        deployAppTask.execute();
        deploymentIds.add(deployAppTask.getDescription());
    }

    try {
        waitForDeploymentGroupToSucceed(deploymentIds, client);
    } catch (InterruptedException e) {
        throw new BuildException(e.getMessage(), e);
    }
}
 
Example 2
Source File: ForEachTask.java    From development with Apache License 2.0 5 votes vote down vote up
@Override
public void execute() throws BuildException {
    final String bak = getProject().getProperty(property);
    for (String token : tokens) {
        getProject().setProperty(property, token);
        for (Task task : tasks) {
            task.maybeConfigure();
            task.execute();
        }
    }
    if (bak != null) {
        getProject().setProperty(property, bak);
    }
}
 
Example 3
Source File: SpoofTaskContainer.java    From groovy with Apache License 2.0 5 votes vote down vote up
public void addTask(Task task) {
    // to work with ant 1.6
    spoof("in addTask");
    if (task instanceof UnknownElement) {
        spoof("configuring UnknownElement");
        task.maybeConfigure();
        task = ((UnknownElement) task).getTask();
    }
    tasks.add(task);
}
 
Example 4
Source File: SequentialElement.java    From ExpectIt with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 * <p/>
 * Passes the {@code expect} instance to the children tasks that are instanceof
 * {@link net.sf.expectit.ant.matcher.AbstractTaskElement}.
 */
@Override
public void execute() {
    for (Task t : tasks) {
        if (t instanceof UnknownElement) {
            t.maybeConfigure();
            Object proxy = ((UnknownElement) t).getWrapper().getProxy();
            if (proxy instanceof AbstractTaskElement) {
                ((AbstractTaskElement) proxy).setExpect(expect);
            }
        }
    }
    super.execute();
}