Search in sources :

Example 6 with BuildOutputJar

use of org.eclipse.tycho.core.osgitools.project.BuildOutputJar in project tycho by eclipse.

the class OsgiBundleProject method addPDESourceRoots.

private void addPDESourceRoots(MavenProject project) {
    EclipsePluginProjectImpl eclipsePluginProject = getEclipsePluginProject(DefaultReactorProject.adapt(project));
    for (BuildOutputJar outputJar : eclipsePluginProject.getOutputJars()) {
        for (File sourceFolder : outputJar.getSourceFolders()) {
            removeDuplicateTestCompileRoot(sourceFolder, project.getTestCompileSourceRoots());
            project.addCompileSourceRoot(sourceFolder.getAbsolutePath());
        }
    }
}
Also used : EclipsePluginProjectImpl(org.eclipse.tycho.core.osgitools.project.EclipsePluginProjectImpl) BuildOutputJar(org.eclipse.tycho.core.osgitools.project.BuildOutputJar) File(java.io.File)

Example 7 with BuildOutputJar

use of org.eclipse.tycho.core.osgitools.project.BuildOutputJar 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;
}
Also used : SourcepathEntry(org.eclipse.tycho.classpath.SourcepathEntry) BuildOutputJar(org.eclipse.tycho.core.osgitools.project.BuildOutputJar) ArrayList(java.util.ArrayList) File(java.io.File)

Example 8 with BuildOutputJar

use of org.eclipse.tycho.core.osgitools.project.BuildOutputJar in project tycho by eclipse.

the class AbstractOsgiCompilerMojo method execute.

@Override
public void execute() throws MojoExecutionException, MojoFailureException {
    StandardExecutionEnvironment[] manifestBREEs = bundleReader.loadManifest(project.getBasedir()).getExecutionEnvironments();
    getLog().debug("Manifest BREEs: " + Arrays.toString(manifestBREEs));
    getLog().debug("Effective EE: " + getTargetExecutionEnvironment());
    String effectiveTargetLevel = getTargetLevel();
    getLog().debug("Effective source/target: " + getSourceLevel() + "/" + effectiveTargetLevel);
    checkTargetLevelCompatibleWithManifestBREEs(effectiveTargetLevel, manifestBREEs);
    for (BuildOutputJar jar : getEclipsePluginProject().getOutputJars()) {
        this.outputJar = jar;
        this.outputJar.getOutputDirectory().mkdirs();
        super.execute();
        doCopyResources();
    }
    // this does not include classes from nested jars
    BuildOutputJar dotOutputJar = getEclipsePluginProject().getDotOutputJar();
    if (dotOutputJar != null) {
        project.getArtifact().setFile(dotOutputJar.getOutputDirectory());
    }
}
Also used : StandardExecutionEnvironment(org.eclipse.tycho.core.ee.StandardExecutionEnvironment) BuildOutputJar(org.eclipse.tycho.core.osgitools.project.BuildOutputJar)

Aggregations

BuildOutputJar (org.eclipse.tycho.core.osgitools.project.BuildOutputJar)8 File (java.io.File)6 ArrayList (java.util.ArrayList)4 EclipsePluginProject (org.eclipse.tycho.core.osgitools.project.EclipsePluginProject)3 LinkedHashSet (java.util.LinkedHashSet)2 IOException (java.io.IOException)1 Matcher (java.util.regex.Matcher)1 Pattern (java.util.regex.Pattern)1 MavenArchiver (org.apache.maven.archiver.MavenArchiver)1 DependencyResolutionRequiredException (org.apache.maven.artifact.DependencyResolutionRequiredException)1 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)1 ArchiverException (org.codehaus.plexus.archiver.ArchiverException)1 ManifestException (org.codehaus.plexus.archiver.jar.ManifestException)1 DefaultFileSet (org.codehaus.plexus.archiver.util.DefaultFileSet)1 ArtifactDescriptor (org.eclipse.tycho.ArtifactDescriptor)1 ArtifactKey (org.eclipse.tycho.ArtifactKey)1 ReactorProject (org.eclipse.tycho.ReactorProject)1 SourcepathEntry (org.eclipse.tycho.classpath.SourcepathEntry)1 StandardExecutionEnvironment (org.eclipse.tycho.core.ee.StandardExecutionEnvironment)1 DefaultReactorProject (org.eclipse.tycho.core.osgitools.DefaultReactorProject)1