sbt / sbt-native-packager

sbt Native Packager
https://sbt-native-packager.readthedocs.io/en/stable/
BSD 2-Clause "Simplified" License
1.6k stars 439 forks source link

fix support for top-level `main` methods in Scala 3 #1592

Closed mberndt123 closed 5 months ago

mberndt123 commented 6 months ago

app_mainclass is currently not escaped correctly. This leads to problems in Scala 3 when you define main as a function at the top level (as opposed to inside an object. In this case, the main class generated by the Scala compiler will contain $ symbols that need to be escaped.

The LauncherJarPlugin abuses mainClass to set the -jar foo.jar parameter instead of a main class, so this case needs to be treated specially (I find this an ugly hack but haven't found a cleaner solution). The scripted-docker test failures seem to be unrelated to my changes as they also occur in other CI runs

lightbend-cla-validator commented 6 months ago

At least one commit author (matthias.berndt@ttmzero.com) is not linked to a user. See https://help.github.com/en/articles/why-are-my-commits-linked-to-the-wrong-user#commits-are-not-linked-to-any-user

lightbend-cla-validator commented 6 months ago

Hi @mberndt123,

Thank you for your contribution! We really value the time you've taken to put this together.

We see that you have signed the Lightbend Contributors License Agreement before, however, the CLA has changed since you last signed it. Please review the new CLA and sign it before we proceed with reviewing this pull request:

http://www.lightbend.com/contribute/cla

lightbend-cla-validator commented 6 months ago

At least one commit author (matthias.berndt@ttmzero.com) is not linked to a user. See https://help.github.com/en/articles/why-are-my-commits-linked-to-the-wrong-user#commits-are-not-linked-to-any-user

lightbend-cla-validator commented 6 months ago

At least one commit author (matthias.berndt@ttmzero.com) is not linked to a user. See https://help.github.com/en/articles/why-are-my-commits-linked-to-the-wrong-user#commits-are-not-linked-to-any-user

lightbend-cla-validator commented 5 months ago

At least one commit author (matthias.berndt@ttmzero.com) is not linked to a user. See https://help.github.com/en/articles/why-are-my-commits-linked-to-the-wrong-user#commits-are-not-linked-to-any-user

lightbend-cla-validator commented 5 months ago

At least one commit author (matthias.berndt@ttmzero.com) is not linked to a user. See https://help.github.com/en/articles/why-are-my-commits-linked-to-the-wrong-user#commits-are-not-linked-to-any-user

mberndt123 commented 5 months ago

LGTM

Thanks @dwickern, is there anything else I need to do to get this merged?