Before contributing to the Record Layer, please see the contribution guide.
-
Fork and clone the repository.
-
Run
./gradlew package
on the root directory of the local clone.
-
(Skip if you are not interested in running the tests.)
Install FDB on your development machine. The latest FDB binaries can be found on the GitHub. -
Install and launch IntelliJ IDEA. This document is based on Version 2020.2.3.
-
In the "Welcome to IntelliJ IDEA" window, click "Open or import" and open the project's root directory. (If you do not see the welcome window, File > Open can do the same.)
-
In the Gradle tool window (expand by clicking the Gradle button on right top), click on the toolbar.
-
Build > Build Project.
-
Preferences > Editor > General > Auto Import > Optimize imports on the fly (for current project)
-
(This is optional, but useful.)
Preferences > Build, Execution, and Deployment > Build Tools > Maven > Importing > Automatically download > Sources
Now you have configured IntelliJ successfully!
(Skip if you are not interested in running the tests.)
To verify that you have a working configuration, pick some tests that depend on FDB (such as those in the FDBRecordStoreQueryTest
fixture), and check you can run them from IntelliJ.
If this does not work smoothly for you, please create a new issue or ask in the forum.
(This section explains what happened above and why, in case you are interested.)
The ./gradlew package
command (Step 2) generates the protobuf files.
The Record Layer project does not use the Gradle IDEA plugin, unlike many similar projects. Instead, it uses IntelliJ IDEA's builtin Gradle support to compile the project and run the tests; the repository will run a "sync" with the Gradle configuration when you load Gradle project (Step 6).
If you make changes to most IntelliJ settings, they will save over the files that are checked into Git. These changes can be shared by committing the updated files.
However, there are a few settings that we use for consistency that are saved in the user-specific workspace.xml
file. These settings must be enabled manually by each developer. (Step 8, 9)
To do the full suite of checks and tests run:
./gradlew -PspotbugsEnableHtmlReport check test
If you enable the local repo in whatever uses the Record Layer, the following will make it available. The published jars will be in the directory ~/.m2/repository/org/foundationdb/fdb-record-layer-core/n.n-SNAPSHOT/
.
./gradlew publishToMavenLocal -PpublishBuild=true
If a file fdb-environment.properties
exists in the root of the working directory, it contains environment variables that specify where to find
the local FDB. These settings will apply when running inside IntelliJ as well as from a command line and so are easier to manage than a shell script.
-
FDB_CLUSTER_FILE
: the cluster file -
DYLD_LIBRARY_PATH
(orLD_LIBRARY_PATH
): thelibfdb_c.dylib
(or.so
) C API library