Skip to content

Commit 768b87f

Browse files
committed
[GR-66318] Allow opening packages that have resources but no Java classes.
PullRequest: mx/1942
2 parents 1fbaca2 + 448a617 commit 768b87f

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"Jsonnet files should not include this file directly but use ci/common.jsonnet instead."
55
],
66

7-
"mx_version": "7.58.1",
7+
"mx_version": "7.58.6",
88

99
"COMMENT.jdks": "When adding or removing JDKs keep in sync with JDKs in ci/common.jsonnet",
1010
"jdks": {

src/mx/_impl/mx_javamodules.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,10 @@ def _parse_packages_spec(packages_spec, available_packages, project_scope, direc
673673
mx.abort(f'The package specifier "<package-info>" cannot be used for the "opens" attribute', context=dist)
674674
res.update(mx._find_packages(project_scope, onlyPublic=True))
675675
else:
676-
if spec not in module_packages:
676+
if directive == 'export' and spec not in module_packages:
677+
# For the 'open' directive, we do not check whether the package spec names an
678+
# existing Java package, since it is legitimate to open a package with no
679+
# Java classes to provide access to resource files.
677680
mx.abort(f'Cannot {directive} package {spec} from {moduleName} as it is not defined by any project in the module {moduleName}', context=dist)
678681
if project_scope and spec not in available_packages and project_scope.suite.requiredMxVersion >= mx.VersionSpec("5.226.1"):
679682
mx.abort(f'Package {spec} in "{directive}s" attribute not defined by project {project_scope}', context=project_scope)

src/mx/mx_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# The version must be updated for every PR (checked in CI) and the comment should reflect the PR's issue
2-
version = "7.58.6" # GR-64688 Always apply command mapper hooks (trackers) for the image stages
2+
version = "7.58.7" # GR-66318: allow opening a package without any Java classes in it

0 commit comments

Comments
 (0)