-
Notifications
You must be signed in to change notification settings - Fork 325
One click install for Scala #1130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
layout: blog-detail | ||
post-type: blog | ||
by: Sébastien Doeraene | ||
title: "One-click install for Scala" | ||
--- | ||
|
||
Installing Scala has always been a task more challenging than necessary, with the potential to drive away beginners. | ||
Should I install Scala itself? sbt? Some other build tools? What about a better REPL like Ammonite? Oh and before all that I need to install Java? | ||
|
||
To solve this problem, the Scala Center contracted Alexandre Archambault in January 2020 to add a one-click install of Scala through [coursier](https://get-coursier.io/docs/cli-overview). | ||
For example, on Linux, all we now need is: | ||
|
||
```bash | ||
$ curl -Lo cs https://git.io/coursier-cli-linux && chmod +x cs && ./cs setup | ||
``` | ||
|
||
which will install all the following software, if not yet installed: | ||
|
||
* a JDK | ||
* the build tools [sbt](https://www.scala-sbt.org/) and [mill](https://www.lihaoyi.com/mill/) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Regarding sbt, would this install the same launcher script and launcher JAR as what one would get using downloading the installer or using SDKMAN? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This installs a launcher for the coursier-based sbt launcher, based on this "app descriptor". You can generate one locally with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would be very misleading to call any alternative packaging of sbt as I'm more than happy to use Coursier for all three layers (launcher, plugins, proper build), but I think it should happen in conjunction with the official (preloaded) distribution. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here's an example in Bash script incompatibility (likely parsing of SBT_OPTS):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The output of If you used the custom sbt-extras script linked from the README, it should basically be the same handling as sbt-extras mainline. But it's not what's installed by the one-click install here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it came up on Gitter just now that somebody was using the coursier-based launcher and wasn't getting their There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, the user in question opened a ticket: coursier/sbt-launcher#167 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI,
It still doesn't read There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is great! Is there a reason There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that's because the name of the "app descriptor" changed from Just |
||
* the [Ammonite](https://ammonite.io/) enhanced REPL | ||
* [scalafmt](https://scalameta.org/scalafmt/), the Scala formatter | ||
* the [coursier](https://get-coursier.io/docs/cli-overview) CLI, to install further Scala-based applications | ||
* the `scala` and `scalac` command-line tools | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add some details about how we manage specific versions of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done as well. |
||
|
||
With all those installed, we are ready to go! | ||
Later, `cs update` can be used to update the installation. | ||
|
||
For power users, [the `cs setup` command](https://get-coursier.io/docs/cli-setup) offers more configuration options, such as a non-interactive mode. | ||
|
||
With this new simple, all-encompassing installer, we at the Scala Center hope to significantly reduce the burden of getting started with Scala. |
Uh oh!
There was an error while loading. Please reload this page.