/** * Return the builder associated with the give bnd file or null. The bnd.bnd * file can contain -sub option. This option allows specifying files in the * same directory that should drive the generation of multiple deliverables. * This method figures out if the bndFile is actually one of the bnd files * of a deliverable. * * @param bndFile * A file pointing to a bnd file. * @return null or the builder for a sub file. * @throws Exception */ public Builder getSubBuilder(File bndFile) throws Exception { bndFile = bndFile.getCanonicalFile(); // Verify that we are inside the project. File base = getBase().getCanonicalFile(); if (!bndFile.getAbsolutePath().startsWith(base.getAbsolutePath())) return null; Collection< ? extends Builder> builders = getSubBuilders(); for (Builder sub : builders) { File propertiesFile = sub.getPropertiesFile(); if (propertiesFile != null) { if (propertiesFile.getCanonicalFile().equals(bndFile)) { // Found it! return sub; } } } return null; }
/** * Return the builder associated with the give bnd file or null. The bnd.bnd * file can contain -sub option. This option allows specifying files in the * same directory that should drive the generation of multiple deliverables. * This method figures out if the bndFile is actually one of the bnd files * of a deliverable. * * @param bndFile * A file pointing to a bnd file. * @return null or the builder for a sub file. * @throws Exception */ public Builder getSubBuilder(File bndFile) throws Exception { bndFile = bndFile.getCanonicalFile(); // Verify that we are inside the project. File base = getBase().getCanonicalFile(); if (!bndFile.getAbsolutePath().startsWith(base.getAbsolutePath())) return null; Collection< ? extends Builder> builders = getSubBuilders(); for (Builder sub : builders) { File propertiesFile = sub.getPropertiesFile(); if (propertiesFile != null) { if (propertiesFile.getCanonicalFile().equals(bndFile)) { // Found it! return sub; } } } return null; }
/** * Return the builder associated with the give bnd file or null. The bnd.bnd * file can contain -sub option. This option allows specifying files in the * same directory that should drive the generation of multiple deliverables. * This method figures out if the bndFile is actually one of the bnd files * of a deliverable. * * @param bndFile * A file pointing to a bnd file. * @return null or the builder for a sub file. * @throws Exception */ public Builder getSubBuilder(File bndFile) throws Exception { bndFile = bndFile.getCanonicalFile(); // Verify that we are inside the project. File base = getBase().getCanonicalFile(); if (!bndFile.getAbsolutePath().startsWith(base.getAbsolutePath())) return null; Collection< ? extends Builder> builders = getSubBuilders(); for (Builder sub : builders) { File propertiesFile = sub.getPropertiesFile(); if (propertiesFile != null) { if (propertiesFile.getCanonicalFile().equals(bndFile)) { // Found it! return sub; } } } return null; }
try { for (Builder b : pb.getSubBuilders()) { File propertiesFile = b.getPropertiesFile(); if (propertiesFile != null) { if (propertiesFile.equals(bndFile)) {
try { for (Builder b : pb.getSubBuilders()) { File propertiesFile = b.getPropertiesFile(); if (propertiesFile != null) { if (propertiesFile.equals(bndFile)) {
found |= replace(sub.getPropertiesFile(), pattern, replace);
found |= replace(sub.getPropertiesFile(), pattern, replace);
getInfo(b, b.getPropertiesFile().getName()); if (isOk()) { b.save(outputFile, options.force());
found |= replace(sub.getPropertiesFile(), pattern, replace);
found |= replace(sub.getPropertiesFile(), pattern, replace);
found |= replace(sub.getPropertiesFile(), pattern, replace);
public void build(String dest, boolean force, String path) throws IOException, Exception { Builder b = new Builder(); try { File f = getFile(path); if (!f.isFile()) { error("No such file %s", f); return; } b.setTrace(isTrace()); b.setPedantic(isPedantic()); b.setProperties(f); List<Builder> subs = b.getSubBuilders(); for (Builder bb : subs) { trace("building %s", bb.getPropertiesFile()); bb.build(); File out = bb.getOutputFile(dest); getInfo(bb, bb.getBsn() + ": "); if (isOk()) { bb.save(out, force); } getInfo(bb, bb.getBsn() + ": "); // pickup any save errors if (!isOk()) { out.delete(); } } } finally { b.close(); } }