Search in sources :

Example 6 with AccessRule

use of org.eclipse.tycho.classpath.ClasspathEntry.AccessRule in project tycho by eclipse.

the class DependencyComputer method addVisiblePackagesFromState.

private void addVisiblePackagesFromState(StateHelper helper, BundleDescription desc, Map<BundleDescription, ArrayList<AccessRule>> visiblePackages) {
    if (desc == null)
        return;
    ExportPackageDescription[] exports = helper.getVisiblePackages(desc, StateHelper.VISIBLE_INCLUDE_EE_PACKAGES);
    for (int i = 0; i < exports.length; i++) {
        BundleDescription exporter = exports[i].getExporter();
        if (exporter == null)
            continue;
        ArrayList<AccessRule> list = visiblePackages.get(exporter);
        if (list == null)
            list = new ArrayList<>();
        AccessRule rule = getRule(helper, desc, exports[i]);
        if (!list.contains(rule))
            list.add(rule);
        visiblePackages.put(exporter, list);
    }
}
Also used : BundleDescription(org.eclipse.osgi.service.resolver.BundleDescription) ExportPackageDescription(org.eclipse.osgi.service.resolver.ExportPackageDescription) ArrayList(java.util.ArrayList) DefaultAccessRule(org.eclipse.tycho.core.osgitools.DefaultClasspathEntry.DefaultAccessRule) AccessRule(org.eclipse.tycho.classpath.ClasspathEntry.AccessRule)

Aggregations

AccessRule (org.eclipse.tycho.classpath.ClasspathEntry.AccessRule)6 DefaultAccessRule (org.eclipse.tycho.core.osgitools.DefaultClasspathEntry.DefaultAccessRule)5 ArrayList (java.util.ArrayList)4 BundleDescription (org.eclipse.osgi.service.resolver.BundleDescription)3 File (java.io.File)2 ExportPackageDescription (org.eclipse.osgi.service.resolver.ExportPackageDescription)2 DependencyEntry (org.eclipse.tycho.core.osgitools.DependencyComputer.DependencyEntry)2 HashSet (java.util.HashSet)1 MavenProject (org.apache.maven.project.MavenProject)1 ExportPackageDescriptionImpl (org.eclipse.osgi.internal.resolver.ExportPackageDescriptionImpl)1 BaseDescription (org.eclipse.osgi.service.resolver.BaseDescription)1 State (org.eclipse.osgi.service.resolver.State)1 ArtifactDescriptor (org.eclipse.tycho.ArtifactDescriptor)1 ReactorProject (org.eclipse.tycho.ReactorProject)1 DependencyArtifacts (org.eclipse.tycho.artifacts.DependencyArtifacts)1 ClasspathEntry (org.eclipse.tycho.classpath.ClasspathEntry)1 Test (org.junit.Test)1