Skip to content

bloop-frontend v1.0.0-M10

Pre-release
Pre-release
Compare
Choose a tag to compare
@jvican jvican released this 16 May 08:13
· 4190 commits to main since this release
37311cd

Install the latest release 🍬

If you're on Mac OS X, upgrade to the latest version with:

$ brew install scalacenter/bloop/bloop

Otherwise, run:

$ curl -L https://github.com/scalacenter/bloop/releases/download/v1.0.0-M10/install.py | python

Read the complete instructions in our Installation page.

Highlights 📚

Build Server Protocol

This is an special section updating on the latest developments of
BSP (Build Server Protocol), an
initiative led by @jvican and others at the Scala Center to bring better build
tool support to all the IDEs and editors.

Over the past weeks, we have been working with [Justin Kaeser][jastice], from the
IntelliJ team, on a proof-of-concept BSP integration between IntelliJ and
Bloop, with the goal of supporting other future clients like sbt and Bazel,
among others.

We updated the Scala community on these efforts in our Scalasphere 2018
talk
titled "Build Server Protocols and new IDEAs"
which will be available online soon. At the talk, we gave a demo of Bloop
integrating with IntelliJ over the protocol and providing fast "import
project" capabilities (usually in the order of milliseconds for small to
medium projects, and < 10 seconds for big projects). These capabilities
replace the slow "sbt import" features of the Scala plugin.

We plan on developing this prototype further over the next weeks and getting
it ready to a state in which can be used by the whole Scala community. To do
so, this release includes an almost full implementation of the BSP protocol
(note that it will still go through some changes in the next weeks):

Installation improvements 🔧

Integration with systemd (by @tues)

Systemd is a Linux/BSD system manager that allows users to configure the
lifetime of services. As systemd is a perfect way to run your Bloop server on
the background only once, @tues has added support
for it, together with excellent documentation available in our
website
.

Sneak peek:

$ systemctl --user status bloop
$ systemctl --user start bloop
$ systemctl --user stop bloop

Integration with desktop entries (by @tues)

Desktop entries are another common mechanism to control the execution of services.
Bloop now integrates with it so that users that don't have systemd installed in their
system have an alternative way of managing the bloop server.

Complete instructions to set them up are available in the desktop entry
section of our
website

Use python3 in homebrew formula (by @Duhemm)

While our installation scripts are python 2 and python 3 compatible, some
homebrew installations don't seem to like that bloop is executed by running
python 2. This change makes Python 3 the default runtime to execute our
installation scripts in OSX.

Upgrade soc/directories-jvm to match Coursier's version (by @jvican)

Bloop is run via coursier launch, and that's why our installation script
installs coursier in a script called blp-coursier under (typically) the
$HOME/.bloop directory.

However, there have been some proguard misbehaviours with the latest coursier
releases, where its dependencies were leaking. One of these dependencies is
soc/directories-jvm, which we also depended on. This commit fixes an binary
incompatibility between the version that Coursier used and the one that Bloop
uses.

Features 🏗️

Support Dotty projects (by @jvican and @Duhemm)

Bloop now supports Dotty projects. If you
have an sbt-configured Dotty project and you export it with Bloop, Bloop will
be able to compile, test and run your project.

Support connectInput for run applications (by @jvican)

connectInput is an sbt setting that allows forked applications to reuse the
standard input of the process that launched them. Bloop now supports this
setting by default and any text (ending with new lines) that you enter in your
shell will be received by the application. This translated to
java.util.Scanner.nextLine() working perfectly.

Note that whatever goes into standard input will need to end in a new line to
be sent to the process running on the background. This is a limitation imposed
by Nailgun.

Make run and test cancelable (by @jvican)

Run and test are now cancelable via CTRL-C. When one of these tasks is cancelled,
Bloop gracefully handles the shutdown of the processes.

Add more efficient process implementation via NuProcess (by @jvican)

NuProcess is a great library to manage system processes in an efficient way.
The latest version of Bloop uses it under the hood, which means that the
execution of many system process will be as efficient as it can be.

Support test options via the CLI (by @jvican)

Test options can now be passed from the CLI if and only if one test framework
is detected. This happens when your build only supports one test framework or
when you are running a concrete filtered test that uses a single test
framework.

For example, bloop test frontend -o bloop.tasks.RunTasksSpec -- -z "*CancelNeverEnding*"
runs the RunTaskSpec JUnit test and passes in the test options (note the --) to the
JUnit test framework. In this case, the test options tell the test runner to only
run the methods that match the regex *CancelNeverEnding*.

Bloop cannot support test options for several frameworks because they are framework dependent.

Allow sources to contain both source directories and files (by @jvican)

The field sources in our configuration file only supported source directories.
However, there are some build tools —like Bazel— that do not know what source
directories are mapped to a target, they only know the source files.

In the spirit of being build-tool-agnostic, Bloop now supports both source
files and source directories. Note that if a new source file is added outside
of an existing source directory
, you will need to add it to the json file manually or
export your build tool again.

Persist analysis files on the background (by @jvican)

One of the benefits of being a server is that Bloop doesn't need to write the analysis
files generated by the incremental compiler to disk in every compilation. Therefore,
Bloop keeps them in memory.

However, if the server is killed, these analysis files are gone. This improvement
makes Bloop capable of writing the analysis file in parallel on the
background when the user has exit the session. By doing this, we keep
compilation fast because we don't need to wait until the server has written
all the analysis files (which can be in the order of ~500MB in big projects).

Bugfixes 🐛

Make console work again by enabling -Xnojline (by @tues)

Bloop uses nailgun under the hood, and therefore all activity in the input
stream needs to go through it. jline doesn't like this whole level of
indirection, and therefore for console to work we need to pass in -Xnojline
as a Scala console option.

For an excellent analysis of what is going on, check the original bug
report
.

Usability improvements

Speed up the project load (by @jvican)

The first time you do bloop about or bloop projects in a folder, Bloop loads up
the build. This process may take time because the analysis files need to be read from
disk for every module that is defined.

The new v1.0.0-M9 release is significantly faster doing so because the project load
happens in parallel. This reduces the time Bloop takes to load the project from 2s for
the bloop build to 450ms. Bigger projects will see even bigger load speedups.

Autocomplete to bloop server when server is not started (by @propensive)

When the server is not started, autocompletions don't work. This change
will detect this scenario and only propose the server completion.

Add file watching logs on every iteration (by @rberenguel)

Bloop will now show the logs Waiting for source changes... (press C-c to interrupt) in every file watching iteration. This highlights the fact that
the action has already been completed and Bloop is waiting for file changes.

Display multi-word flag autocompletions with kebab style (by @rberenguel)

Command flags may have more than one word (for example, --config-dir).
This fix hides the implementation detail of Bloop and shows the autocompletion
as it is expected, instead of showing the source name (--configDir).

Make autocompletions context-dependent (by @rberenguel)

Our previous autocompletion engine was assuming that all our commands
take projects as arguments, but not of them do. Those that don't were
not being autocompleted with the flags that they take. In this new
release, completions work for commands like bloop configure.

Community build

Add akka to our community build (by @jvican)

We welcome akka/akka to our community build.
Given the impact of this project in our ecosystem, and how complex the build
is, we consider it a success that bloop now fully supports the compilation of
the project.

Integration improvements: sbt

Detect compile->test and test->compile configurations (by @jvican)

Builds in sbt can define dependencies across configurations, but these were
poorly handled by bloop v1.0.0-M9 and previous versions. The new version
makes a best effort to detect these dependencies across compile and test
configurations.

Avoid sbt plugin naming conflict (by @laughedelic)

Because of some sbt pecularities, the sbt bloop plugin can have naming
conflicts with other global or local sbt plugins installed in a given build.
This commit fixes an incompatibility with the
sbt-metals plugin which defined a
Compat trait that was being picked up instead of the one that Bloop
defines.

Contributors 👥

According to git shortlog -sn --no-merges v1.0.0-M9..1.0.0-M10, 7 people
contributed to this release: Jorge Vicente Cantero, Rubén Berenguel Montoro,
Paweł Bartkiewicz, Alexey Alekhin, Jon Pretty and Justin Kaeser.

The Bloop team at the Scala Center is also proud of welcoming Paweł and Ruben
to our team! Their contributions have been great to make this release happen.
Thank you all ✨!