Skip to content

Commit 64dedc8

Browse files
authored
Merge pull request #514 from xuwei-k/issue-479-test
reproduce code for issue 479
2 parents 6630f06 + 69d6171 commit 64dedc8

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
scalaVersion := "2.13.12"
2+
3+
assembly / assemblyShadeRules := Seq(
4+
ShadeRule.rename("example.A" -> "example.B").inProject
5+
)
6+
7+
TaskKey[Unit]("writeSealedJavaCodeIf17") := {
8+
if (scala.util.Properties.isJavaAtLeast("17")) {
9+
IO.write(
10+
file("A.java"),
11+
"""package example;
12+
13+
public sealed interface A {
14+
final class X implements A {}
15+
}
16+
"""
17+
)
18+
}
19+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
val pluginVersion = System.getProperty("plugin.version")
3+
if (pluginVersion == null)
4+
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
5+
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
6+
else addSbtPlugin("com.eed3si9n" % "sbt-assembly" % pluginVersion)
7+
}

src/sbt-test/shading/jdk17/test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
> writeSealedJavaCodeIf17
2+
> assembly

0 commit comments

Comments
 (0)