summaryrefslogtreecommitdiff
path: root/scalalib/test/resources/hello-world/core/src/Main.scala
blob: d86f4da873237becadba4c0de719b962ec19759b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import scala.collection._
import java.nio.file.{Files, Paths}
import java.sql.Date
import java.time.LocalDate
import javax.swing.JButton

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 {
  // testing correct loading of java standard modules in java 9
  // https://github.com/lihaoyi/mill/issues/251
  new JButton("hello from javax")
  val now = Date.valueOf(LocalDate.now())
  println(s"Today is the date: ${now}")
  val person = Person.fromString("rockjam:25")
  val greeting = s"hello ${person.name}, your age is: ${person.age}"
  println(greeting)
  Main0(args(0), greeting)
}