Feathr Scala Project Developer Guide
IntelliJ Setup
IntelliJ is the recommended IDE to use when developing Feathr. Please visit IntelliJ’s installation guide to install it in your local machine. To import Feathr as a new project:
- Git clone Feathr into your local machine. i.e. via https
git clone https://github.com/feathr-ai/feathr.git
or sshgit clone git@github.com:feathr-ai/feathr.git
- In IntelliJ, select
File
>New
>Project from Existing Sources...
and selectfeathr
from the directory you cloned. - Under
Import project from external model
selectgradle
. ClickNext
. - Under
Project JDK
specify a valid Java1.8
JDK. - Click
Finish
.
Setup Verification
After waiting for IntelliJ to index, verify your setup by running a test suite in IntelliJ.
- Search for and open a random test, i.e. here we will go with
AnchoredFeaturesIntegTest
as shown in the IntelliJ screenshot below. - Next to the class declaration, right click on the two green arrows and select
Run 'AnchoredFeaturesIntegTest'
. It could be any test case. - Verify if all test cases have passed.
Scala Coding Style Guide
Please checkout Databricks’ Scala Style Guide or the official Scala Style Guide.
Building and Testing
Feathr is compiled using Gradle.
To compile, run
./gradlew build
To compile with certain java version, run
./gradlew build -Dorg.gradle.java.home=/JDK_PATH
The jar files are compiled and placed in feathr/build/libs/feathr-X.X.X.jar
.
To execute tests, run
./gradlew test
To execute a single test suite, run
./gradlew test --tests com.linkedin.feathr.offline.AnchoredFeaturesIntegTest
Refer to Gradle docs for more commands.