Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reproduce code for issue 479 #514

Merged
merged 2 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/sbt-test/shading/jdk17/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
scalaVersion := "2.13.12"

assembly / assemblyShadeRules := Seq(
ShadeRule.rename("example.A" -> "example.B").inProject
)

TaskKey[Unit]("writeSealedJavaCodeIf17") := {
if (scala.util.Properties.isJavaAtLeast("17")) {
IO.write(
file("A.java"),
"""package example;

public sealed interface A {
final class X implements A {}
}
"""
)
}
}
7 changes: 7 additions & 0 deletions src/sbt-test/shading/jdk17/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
val pluginVersion = System.getProperty("plugin.version")
if (pluginVersion == null)
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
else addSbtPlugin("com.eed3si9n" % "sbt-assembly" % pluginVersion)
}
2 changes: 2 additions & 0 deletions src/sbt-test/shading/jdk17/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
> writeSealedJavaCodeIf17
> assembly