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);
}
}
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;
}
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);
}
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"));
}
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);
}
Aggregations