Skip to content

Commit

Permalink
Merge pull request scala#12903 from makingthematrix/automatic_module_…
Browse files Browse the repository at this point in the history
…names_12899

Add Automatic-Module-Names to MANIFEST.MF files of projects with suffix_3
  • Loading branch information
smarter authored Jun 24, 2021
2 parents 239ad82 + 792cfd6 commit 359881d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,13 @@ object Build {
// If someone puts a source file at the root (e.g., for manual testing),
// don't pick it up as part of any project.
sourcesInBase := false,

// For compatibility with Java 9+ module system;
// without Automatic-Module-Name, the module name is derived from the jar file which is invalid because of the _3 suffix.
Compile / packageBin / packageOptions +=
Package.ManifestAttributes(
"Automatic-Module-Name" -> s"${dottyOrganization.replaceAll("-",".")}.${moduleName.value.replaceAll("-",".")}"
)
)

// Settings used for projects compiled only with Java
Expand Down

0 comments on commit 359881d

Please sign in to comment.