Search in sources :

Example 96 with Processor

use of aQute.bnd.osgi.Processor in project bndtools by bndtools.

the class ResolveJob method validateBeforeRun.

public IStatus validateBeforeRun() {
    try {
        // 
        // The BndEdit model does not do property expansion. So
        // get the processor to get the expansions.
        // 
        Processor p = model.getProperties();
        String runfw = p.getProperty(Constants.RUNFW);
        if (runfw == null)
            return new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, Messages.ResolutionJob_errorFrameworkOrExecutionEnvironmentUnspecified, null);
        String eeStr = p.getProperty(Constants.RUNEE);
        if (eeStr == null)
            return new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, Messages.ResolutionJob_errorFrameworkOrExecutionEnvironmentUnspecified, null);
        EE ee = EE.parse(eeStr);
        if (ee == null) {
            String supportedEEs = Arrays.stream(EE.values()).map(EE::getEEName).collect(Collectors.joining(",\n - "));
            return new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, MessageFormat.format("Unrecognized Execution Environment: \"{0}\".\n\nSupported values are:\n - {1}", eeStr, supportedEEs), null);
        }
        return Status.OK_STATUS;
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
Also used : Status(org.eclipse.core.runtime.Status) IStatus(org.eclipse.core.runtime.IStatus) EE(aQute.bnd.build.model.EE) Processor(aQute.bnd.osgi.Processor)

Example 97 with Processor

use of aQute.bnd.osgi.Processor in project bnd by bndtools.

the class PomResource method asProcessor.

private static Processor asProcessor(Map<String, String> b) {
    Processor p = new Processor();
    p.addProperties(b);
    return p;
}
Also used : Processor(aQute.bnd.osgi.Processor)

Example 98 with Processor

use of aQute.bnd.osgi.Processor in project bnd by bndtools.

the class TestLocalObrGeneration method setUp.

protected void setUp() throws Exception {
    // Ensure output directory exists and is empty
    outputDir = IO.getFile("generated/tmp/test/" + getName());
    IO.delete(outputDir);
    if (!outputDir.exists() && !outputDir.mkdirs()) {
        throw new IOException("Could not create directory " + outputDir);
    }
    // Setup the repo
    reporter = new Processor();
    repo = new LocalIndexedRepo();
    Map<String, String> config = new HashMap<String, String>();
    config.put("local", outputDir.getAbsolutePath());
    config.put("type", "OBR");
    repo.setProperties(config);
    repo.setReporter(reporter);
}
Also used : Processor(aQute.bnd.osgi.Processor) HashMap(java.util.HashMap) IOException(java.io.IOException)

Example 99 with Processor

use of aQute.bnd.osgi.Processor in project bnd by bndtools.

the class TestObrRepo method setUp.

@Override
protected void setUp() throws Exception {
    httpd = new NanoHTTPD(0, IO.getFile("testdata/http"));
    httpdPort = httpd.getPort();
    Sed.file2File(obrSrc, "__httpdPort__", Integer.toString(httpdPort), obrDst);
    reporter = new Processor();
    obr = new FixedIndexedRepo();
    Map<String, String> config = new HashMap<String, String>();
    config.put("name", "obr");
    config.put("locations", new File(obrDst).toURI().toString());
    config.put("type", "OBR");
    obr.setProperties(config);
    obr.setReporter(reporter);
    File tmpFile = File.createTempFile("cache", ".tmp");
    tmpFile.deleteOnExit();
    obr.setCacheDirectory(new File(tmpFile.getAbsolutePath() + ".dir"));
}
Also used : Processor(aQute.bnd.osgi.Processor) HashMap(java.util.HashMap) NanoHTTPD(test.lib.NanoHTTPD) File(java.io.File)

Example 100 with Processor

use of aQute.bnd.osgi.Processor in project bnd by bndtools.

the class TestLocalIndexGeneration method setUp.

protected void setUp() throws Exception {
    // Ensure output directory exists and is empty
    outputDir = IO.getFile("generated/tmp/test/" + getName());
    IO.delete(outputDir);
    if (!outputDir.exists() && !outputDir.mkdirs()) {
        throw new IOException("Could not create directory " + outputDir);
    }
    // Setup the repo
    reporter = new Processor();
    repo = new LocalIndexedRepo();
    config = new HashMap<String, String>();
    config.put("local", outputDir.getAbsolutePath());
    config.put("type", "R5");
    config.put("pretty", "true");
    repo.setProperties(config);
    repo.setReporter(reporter);
}
Also used : Processor(aQute.bnd.osgi.Processor) IOException(java.io.IOException)

Aggregations

Processor (aQute.bnd.osgi.Processor)185 HashMap (java.util.HashMap)43 File (java.io.File)37 Macro (aQute.bnd.osgi.Macro)29 Workspace (aQute.bnd.build.Workspace)27 Jar (aQute.bnd.osgi.Jar)17 HttpClient (aQute.bnd.http.HttpClient)14 Baseline (aQute.bnd.differ.Baseline)12 DiffPluginImpl (aQute.bnd.differ.DiffPluginImpl)12 BundleInfo (aQute.bnd.differ.Baseline.BundleInfo)10 IOException (java.io.IOException)10 Resource (org.osgi.resource.Resource)10 Info (aQute.bnd.differ.Baseline.Info)8 Version (aQute.bnd.version.Version)8 ArrayList (java.util.ArrayList)8 List (java.util.List)7 ProgressPlugin (aQute.bnd.service.progress.ProgressPlugin)6 Collection (java.util.Collection)6 Properties (java.util.Properties)6 Parameters (aQute.bnd.header.Parameters)5