Skip to content

How to try out development code

Michael Doube edited this page Mar 8, 2021 · 8 revisions

Users can contribute to BoneJ development by trying out raw, pre-release code. Maybe we're in a conversation about a feature you're interested in and you want to check that it's working the way you'd like. Or perhaps you've reported a bug and the developers would like your help to see whether their changes have fixed it for you.

The best way to try out a particular version is to find out where the changes are being committed (ask us!) and build your own copy using Git and Maven. The following instructions arose after a forum post about improving the colours in the particle analyser.

Once you have Git and Maven installed, type the following at the command line or in Git BASH if you're on Windows.

git clone https://github.com/bonej-org/BoneJ2.git

Gets you following the official release repository as a remote called origin, copied into a directory called pom-bonej. cd into it.

cd pom-bonej

If you need to get access to a particular developer's fork:

git remote add mdoube-bonej https://github.com/mdoube/BoneJ2.git

Creates a new 'remote', which tracks mdoube's personal fork of BoneJ2 (in case you are interested to try mdoube's new commits). Most of the time new things will be on feature branches of the main project, e.g. origin/some-new-feature, so adding remotes is an optional step.

git fetch mdoube-bonej

Refreshes your local copy of mdoube's fork with updated commit and branch information (i.e. whatever work he was just doing).

git checkout mdoube-bonej/particle-analyser

Loads all the up-to-date code on mdoube's particle-analyser branch, which is where he was committing work on these Particle Analyser features. Most features will be on branches of the origin repository, in which case substitute origin for mdoube-bonej in the commands above. If you want to follow another user or branch, just add that user's repository as a remote, then checkout the branch at the remote. Git takes a bit of getting used to and even regular users get themselves in a tangle from time to time. Don't worry if you do, just delete your local copy of the repository and start again.

./IJinstall_naughty.sh <path to your>/Fiji.app/

Installs BoneJ plugins to your Fiji, using whatever code you happen to have checked out with Git. Replace <path to your> with the directory path to Fiji on your system. If you checkout a few different things Maven might get a bit confused and leave stale copies of the build 'artifacts' around. The best way out of that situation is to delete all the bonej- jar files from Fiji.app/plugins and Fiji.app/jars, delete Maven's .m2 directory, then run the build script (./IJinstall_naughty.sh) again.

Restart Fiji and try the plugins. We've built this on Ubuntu, and it works elsewhere (Mac OS X, Windows).

git branch -a

Lists all the branches available for you to check out in case you want to try something else.

git checkout master

Gets you back to the release branch of your copy of bonej-org

git fetch; git rebase origin\master

Updates your branch with new commits from the remote.

There are tons of Git tutorials about. If you want to start contributing to BoneJ, you will need to make a fork on GitHub and clone that; that will be your 'origin'. You would then push your commits (code changes) to your fork, and send us a pull request by asking to merge your commits into bonej-org/master. We have a protocol for developing on BoneJ - please read and follow it before submitting your pull request.

Clone this wiki locally