Java 类org.apache.tools.ant.helper.ProjectHelper2 实例源码

项目:incubator-netbeans    文件:NbAntlib.java   
/**
 * Process antlib.xml definitions.
 * @param p a project to add definitions to
 * @param antlib location of antlib.xml to load
 * @param uri a URI to add definitions in, or null
 * @param l a class loader to load defined classes from
 */
public static void process(Project p, URL antlib, String uri, ClassLoader l) throws IOException, BuildException {
    ComponentHelper helper = ComponentHelper.getComponentHelper(p);
    helper.enterAntLib(uri);
    Antlib al;
    try {
        UnknownElement antlibElement = new ProjectHelper2().parseUnknownElement(p, antlib);
        al = new NbAntlib(uri, l);
        al.setProject(p);
        al.setLocation(antlibElement.getLocation());
        al.init();
        antlibElement.configure(al);
    } finally {
        helper.exitAntLib();
    }
    al.execute();
}
项目:ant    文件:Description.java   
/**
 * Return the descriptions from all the targets of
 * a project.
 *
 * @param project the project to get the descriptions for.
 * @return a string containing the concatenated descriptions of
 *         the targets.
 */
public static String getDescription(Project project) {
    List<Target> targets = project.getReference(ProjectHelper2.REFID_TARGETS);
    if (targets == null) {
        return null;
    }
    StringBuilder description = new StringBuilder();
    for (Target t : targets) {
        concatDescriptions(project, t, description);
    }
    return description.toString();
}