forked from square/wire
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some doc for dependencies between gradle modules (square#1894)
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -215,6 +215,46 @@ The source path and proto path are linked together but only types on the source | |
|
||
![Library](images/[email protected]) | ||
|
||
Dependencies between Gradle Modules | ||
----------------------------- | ||
|
||
Wire provides support to define dependencies between modules within the same project. | ||
|
||
A module can include its `.proto` files into the output resources. Use this when your `.jar` file | ||
can be used as a library for other proto or Wire projects. Note that only the `.proto` files used | ||
in the library will be included. | ||
|
||
```groovy | ||
wire { | ||
protoLibrary = true | ||
} | ||
``` | ||
|
||
Wire also creates two configurations, `protoPath` and `protoSource` you can use to define a | ||
dependency on another proto or Wire project. | ||
|
||
```groovy | ||
dependencies { | ||
// The task `:common-protos:jar` will be added into the dependency | ||
// graph of this module for the Wire generating tasks. | ||
protoPath(project(':common-protos')) | ||
implementation(project(':common-protos')) | ||
} | ||
wire { | ||
kotlin { | ||
} | ||
} | ||
``` | ||
|
||
Note that `protoPath` and `protoSource` dependencies are not transitive by default. If needed, you | ||
can change it manually. | ||
|
||
```groovy | ||
configurations.protoPath { | ||
transitive = true | ||
} | ||
``` | ||
|
||
Pruning | ||
------- | ||
|