Search in sources :

Example 1 with ProductConfigurations

use of org.eclipse.tycho.versions.engine.ProductConfigurations 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();
}
Also used : ProductConfigurations(org.eclipse.tycho.versions.engine.ProductConfigurations) IOException(java.io.IOException) PomFile(org.eclipse.tycho.versions.pom.PomFile) File(java.io.File) ProductFileFilter(org.eclipse.tycho.versions.utils.ProductFileFilter)

Aggregations

File (java.io.File)1 IOException (java.io.IOException)1 ProductConfigurations (org.eclipse.tycho.versions.engine.ProductConfigurations)1 PomFile (org.eclipse.tycho.versions.pom.PomFile)1 ProductFileFilter (org.eclipse.tycho.versions.utils.ProductFileFilter)1