Migrate project to Beast 2.7
- Require Beast 2.7+ and BeastFX 2.7+.
- Declared provided Beast2 "services" in
version.xml
. - Ran migration script on code, examples, Beauti templates, and tests.
- Updated Ant build script.
- Updated build instructions in ReadMe.
- Made test suite work with new Beast class loader.
- Tested on macOS, Linux (Ubuntu), and Windows.
The biggest pain point was to get the test suite to work again.
Beast 2.7 introduced a new class loader: a change that is poorly
documented. Some things work "magically" in IntelliJ, but then fail
miserably on the command line or with Ant. The error messages and
exception types are not very helpful, if not outright misleading.
The class loader's behavior also depends on whether add-on packages
are already "installed", i.e. exist in the BEAST/2.7
folder
inside the user's home directory.
That change is arguably beneficial for add-on packages and should make
package management more robust. But impacts the ease of development.
The key then is to realize that BeastFX needs to be made aware of all
the version.xml
files that are involved, including its own and that
of the Beast2 base. The command-line interface provides the new
-version_file
argument for that very purpose.
The new JavaFX requirement introduces some minor issues. As it's not
a pure Java library, but has native components, we cannot manage it
with Ivy (the Java library manager we currently use). Maven or Gradle
could handle it though. Instead, we rely on JavaFX to be pre-installed,
as recommended in the Beast2 documentation. This works out-of-the-box
on Ubuntu and Windows, but may require setting the JAVA_HOME
environment variable explicitly on macOS.