@@ -22,24 +22,23 @@ object VerifyJDK9Classes {
22
22
lazy val settings : Seq [Setting [_]] = inConfig(Compile ) {
23
23
Seq {
24
24
sourceGenerators += {
25
- generateAndWriteScalaCLIScript(
26
- target,
27
- _ / " scala-cli" / " VerifyJDK9Classes.sc" )
25
+ generateAndWriteScalaCLIScript(target)
28
26
}
29
27
}
30
28
}
31
29
32
- def generateAndWriteScalaCLIScript (dir : SettingKey [File ], locate : File => File ): Def .Initialize [Task [Seq [sbt.File ]]] =
30
+ def generateAndWriteScalaCLIScript (dir : SettingKey [File ]): Def .Initialize [Task [Seq [sbt.File ]]] =
33
31
Def .task[Seq [File ]] {
34
- val script = generateScalaCLIScript(version.value)
35
- val file = locate(dir.value)
32
+ val binaryVersion = scalaBinaryVersion.value
33
+ val script = generateScalaCLIScript(version.value, binaryVersion)
34
+ val file = dir.value / " scala-cli" / s " VerifyJDK9Classes- ${binaryVersion}.sc "
36
35
val content = script.stripMargin.format(version.value)
37
36
if (! file.exists || IO .read(file) != content) IO .write(file, content)
38
37
// the generated file is not used.
39
38
Nil
40
39
}
41
40
42
- private def generateScalaCLIScript (version : String ): String =
41
+ private def generateScalaCLIScript (version : String , scalaBinaryVersion : String ): String =
43
42
s """
44
43
|/*
45
44
| * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -57,9 +56,8 @@ object VerifyJDK9Classes {
57
56
| * See the License for the specific language governing permissions and
58
57
| * limitations under the License.
59
58
| */
60
- |//> using scala 2.13
59
+ |//> using scala ${scalaBinaryVersion}
61
60
|//> using dep "org.apache.pekko::pekko-stream: ${version}"
62
- |////> using jvm 11
63
61
|object VerifyJDK9Classes {
64
62
| def main(args: Array[String]): Unit = {
65
63
| import org.apache.pekko.actor.ActorSystem
0 commit comments