Skip to content

Commit

Permalink
Update example projects
Browse files Browse the repository at this point in the history
  • Loading branch information
guizmaii committed Jul 16, 2023
1 parent a177ab5 commit 2422fdb
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions plugin/src/sbt-test/sbt-native-image/agent-test/build.sbt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
lazy val example = project
.settings(
scalaVersion := "2.12.12",
mainClass.in(Compile) := Some("example.Hello6"),
scalaVersion := "2.12.18",
Compile / mainClass := Some("example.Hello6"),
nativeImageTestOptions ++= Seq(
s"-H:ReflectionConfigurationFiles=${target.value / "native-image-configs" / "reflect-config.json"}",
"--initialize-at-build-time=scala.collection.immutable.VM",
),
mainClass.in(Test) := Some("org.scalatest.tools.Runner"),
nativeImageTestRunOptions ++= Seq("-o", "-R", classDirectory.in(Test).value.absolutePath),
Test / mainClass := Some("org.scalatest.tools.Runner"),
nativeImageTestRunOptions ++= Seq("-o", "-R", (Test / classDirectory).value.absolutePath),
nativeImageCommand := List(
sys.env.getOrElse(
"NATIVE_IMAGE_COMMAND",
Expand Down
4 changes: 2 additions & 2 deletions plugin/src/sbt-test/sbt-native-image/agent/build.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
lazy val example = project
.settings(
scalaVersion := "2.12.12",
mainClass.in(Compile) := Some("example.Hello3"),
scalaVersion := "2.12.18",
Compile / mainClass := Some("example.Hello3"),
nativeImageOptions ++= Seq(
"--no-fallback",
s"-H:ReflectionConfigurationFiles=${ target.value / "native-image-configs" / "reflect-config.json" }"
Expand Down
8 changes: 4 additions & 4 deletions plugin/src/sbt-test/sbt-native-image/basic-test/build.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
lazy val example = project
.settings(
scalaVersion := "2.12.12",
mainClass.in(Compile) := Some("example.Hello4"),
scalaVersion := "2.12.18",
Compile / mainClass := Some("example.Hello4"),
nativeImageCommand := List(
sys.env.getOrElse(
"NATIVE_IMAGE_COMMAND",
Expand All @@ -13,8 +13,8 @@ lazy val example = project
nativeImageTestOptions ++= Seq(
"--initialize-at-build-time=scala.collection.immutable.VM"
),
mainClass.in(Test) := Some("org.scalatest.tools.Runner"),
nativeImageTestRunOptions ++= Seq("-o", "-R", classDirectory.in(Test).value.absolutePath),
Test / mainClass := Some("org.scalatest.tools.Runner"),
nativeImageTestRunOptions ++= Seq("-o", "-R", (Test / classDirectory).value.absolutePath),
libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.14" % "test"
)
.enablePlugins(NativeImagePlugin)
4 changes: 2 additions & 2 deletions plugin/src/sbt-test/sbt-native-image/basic/build.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
lazy val example = project
.settings(
scalaVersion := "2.12.12",
mainClass.in(Compile) := Some("example.Hello2"),
scalaVersion := "2.12.18",
Compile / mainClass := Some("example.Hello2"),
nativeImageCommand := List(
sys.env.getOrElse(
"NATIVE_IMAGE_COMMAND",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ lazy val example = project
crossScalaVersions := List(
"2.11.10",
"2.12.10",
"2.12.12",
"2.12.18",
"2.13.1",
"2.13.3"
),
mainClass.in(Compile) := Some("example.Hello5"),
Compile / mainClass := Some("example.Hello5"),
nativeImageTestOptions ++= Seq(
"--initialize-at-build-time=scala.collection.immutable.VM"
),
mainClass.in(Test) := Some("org.scalatest.tools.Runner"),
nativeImageTestRunOptions ++= Seq("-o", "-R", classDirectory.in(Test).value.absolutePath),
Test / mainClass := Some("org.scalatest.tools.Runner"),
nativeImageTestRunOptions ++= Seq("-o", "-R", (Test / classDirectory).value.absolutePath),
nativeImageCommand := List(
sys.env.getOrElse(
"NATIVE_IMAGE_COMMAND",
Expand Down
4 changes: 2 additions & 2 deletions plugin/src/sbt-test/sbt-native-image/cross-build/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ nativeImageOptions += "--no-fallback"
crossScalaVersions := List(
"2.11.10",
"2.12.10",
"2.12.12",
"2.12.18",
"2.13.1",
"2.13.3"
)
mainClass.in(Compile) := Some("Prog")
Compile / mainClass := Some("Prog")
TaskKey[Unit]("check") := {
val binary = nativeImage.value
val output = scala.sys.process.Process(List(binary.toString)).!!.trim
Expand Down

0 comments on commit 2422fdb

Please sign in to comment.