Search in sources :

Example 51 with Project

use of aQute.bnd.build.Project 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));
}
Also used : Project(aQute.bnd.build.Project) File(java.io.File) Workspace(aQute.bnd.build.Workspace)

Example 52 with Project

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

the class EclipsePlugin method init.

@Override
public void init(Workspace ws) throws Exception {
    Project p = new Project(ws, ws.getFile("cnf"));
    created(p);
    for (Project pp : ws.getAllProjects()) {
        created(pp);
    }
}
Also used : Project(aQute.bnd.build.Project)

Example 53 with Project

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

the class LauncherTest method testUnresolved.

public void testUnresolved() throws Exception {
    Project project = getProject();
    project.clear();
    project.setProperty(Constants.RUNTRACE, "true");
    String mandatorynoversion = IO.getFile("jar/mandatorynoversion.jar").getAbsolutePath();
    String runbundles = project.getProperty(Constants.RUNBUNDLES);
    project.setProperty(Constants.RUNBUNDLES, runbundles + "," + mandatorynoversion + ";version=file");
    ProjectTester tester = project.getProjectTester();
    tester.prepare();
    ProjectLauncher l = tester.getProjectLauncher();
    l.addRunBundle(mandatorynoversion);
    l.setTimeout(25000, TimeUnit.MILLISECONDS);
    l.setTrace(true);
    assertEquals(1, l.launch());
}
Also used : Project(aQute.bnd.build.Project) ProjectLauncher(aQute.bnd.build.ProjectLauncher) ProjectTester(aQute.bnd.build.ProjectTester)

Example 54 with Project

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

the class LauncherTest method testAgent.

/**
	 * Test the java agent
	 * 
	 * @throws Exception
	 */
public static void testAgent() throws Exception {
    Project project = getProject();
    project.clear();
    project.setProperty("-javaagent", "true");
    ProjectLauncher l = project.getProjectLauncher();
    l.setTrace(true);
    l.getRunProperties().put("test.cmd", "agent");
    assertEquals(55, l.launch());
}
Also used : Project(aQute.bnd.build.Project) ProjectLauncher(aQute.bnd.build.ProjectLauncher)

Example 55 with Project

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

the class LocationTest method testHeaderInSub.

public void testHeaderInSub() throws Exception {
    Project project = ws.getProject("locationtest");
    Builder builder = project.getSubBuilders().iterator().next();
    assertNotNull(builder);
    FileLine fl = builder.getHeader("-inprojectsep", "BAZ");
    assertNotNull(fl);
    assertEquals(project.getPropertiesFile().getAbsolutePath(), fl.file.getAbsolutePath());
    assertEquals(10, fl.line);
    assertEquals(104, fl.start);
    assertEquals(107, fl.end);
}
Also used : Project(aQute.bnd.build.Project) Builder(aQute.bnd.osgi.Builder) ProjectBuilder(aQute.bnd.build.ProjectBuilder) FileLine(aQute.bnd.osgi.Processor.FileLine)

Aggregations

Project (aQute.bnd.build.Project)140 Workspace (aQute.bnd.build.Workspace)70 File (java.io.File)45 ArrayList (java.util.ArrayList)22 IProject (org.eclipse.core.resources.IProject)21 Container (aQute.bnd.build.Container)19 IOException (java.io.IOException)17 ProjectLauncher (aQute.bnd.build.ProjectLauncher)15 Version (aQute.bnd.version.Version)12 Description (aQute.lib.getopt.Description)12 Jar (aQute.bnd.osgi.Jar)11 Builder (aQute.bnd.osgi.Builder)10 RepositoryPlugin (aQute.bnd.service.RepositoryPlugin)10 IJavaProject (org.eclipse.jdt.core.IJavaProject)9 Run (aQute.bnd.build.Run)8 BuildException (org.apache.tools.ant.BuildException)8 CoreException (org.eclipse.core.runtime.CoreException)8 IFile (org.eclipse.core.resources.IFile)7 ProjectBuilder (aQute.bnd.build.ProjectBuilder)6 ProjectTester (aQute.bnd.build.ProjectTester)5