Search in sources :

Example 31 with Workspace

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

the class ProjectTest method testBumpIncludeFile.

public void testBumpIncludeFile() throws Exception {
    Workspace ws = getWorkspace("testresources/ws");
    Project project = ws.getProject("bump-included");
    project.setTrace(true);
    Version old = new Version(project.getProperty("Bundle-Version"));
    assertEquals(new Version(1, 0, 0), old);
    project.bump("=+0");
    Processor processor = new Processor();
    processor.setProperties(project.getFile("include.txt"));
    Version newv = new Version(processor.getProperty("Bundle-Version"));
    System.err.println("New version " + newv);
    assertEquals(1, newv.getMajor());
    assertEquals(1, newv.getMinor());
    assertEquals(0, newv.getMicro());
}
Also used : Project(aQute.bnd.build.Project) Processor(aQute.bnd.osgi.Processor) Version(aQute.bnd.version.Version) Workspace(aQute.bnd.build.Workspace)

Example 32 with Workspace

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

the class ProjectTest method testProjectReferringToItself.

/**
	 * #194 StackOverflowError when -runbundles in bnd.bnd refers to itself
	 */
public void testProjectReferringToItself() throws Exception {
    Workspace ws = getWorkspace(IO.getFile("testresources/ws"));
    Project top = ws.getProject("bug194");
    top.setDelayRunDependencies(false);
    top.addClasspath(top.getOutput());
    assertTrue(top.check("Circular dependency context"));
}
Also used : Project(aQute.bnd.build.Project) Workspace(aQute.bnd.build.Workspace)

Example 33 with Workspace

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

the class ProjectTest method testBuildAll.

private Project testBuildAll(String dependsOn, int count) throws Exception {
    Workspace ws = new Workspace(IO.getFile("testresources/ws"));
    Project all = ws.getProject("build-all");
    all.setProperty("-dependson", dependsOn);
    all.prepare();
    Collection<Project> dependson = all.getDependson();
    assertEquals(count, dependson.size());
    return all;
}
Also used : Project(aQute.bnd.build.Project) Workspace(aQute.bnd.build.Workspace)

Example 34 with Workspace

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

the class ProjectTest method testBump.

public void testBump() throws Exception {
    Workspace ws = getWorkspace("testresources/ws");
    Project project = ws.getProject("p1");
    int size = project.getProperties().size();
    Version old = new Version(project.getProperty("Bundle-Version"));
    System.err.println("Old version " + old);
    project.bump("=+0");
    Version newv = new Version(project.getProperty("Bundle-Version"));
    System.err.println("New version " + newv);
    assertEquals(old.getMajor(), newv.getMajor());
    assertEquals(old.getMinor() + 1, newv.getMinor());
    assertEquals(0, newv.getMicro());
    assertEquals(size, project.getProperties().size());
    assertEquals("sometime", newv.getQualifier());
}
Also used : Project(aQute.bnd.build.Project) Version(aQute.bnd.version.Version) Workspace(aQute.bnd.build.Workspace)

Example 35 with Workspace

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

the class ProjectTest method testHashVersionWithAlgorithm.

public void testHashVersionWithAlgorithm() throws Exception {
    Workspace ws = getWorkspace(IO.getFile("testresources/ws-versionhash"));
    Project project = ws.getProject("p1");
    assertNotNull(project);
    project.setProperty("-buildpath", "tmp; version=hash; hash=SHA-256:7fe83bfd5999fa4ef9cec40282d5d67dd0ff3303bac6b8c7b0e8be80a821441c");
    ArrayList<Container> buildpath = new ArrayList<Container>(project.getBuildpath());
    assertEquals(1, buildpath.size());
    assertEquals("bar", buildpath.get(0).getManifest().getMainAttributes().getValue("Prints"));
}
Also used : Project(aQute.bnd.build.Project) Container(aQute.bnd.build.Container) ArrayList(java.util.ArrayList) Workspace(aQute.bnd.build.Workspace)

Aggregations

Workspace (aQute.bnd.build.Workspace)171 Project (aQute.bnd.build.Project)71 File (java.io.File)66 Processor (aQute.bnd.osgi.Processor)27 HashMap (java.util.HashMap)22 IOException (java.io.IOException)20 ArrayList (java.util.ArrayList)19 Container (aQute.bnd.build.Container)17 RepositoryPlugin (aQute.bnd.service.RepositoryPlugin)13 Version (aQute.bnd.version.Version)13 Run (aQute.bnd.build.Run)11 IProject (org.eclipse.core.resources.IProject)11 CoreException (org.eclipse.core.runtime.CoreException)10 IResource (org.eclipse.core.resources.IResource)8 BndEditModel (aQute.bnd.build.model.BndEditModel)7 Description (aQute.lib.getopt.Description)7 Bndrun (biz.aQute.resolve.Bndrun)7 Attrs (aQute.bnd.header.Attrs)5 HttpClient (aQute.bnd.http.HttpClient)5 Jar (aQute.bnd.osgi.Jar)5