We'd love to accept your patches and contributions to this project. There are just a few small guidelines you need to follow.
Contributions to any Google project must be accompanied by a Contributor License Agreement. This is necessary because you own the copyright to your changes, even after your contribution becomes part of this project. So this agreement simply gives us permission to use and redistribute your contributions as part of the project. Head over to https://cla.developers.google.com/ to see your current agreements on file or to sign a new one.
You generally only need to submit a CLA once, so if you've already submitted one (even if it was for a different project), you probably don't need to do it again.
All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult GitHub Help for more information on using pull requests.
Dagger is built with bazel
.
- Install Bazel
- Build the Dagger project with
bazel build <target>
- Learn more about Bazel targets here.
- If you see an error similar to
ERROR: missing input file '@androidsdk//:build-tools/26.0.2/aapt'
, install the missing build tools version with the androidsdkmanager
tool.
- Run tests with
bazel test <target>
, orbazel test //...
to run all tests - You can install the Dagger libraries in your local maven repository by
running the
./util/install-local-snapshot.sh
script.- It will build the libraries and install them with a
LOCAL-SNAPSHOT
version.
- It will build the libraries and install them with a
- Visit
Preferences > Plugins
in the IDE menu.- Search for
bazel
and install the plugin. - If no result shows up, click on
Search in repositories
, search forbazel
and install the plugin.
- Search for
- Select
Import Bazel Project
. - Input the path to the Dagger project under
workspace
, clickNext
. - Select
Generate from BUILD file
, typeBUILD
in theBuild file
input, clickNext
. - [Android Studio only] In the
Project View
form, uncomment one of theandroid_sdk_platform
lines. Pick one that you have installed, then clickFinish
. - If you get an error on Bazel sync,
Cannot run program "bazel"
, then:- In the command line, run
where bazel
and copy the output (e.g./usr/local/bin/bazel
) - In Android Studio, go to
Preferences > Bazel Settings
and replaceBazel binary location
with what you just copied.
- In the command line, run
- Note that the first sync can take a long time. When build files are changed, you can run partial syncs (which should be faster) from the file menu.
- [Android Studio only] To view the Dagger project structure, open the
Project
view and switch the top selector fromAndroid
toProject
.