use of org.eclipse.tycho.classpath.SourcepathEntry in project tycho by eclipse.
the class OsgiCompilerTest method test_embeddedNonClasspath.
public void test_embeddedNonClasspath() throws Exception {
File basedir = getBasedir("projects/embedednonclasspath");
List<MavenProject> projects = getSortedProjects(basedir, null);
MavenProject project = projects.get(0);
getMojo(projects, project).execute();
assertTrue(new File(project.getBasedir(), "target/classes/src/Src.class").canRead());
assertTrue(new File(project.getBasedir(), "target/library.jar-classes/src2/Src2.class").canRead());
List<SourcepathEntry> sourcepath = getMojo(projects, project).getSourcepath();
assertEquals(2, sourcepath.size());
}
use of org.eclipse.tycho.classpath.SourcepathEntry in project tycho by eclipse.
the class AbstractOsgiCompilerMojo method getSourcepath.
@Override
public List<SourcepathEntry> getSourcepath() throws MojoExecutionException {
ArrayList<SourcepathEntry> entries = new ArrayList<>();
for (BuildOutputJar jar : getEclipsePluginProject().getOutputJars()) {
final File outputDirectory = jar.getOutputDirectory();
for (final File sourcesRoot : jar.getSourceFolders()) {
SourcepathEntry entry = new SourcepathEntry() {
@Override
public File getSourcesRoot() {
return sourcesRoot;
}
@Override
public File getOutputDirectory() {
return outputDirectory;
}
@Override
public List<String> getIncludes() {
return null;
}
@Override
public List<String> getExcludes() {
return null;
}
};
entries.add(entry);
}
}
return entries;
}
use of org.eclipse.tycho.classpath.SourcepathEntry in project tycho by eclipse.
the class OsgiCompilerTest method test_multipleOutputJars_getSourcepath.
public void test_multipleOutputJars_getSourcepath() throws Exception {
File basedir = getBasedir("projects/multijar");
List<MavenProject> projects = getSortedProjects(basedir, null);
MavenProject project = projects.get(0);
List<SourcepathEntry> sourcepath = getMojo(projects, project).getSourcepath();
assertEquals(2, sourcepath.size());
assertSameFile(new File(project.getBasedir(), "target/classes"), sourcepath.get(0).getOutputDirectory());
assertSameFile(new File(project.getBasedir(), "src"), sourcepath.get(0).getSourcesRoot());
assertSameFile(new File(project.getBasedir(), "target/library.jar-classes"), sourcepath.get(1).getOutputDirectory());
assertSameFile(new File(project.getBasedir(), "src2"), sourcepath.get(1).getSourcesRoot());
}
use of org.eclipse.tycho.classpath.SourcepathEntry in project tycho by eclipse.
the class OsgiCompilerTest method test_multipleOutputJars.
public void test_multipleOutputJars() throws Exception {
File basedir = getBasedir("projects/multijar");
List<MavenProject> projects = getSortedProjects(basedir, null);
MavenProject project = projects.get(0);
getMojo(projects, project).execute();
assertTrue(new File(project.getBasedir(), "target/classes/src/Src.class").canRead());
assertTrue(new File(project.getBasedir(), "target/library.jar-classes/src2/Src2.class").canRead());
List<SourcepathEntry> sourcepath = getMojo(projects, project).getSourcepath();
assertEquals(2, sourcepath.size());
}
Aggregations