forked from softprops/assembly-sbt
-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #514 from xuwei-k/issue-479-test
reproduce code for issue 479
- Loading branch information
Showing
3 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 {} | ||
} | ||
""" | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
> writeSealedJavaCodeIf17 | ||
> assembly |