use of org.eclipse.tycho.versions.utils.ProductFileFilter in project tycho by eclipse.
the class EclipseRepositoryProductFileManipulator method getProductConfigurations.
private Map<File, ProductConfiguration> getProductConfigurations(ProjectMetadata project) {
ProductConfigurations products = project.getMetadata(ProductConfigurations.class);
if (products == null) {
products = new ProductConfigurations();
File[] productFiles = project.getBasedir().listFiles(new ProductFileFilter());
if (productFiles != null) {
for (File productFile : productFiles) {
try {
products.addProductConfiguration(productFile, ProductConfiguration.read(productFile));
} catch (IOException e) {
throw new IllegalArgumentException("Could not read product configuration file " + productFile, e);
}
}
}
project.putMetadata(products);
}
return products.getProductConfigurations();
}
use of org.eclipse.tycho.versions.utils.ProductFileFilter in project tycho by eclipse.
the class VersionUpdater method findProductFile.
private static File findProductFile(ProjectMetadata project, PomFile pom, Logger logger) {
File productFile = new File(project.getBasedir(), pom.getArtifactId() + ".product");
if (productFile.exists()) {
return productFile;
}
File[] productFiles = project.getBasedir().listFiles(new ProductFileFilter());
if (productFiles == null || productFiles.length == 0) {
logger.warn("Skipping updating pom in directory " + project.getBasedir() + " because no product file found to extract the (new) version");
return null;
}
if (productFiles.length > 1) {
logger.warn("Skipping updating pom in directory " + project.getBasedir() + " because more than one product files have been found. Only one product file is supported or one must be named <artifactId>.product");
return null;
}
return productFiles[0];
}
Aggregations