Skip to content

Commit 359881d

Browse files
authored
Merge pull request #12903 from makingthematrix/automatic_module_names_12899
Add Automatic-Module-Names to MANIFEST.MF files of projects with suffix_3
2 parents 239ad82 + 792cfd6 commit 359881d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

project/Build.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,13 @@ object Build {
269269
// If someone puts a source file at the root (e.g., for manual testing),
270270
// don't pick it up as part of any project.
271271
sourcesInBase := false,
272+
273+
// For compatibility with Java 9+ module system;
274+
// without Automatic-Module-Name, the module name is derived from the jar file which is invalid because of the _3 suffix.
275+
Compile / packageBin / packageOptions +=
276+
Package.ManifestAttributes(
277+
"Automatic-Module-Name" -> s"${dottyOrganization.replaceAll("-",".")}.${moduleName.value.replaceAll("-",".")}"
278+
)
272279
)
273280

274281
// Settings used for projects compiled only with Java

0 commit comments

Comments
 (0)