Skip to content

Commit

Permalink
Merge pull request #514 from xuwei-k/issue-479-test
Browse files Browse the repository at this point in the history
reproduce code for issue 479
  • Loading branch information
eed3si9n authored Nov 20, 2023
2 parents 6630f06 + 69d6171 commit 64dedc8
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
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

0 comments on commit 64dedc8

Please sign in to comment.