File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed
src/sbt-test/shading/jdk17 Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 1+ > writeSealedJavaCodeIf17
2+ > assembly
You can’t perform that action at this time.
0 commit comments