diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2018-02-03 19:16:23 -0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-02-03 19:16:23 -0800 |
commit | ec39948ed1333699daf246e2ba37ccec67db5bd2 (patch) | |
tree | a9d46242337543bcf589c33a596e7edf91b64664 /scalalib/test/resources | |
parent | 6fa39162250c2477b3c9d322c453dfd51646245b (diff) | |
download | mill-ec39948ed1333699daf246e2ba37ccec67db5bd2.tar.gz mill-ec39948ed1333699daf246e2ba37ccec67db5bd2.tar.bz2 mill-ec39948ed1333699daf246e2ba37ccec67db5bd2.zip |
Make use of `CrossScalaModule` in `HelloWorldTests`
Also standardize the `HelloWorldTests` onto the typical project layout, where the module of interest is nested within a top-level `BaseModule`
Diffstat (limited to 'scalalib/test/resources')
-rw-r--r-- | scalalib/test/resources/hello-world/core/src-2.10/Shim.scala | 5 | ||||
-rw-r--r-- | scalalib/test/resources/hello-world/core/src-2.11/Shim.scala | 5 | ||||
-rw-r--r-- | scalalib/test/resources/hello-world/core/src-2.12/Shim.scala | 5 | ||||
-rw-r--r-- | scalalib/test/resources/hello-world/core/src/Main.scala | 18 | ||||
-rw-r--r-- | scalalib/test/resources/hello-world/core/src/Result.scala (renamed from scalalib/test/resources/hello-world/src/Result.scala) | 0 | ||||
-rw-r--r-- | scalalib/test/resources/hello-world/src/Main.scala | 12 |
6 files changed, 33 insertions, 12 deletions
diff --git a/scalalib/test/resources/hello-world/core/src-2.10/Shim.scala b/scalalib/test/resources/hello-world/core/src-2.10/Shim.scala new file mode 100644 index 00000000..025cff5c --- /dev/null +++ b/scalalib/test/resources/hello-world/core/src-2.10/Shim.scala @@ -0,0 +1,5 @@ +object Shim{ + def main(args: Array[String]): Unit = { + Main0(args(0), scala.util.Properties.versionNumberString + " rox") + } +}
\ No newline at end of file diff --git a/scalalib/test/resources/hello-world/core/src-2.11/Shim.scala b/scalalib/test/resources/hello-world/core/src-2.11/Shim.scala new file mode 100644 index 00000000..d98a6de1 --- /dev/null +++ b/scalalib/test/resources/hello-world/core/src-2.11/Shim.scala @@ -0,0 +1,5 @@ +object Shim{ + def main(args: Array[String]): Unit = { + Main0(args(0), scala.util.Properties.versionNumberString + " pwns") + } +}
\ No newline at end of file diff --git a/scalalib/test/resources/hello-world/core/src-2.12/Shim.scala b/scalalib/test/resources/hello-world/core/src-2.12/Shim.scala new file mode 100644 index 00000000..1f3e1c0f --- /dev/null +++ b/scalalib/test/resources/hello-world/core/src-2.12/Shim.scala @@ -0,0 +1,5 @@ +object Shim{ + def main(args: Array[String]): Unit = { + Main0(args(0), scala.util.Properties.versionNumberString + " leet") + } +}
\ No newline at end of file diff --git a/scalalib/test/resources/hello-world/core/src/Main.scala b/scalalib/test/resources/hello-world/core/src/Main.scala new file mode 100644 index 00000000..32706d44 --- /dev/null +++ b/scalalib/test/resources/hello-world/core/src/Main.scala @@ -0,0 +1,18 @@ +import scala.collection._ +import java.nio.file.{Files, Paths} + +import Main.{args, greeting} +object Main0{ + def apply(s: String, greeting: String) = { + val resultPath = Paths.get(s) + Files.createDirectories(resultPath.getParent) + Files.write(resultPath, greeting.getBytes) + } +} +object Main extends App { + + val person = Person.fromString("rockjam:25") + val greeting = s"hello ${person.name}, your age is: ${person.age}" + println(greeting) + Main0(args(0), greeting) +} diff --git a/scalalib/test/resources/hello-world/src/Result.scala b/scalalib/test/resources/hello-world/core/src/Result.scala index d7d29a51..d7d29a51 100644 --- a/scalalib/test/resources/hello-world/src/Result.scala +++ b/scalalib/test/resources/hello-world/core/src/Result.scala diff --git a/scalalib/test/resources/hello-world/src/Main.scala b/scalalib/test/resources/hello-world/src/Main.scala deleted file mode 100644 index 14139d6f..00000000 --- a/scalalib/test/resources/hello-world/src/Main.scala +++ /dev/null @@ -1,12 +0,0 @@ -import scala.collection._ // unused import to check unused imports warning -import java.nio.file.{Files, Paths} - -object Main extends App { - - val person = Person.fromString("rockjam:25") - val greeting = s"hello ${person.name}, your age is: ${person.age}" - println(greeting) - val resultPath = Paths.get(args(0)) - Files.createDirectories(resultPath.getParent) - Files.write(resultPath, greeting.getBytes) -} |