Search in sources :

Example 1 with FileLine

use of aQute.bnd.osgi.Processor.FileLine 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)

Example 2 with FileLine

use of aQute.bnd.osgi.Processor.FileLine in project bnd by bndtools.

the class Macro method _warning.

public String _warning(String[] args) throws Exception {
    for (int i = 1; i < args.length; i++) {
        SetLocation warning = domain.warning("%s", process(args[i]));
        FileLine header = domain.getHeader(Pattern.compile(".*"), Pattern.compile("\\$\\{warning;"));
        if (header != null)
            header.set(warning);
    }
    return "";
}
Also used : SetLocation(aQute.service.reporter.Reporter.SetLocation) FileLine(aQute.bnd.osgi.Processor.FileLine)

Example 3 with FileLine

use of aQute.bnd.osgi.Processor.FileLine in project bnd by bndtools.

the class Macro method _error.

public String _error(String[] args) throws Exception {
    for (int i = 1; i < args.length; i++) {
        SetLocation error = domain.error("%s", process(args[i]));
        FileLine header = domain.getHeader(Pattern.compile(".*"), Pattern.compile("\\$\\{error;"));
        if (header != null)
            header.set(error);
    }
    return "";
}
Also used : SetLocation(aQute.service.reporter.Reporter.SetLocation) FileLine(aQute.bnd.osgi.Processor.FileLine)

Example 4 with FileLine

use of aQute.bnd.osgi.Processor.FileLine in project bnd by bndtools.

the class LocationTest method testMerged.

public void testMerged() throws Exception {
    Project project = ws.getProject("locationtest");
    FileLine fl = project.getHeader("-merged", "BAZ");
    assertNotNull(fl);
    assertEquals(project.getPropertiesFile().getAbsolutePath(), fl.file.getAbsolutePath());
    assertEquals(18, fl.line);
    assertEquals(167, fl.start);
    assertEquals(170, fl.end);
}
Also used : Project(aQute.bnd.build.Project) FileLine(aQute.bnd.osgi.Processor.FileLine)

Example 5 with FileLine

use of aQute.bnd.osgi.Processor.FileLine in project bnd by bndtools.

the class LocationTest method testProjectHeaderClauses.

public void testProjectHeaderClauses() throws Exception {
    Project project = ws.getProject("locationtest");
    assertNotNull(project);
    FileLine fl = project.getHeader("-inprojectsep", "BAZ");
    assertNotNull(fl);
    assertEquals(project.getPropertiesFile().getAbsolutePath(), fl.file.getAbsolutePath());
    assertEquals(10, fl.line);
    assertEquals(104, fl.start);
    assertEquals(107, fl.end);
    fl = project.getHeader("-inproject", "BAZ");
    assertNotNull(fl);
    assertEquals(project.getPropertiesFile().getAbsolutePath(), fl.file.getAbsolutePath());
    assertEquals(3, fl.line);
    assertEquals(23, fl.start);
    assertEquals(26, fl.end);
}
Also used : Project(aQute.bnd.build.Project) FileLine(aQute.bnd.osgi.Processor.FileLine)

Aggregations

FileLine (aQute.bnd.osgi.Processor.FileLine)6 Project (aQute.bnd.build.Project)4 SetLocation (aQute.service.reporter.Reporter.SetLocation)2 ProjectBuilder (aQute.bnd.build.ProjectBuilder)1 Workspace (aQute.bnd.build.Workspace)1 Builder (aQute.bnd.osgi.Builder)1 Processor (aQute.bnd.osgi.Processor)1 File (java.io.File)1 HashMap (java.util.HashMap)1 IProject (org.eclipse.core.resources.IProject)1 IResource (org.eclipse.core.resources.IResource)1