olafurpg / setup-scala

GitHub Action to install any version of Java (GraalVM, Java 8, Java 11, Java 14, ...) via Jabba. Works for any JVM language including Java, Scala and Kotlin.
MIT License
168 stars 30 forks source link

scalac #52

Closed hanm2019 closed 2 years ago

hanm2019 commented 2 years ago

how can I use scalac command?

berndschatz commented 2 years ago

As far as i understand there is no scala installed, so the name is a little bit missleading !?

Run scala dependencyGraph.scala /runner/_work/_temp/3fa4cee6-2081-4ee9-94e4-5bcaf5e39696.sh: line 1: scala: command not found Error: Process completed with exit code 127.

2022-07-21-101346_647x309_scrot

I miss --> ,,Install scala''

laughedelic commented 2 years ago

I think this action doesn't intend to install Scala compiler. It's rarely needed on its own. You could use https://github.com/coursier/setup-action instead:

    - uses: coursier/setup-action@v1
      with:
        apps: scalac

If you want to run single-file scripts, consider using Ammonite (amm) or Scala CLI (scala-cli) instead of calling the compiler directly. You can also install them with cousier/setup-action.

berndschatz commented 2 years ago

On my local debian there exist already the command ,,scala'' with that i can execute any scala sources, e.g:

$ scala dependencyGraph.scala 
digraph WIKI { layout="fdp"; 
}

Debian does not contains Ammonite and/or scala-cli, but i will try it, thx for the hint.

olafurpg commented 2 years ago

Thank you for reporting! I recommend using coursier/setup-action to install scalac, as suggested by @laughedelic above https://github.com/olafurpg/setup-scala/issues/52#issuecomment-1191317277