-
Notifications
You must be signed in to change notification settings - Fork 27
Building and Running
In order to get started contributing to Tortoise, you'll need to get your system setup to do the building of the libraries (JVM and Javascript) and handle the running of tests. You'll need to install some tools, prep the repository, get GraalVM setup, and then you should be ready to hack away.
- Install Git, which is our source control client.
- Install SBT, which is our build and testing tool.
- Install Node and NPM, which is used by the the Tortoise engine project. Version 14 is required and 16 recommended.
-
Install GraalVM, which is the Java runtime and Javascript environment used by Tortoise. Community Edition should work fine.
- A good place to install it is alongside whatever other Java JDKs you may have installed.
- Example install location on macOS:
/Library/Java/JavaVirtualMachines/graalvm-ce-java17-22.2.0/
- You will need to run
gu install js
in thebin
folder of that install to install the JavaScript language package (it used to come bundled).
- Clone the repository:
git clone https://github.com/NetLogo/Tortoise.git
- Navigate into the root of the Tortoise repository directory,
cd Tortoise
. - Run
git submodule update --init
to make sure themodels
submodule is initialized.
Tortoise uses the GraalVM SDK in order to use the Graal Javascript compiler and runtime to test the Javascript code that Tortoise generates. To setup the GraalVM SDK to compile and test the Tortoise projects:
- Add a
GRAAL_HOME
environment variable for the path that you installed GraalVM to, with the/Contents/Home
subfolder appended.- Example
~/.bash_profile
entry on macOS:export GRAAL_HOME='/Library/Java/JavaVirtualMachines/graalvm-ce-java8-20.0.0/Contents/Home'
- Example
- In your terminal of choice, browse to the Tortoise repository folder and run
./sbt.sh
to start thesbt
build tool for Tortoise using the GraalVM specified by yourGRAAL_HOME
variable. - Launch SBT by running
./sbt.sh
.- Run
./sbt.sh
and notsbt
. The./sbt.sh
shell script handles some pathing and other issues that you probably don't want to deal with.
- Run
In the sbt.sh
console you started, try running compilerJVM/compile
or netLogoWeb/testOnly *TestReporters
to confirm everything is working.
If you are running GraalVM on macOS Catalina and may get an error such as " cannot be opened because the developer cannot be verified". You will need to run a command to remove the quarantine from your GraalVM directory: sudo xattr -r -d com.apple.quarantine $GRAAL_HOME
.
We try to keep Tortoise up-to-date with the GraalVM releases, but sometimes there are breaking changes that we haven't accommodated yet. If you have problems getting things working you may try downgrading to a version that was known to work. As of Occtober 2022, Tortoise has been updated to work with GraalVM version 22.2.0, Java 17 edition.
Read over the Tortoise Project Setup and the Architecture for necessary background information. Also, check out the Tortoise Tests you can run to validate your changes.