Skip to content

Commit

Permalink
Remove deprecated requireJREPackageImports
Browse files Browse the repository at this point in the history
  • Loading branch information
laeubi committed Feb 2, 2024
1 parent a444b09 commit 278e2cc
Showing 1 changed file with 2 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,21 +214,6 @@ public abstract class AbstractOsgiCompilerMojo extends AbstractCompilerMojo impl
@Parameter
private Set<String> excludeResources = new HashSet<>();

/**
* Whether a bundle is required to explicitly import non-java.* packages from the JDK. This is
* the design-time equivalent to the equinox runtime option
* <a href="https://wiki.eclipse.org/Equinox_Boot_Delegation#The_solution"
* >osgi.compatibility.bootdelegation</a>.
*
* @deprecated OSGI requires all packages to be imported and support for
* osgi.compatibility.bootdelegation will be removed in one of the next Tycho
* releases.
* @see #requireJavaPackageImports
*/
@Parameter()
@Deprecated
private Boolean requireJREPackageImports;

/**
* Since OSGi R7 it is
* <a href="https://blog.osgi.org/2018/02/osgi-r7-highlights-java-9-support.html">allowed to
Expand Down Expand Up @@ -819,28 +804,10 @@ private void configureCompilerLog(CompilerConfiguration compilerConfiguration) t
private void configureBootclasspathAccessRules(CompilerConfiguration compilerConfiguration,
Collection<ProjectClasspathEntry> classpathEntries) throws MojoExecutionException {
List<AccessRule> accessRules = new ArrayList<>();

if (requireJREPackageImports != null) {
logger.warn(
"Configuration option requireJREPackageImports is deprecated and will be removed in a future Tycho version!");
}
if (requireJREPackageImports == null || requireJREPackageImports) {
if (!requireJavaPackageImports) {
accessRules.add(new DefaultAccessRule("java/**", false));
}
accessRules.addAll(getStrictBootClasspathAccessRules());
} else {
if (!requireJavaPackageImports) {
accessRules.add(new DefaultAccessRule("java/**", false));
getTargetExecutionEnvironment().getSystemPackages().stream() //
.map(systemPackage -> systemPackage.packageName) //
.distinct() //
.map(packageName -> packageName.trim().replace('.', '/') + "/*") //
.map(accessRule -> new DefaultAccessRule(accessRule, false)) //
.forEach(accessRules::add);
// now add packages exported by framework extension bundles
accessRules
.addAll(getBundleProject().getBootClasspathExtraAccessRules(DefaultReactorProject.adapt(project)));
}
accessRules.addAll(getStrictBootClasspathAccessRules());
if (!accessRules.isEmpty()) {
List<ContainerAccessRule> globalRules = classpathEntries.stream()
.filter(JREClasspathEntry.class::isInstance).map(JREClasspathEntry.class::cast)
Expand Down

0 comments on commit 278e2cc

Please sign in to comment.