/** * 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(); }
/** * 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(); }