use of aQute.bnd.build.Workspace in project bnd by bndtools.
the class ProjectTest method testNoCanonicalName.
/**
* Test linked canonical name
*/
public void testNoCanonicalName() throws Exception {
Workspace ws = getWorkspace("testresources/ws");
Project project = ws.getProject("p6");
project.clean();
// Now we build it.
File[] files = project.build();
assertTrue(project.check());
assertNotNull(files);
assertEquals(1, files.length);
assertEquals("p6.jar", files[0].getName());
File f = new File(project.getTarget(), "p6.jar");
assertTrue(f.isFile());
assertFalse(IO.isSymbolicLink(f));
}
use of aQute.bnd.build.Workspace in project bnd by bndtools.
the class EclipsePlugin method created.
@Override
public void created(Project p) throws IOException {
Workspace workspace = p.getWorkspace();
copy("project", ".project", p);
copy("classpath", ".classpath", p);
}
use of aQute.bnd.build.Workspace in project bnd by bndtools.
the class MavenPlugin method created.
@Override
public void created(Project p) throws IOException {
Workspace workspace = p.getWorkspace();
copy("pom.xml", "pom.xml", p);
File root = workspace.getFile("pom.xml");
doRoot(p, root);
String rootPom = IO.collect(root);
if (!rootPom.contains(getTag(p))) {
rootPom = rootPom.replaceAll("<!-- DO NOT EDIT MANAGED BY BND MAVEN LIFECYCLE PLUGIN -->\n", "$0\n\t\t" + getTag(p) + "\n");
IO.store(rootPom, root);
}
}
use of aQute.bnd.build.Workspace in project bnd by bndtools.
the class Plugin method init.
/**
* This is called when all initialization is done for the plugins, now we
* can obtain a list of appropriate repos.
*/
public void init() {
if (init)
return;
init = true;
try {
//
// Get the list if repos registered, repos that we can handle
//
List<InfoRepository> irs = new ArrayList<InfoRepository>();
for (InfoRepository ir : registry.getPlugins(InfoRepository.class)) {
irs.add(ir);
}
this.wrapper = new InfoRepositoryWrapper(dir, irs);
if (config.reindex())
this.wrapper.clear();
if (config.augments() != null) {
Workspace workspace = registry.getPlugin(Workspace.class);
try (Processor p = new Processor(workspace)) {
if (!config.augments().equals("WORKSPACE")) {
File f = IO.getFile(workspace.getBuildDir(), config.augments());
if (!f.isFile()) {
if (reporter != null)
reporter.error("No augment file found at %s", f.getAbsolutePath());
return;
}
//
// We read this in a processor that extends the
// workspace so
// we
// can use workspace properties
//
p.setProperties(f);
this.wrapper.clear(f.lastModified());
}
//
// And then add it to the indexer to use.
//
this.wrapper.addAugment(p.getFlattenedProperties());
this.wrapper.clear(workspace.getPropertiesFile().lastModified());
}
}
} catch (Exception e) {
throw Exceptions.duck(e);
}
}
use of aQute.bnd.build.Workspace in project bnd by bndtools.
the class ResolveTest method assertInclude.
/*
* Create a BndrunResolveContext with a skip of 'workspace' in the
* workspace, and then use different files that get -resolve.effective from
* the include file or the bndrun file.
*/
private void assertInclude(String file, String value) throws Exception {
LogService log = Mockito.mock(LogService.class);
File f = IO.getFile("testdata/resolve/includebndrun/" + file);
File wsf = IO.getFile("testdata/ws");
Workspace ws = Workspace.getWorkspace(wsf);
ws.setProperty("-resolve.effective", "active;skip:='workspace'");
Run run = Run.createRun(ws, f);
BndrunResolveContext context = new BndrunResolveContext(run, run, ws, log);
context.init();
Map<String, Set<String>> effectiveSet = context.getEffectiveSet();
assertNotNull(effectiveSet.get("active"));
assertTrue(effectiveSet.get("active").contains(value));
}
Aggregations