BRJS Developer Setup
Dominic Chambers edited this page Apr 2, 2014
·
16 revisions
This page walks through the setup for developing core BladeRunnerJS, not BladeRunnerJS plugins or libraries.
- Since we're going to be using Git we need it installed
- Windows: git-bash is probably the best thing to use or install using the Git installer for Windows
- Mac: install Git either via HomeBrew or using the Git installer for Mac
- Linux: Use the Git installer for Linux
- DIY: Or follow the Git install guide
- If you're using Windows we recommend you set auto line endings
- Run
git config --global core.autocrlf true
- Set your identity
git config --global user.name <Your Name>
git config --global user.email <Your Email>
- Make sure the email is the same as the one used for your GitHub account
BRJS is written and compiled using Java 8, but we distribute it and run the tests against it using Java 7, courtesy of retrolambda. Because of this, you will need to do the following:
- Install both Java 7 and Java 8 JDKs.
- Configure
JAVA7_HOME
to point to the Java 7 JDK home directory. - Configure
JAVA8_HOME
to point to the Java 8 JDK home directory. - Configure
JAVA_HOME
to point to either the Java 7 or the Java 8 JDK home directory, as you prefer. - Configure the
path
environment variable to include$JAVA_HOME/bin
.
- Clone the BRJS repo
git clone git@github.com:BladeRunnerJS/brjs.git
- See what branches we have available
git branch -a
- Set up the submodules
git submodule init
git submodule update
- Checkout the 'develop' branch
git checkout develop
You may need to run git submodule sync
and git submodule update
when changing branches if submodules have changed.
These steps walkthrough setting up Eclipse, if you're using a different IDE you're on your own :)
- Use the Gradle build to create the Eclipse project files
- In the 'brjs' directory:
./gradlew eclipse
- Start Eclipse
- Select
File -> Import -> General -> Existing projects into workspace
- Under
options
clickSearch for nested projects
(You'll need Eclipse Kepler to see this option) - Select the
brjs
folder as the root directory and select all of the folders - Click finish
- Eclipse should now be set up and all project dependencies configured
- You may need to re-run
./gradlew eclipse
from time to time and refresh all projects, particularly if dependencies change.
Alternatively, you can use EGit to import Git projects.
- Install EGit
- In the Import dialog, select
Git -> Projects from Git
- Select
Local
, then selectAdd
- Navigate to where you cloned brjs to and add that as a local Git repo
- After adding the repo, select it and click next
- Leave
Import existing projects
selected - In the next screen, all the projects should already be selected, if not make sure you check
Search for nested projects
- Click finish
- To run the build, run
./gradlew build
from the brjs directory. - To run 'build' or 'test' for a particular project, navigate to that directory and run
./gradlew test
or./gradlew build
. - To build the distributable, either run
./gradlew :cutlass-sdk:build
or navigate to the 'cutlass-sdk' directory and run../gradlew build
. - The zip is then built and placed in 'cutlass-sdk/build/distributions'
- The build is changing a lot at the moment, so this may change in the future
See the Troubleshooting Guide