Skip to content

Commit

Permalink
Some doc for dependencies between gradle modules (square#1894)
Browse files Browse the repository at this point in the history
  • Loading branch information
oldergod authored Feb 11, 2021
1 parent 8b4b747 commit 17d3e71
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions wire-library/docs/wire_compiler.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------
Expand Down

0 comments on commit 17d3e71

Please sign in to comment.