Search in sources :

Example 66 with Workspace

use of aQute.bnd.build.Workspace in project bnd by bndtools.

the class MavenTest method getProject.

/**
	 * @throws Exception
	 */
protected static Project getProject(String name) throws Exception {
    File wsf = IO.getFile(cwd, "testresources/ws");
    Workspace ws = Workspace.getWorkspace(wsf);
    assertNotNull(ws);
    Project project = ws.getProject(name);
    assertNotNull(project);
    return project;
}
Also used : Project(aQute.bnd.build.Project) File(java.io.File) Workspace(aQute.bnd.build.Workspace)

Example 67 with Workspace

use of aQute.bnd.build.Workspace in project bnd by bndtools.

the class ProjectLaunchImplTest method setUp.

protected void setUp() throws Exception {
    tmp = new File("generated/tmp/test/" + getName());
    tmp.mkdirs();
    IO.copy(IO.getFile("testresources/ws"), tmp);
    ws = new Workspace(tmp);
}
Also used : File(java.io.File) Workspace(aQute.bnd.build.Workspace)

Example 68 with Workspace

use of aQute.bnd.build.Workspace in project bnd by bndtools.

the class PomRepositoryTest method testMultipleRevisions.

public void testMultipleRevisions() throws Exception {
    BndPomRepository mcsr = new BndPomRepository();
    Workspace w = Workspace.createStandaloneWorkspace(new Processor(), tmp.toURI());
    w.setBase(tmp);
    mcsr.setRegistry(w);
    File local = new File(tmp, "m2-repository");
    local.mkdirs();
    Map<String, String> config = new HashMap<>();
    config.put("name", "test-dependencies");
    String revisions = Strings.join(new String[] { "biz.aQute.bnd:biz.aQute.junit:3.3.0", "biz.aQute.bnd:biz.aQute.launcher:3.3.0", "biz.aQute.bnd:biz.aQute.remote.launcher:3.3.0", "biz.aQute.bnd:biz.aQute.tester:3.3.0" });
    config.put("revision", revisions);
    config.put("snapshotUrls", "https://repo1.maven.org/maven2/");
    config.put("releaseUrls", "https://repo1.maven.org/maven2/");
    config.put("local", local.getAbsolutePath());
    config.put("transitive", "true");
    mcsr.setProperties(config);
    List<String> list = mcsr.list(null);
    assertNotNull(list);
    assertEquals(4, list.size());
    RequirementBuilder builder = mcsr.newRequirementBuilder("osgi.identity");
    builder.addAttribute("filter", "(osgi.identity=biz.aQute.tester)");
    Promise<Collection<Resource>> providers = mcsr.findProviders(builder.buildExpression());
    Collection<Resource> resources = providers.getValue();
    assertFalse(resources.isEmpty());
}
Also used : Processor(aQute.bnd.osgi.Processor) HashMap(java.util.HashMap) Resource(org.osgi.resource.Resource) RequirementBuilder(org.osgi.service.repository.RequirementBuilder) Collection(java.util.Collection) File(java.io.File) Workspace(aQute.bnd.build.Workspace)

Example 69 with Workspace

use of aQute.bnd.build.Workspace in project bnd by bndtools.

the class PomRepositoryTest method testBndPomRepoURI.

public void testBndPomRepoURI() throws Exception {
    final BndPomRepository bpr = new BndPomRepository();
    Workspace w = Workspace.createStandaloneWorkspace(new Processor(), tmp.toURI());
    w.setBase(tmp);
    bpr.setRegistry(w);
    Map<String, String> config = new HashMap<>();
    config.put("pom", "https://repo1.maven.org/maven2/org/apache/felix/org.apache.felix.gogo.shell/0.12.0/org.apache.felix.gogo.shell-0.12.0.pom");
    config.put("snapshotUrls", "https://repo1.maven.org/maven2/");
    config.put("releaseUrls", "https://repo1.maven.org/maven2/");
    config.put("name", "test");
    bpr.setProperties(config);
    List<String> list = bpr.list(null);
    assertNotNull(list);
    assertEquals(1, list.size());
    RequirementBuilder builder = bpr.newRequirementBuilder("osgi.identity");
    builder.addDirective("filter", "(osgi.identity=org.apache.felix.gogo.runtime)");
    Promise<Collection<Resource>> providers = bpr.findProviders(builder.buildExpression());
    Collection<Resource> resources = providers.getValue();
    assertFalse(resources.isEmpty());
    assertEquals(1, resources.size());
}
Also used : Processor(aQute.bnd.osgi.Processor) HashMap(java.util.HashMap) Resource(org.osgi.resource.Resource) Collection(java.util.Collection) RequirementBuilder(org.osgi.service.repository.RequirementBuilder) Workspace(aQute.bnd.build.Workspace)

Example 70 with Workspace

use of aQute.bnd.build.Workspace in project bnd by bndtools.

the class PomRepositoryTest method testBndPomRepoFileExistingParent.

public void testBndPomRepoFileExistingParent() throws Exception {
    BndPomRepository bpr = new BndPomRepository();
    Workspace w = Workspace.createStandaloneWorkspace(new Processor(), tmp.toURI());
    w.setBase(tmp);
    bpr.setRegistry(w);
    Map<String, String> config = new HashMap<>();
    config.put("pom", "testdata/pomrepo/existing-parent.xml");
    config.put("snapshotUrls", "https://repo1.maven.org/maven2/");
    config.put("releaseUrls", "https://repo1.maven.org/maven2/");
    config.put("name", "test");
    bpr.setProperties(config);
    List<String> list = bpr.list(null);
    assertNotNull(list);
    assertEquals(1, list.size());
}
Also used : Processor(aQute.bnd.osgi.Processor) HashMap(java.util.HashMap) Workspace(aQute.bnd.build.Workspace)

Aggregations

Workspace (aQute.bnd.build.Workspace)164 Project (aQute.bnd.build.Project)69 File (java.io.File)62 Processor (aQute.bnd.osgi.Processor)26 IOException (java.io.IOException)20 HashMap (java.util.HashMap)20 Container (aQute.bnd.build.Container)15 ArrayList (java.util.ArrayList)15 Version (aQute.bnd.version.Version)13 RepositoryPlugin (aQute.bnd.service.RepositoryPlugin)12 IProject (org.eclipse.core.resources.IProject)10 Run (aQute.bnd.build.Run)9 CoreException (org.eclipse.core.runtime.CoreException)9 Description (aQute.lib.getopt.Description)7 Collection (java.util.Collection)6 BndEditModel (aQute.bnd.build.model.BndEditModel)5 Jar (aQute.bnd.osgi.Jar)5 HttpTestServer (aQute.http.testservers.HttpTestServer)5 BuildException (org.apache.tools.ant.BuildException)5 IResource (org.eclipse.core.resources.IResource)5