@@ -30,8 +30,11 @@ will look like this:
3030lazy val root = (project in file(" ." ))
3131 .enablePlugins(ProtofetchPlugin )
3232 .settings(
33- // Use protofetch output as a sbt-protoc source
33+ // Use protofetch output as a sbt-protoc source.
34+ // Remove this line if you use "target/protobuf_external_src" as proto_out_dir in your protofetch.toml
3435 Compile / PB .protoSources += protofetchOutputDirectory.value,
36+
37+ // Fetch proto files before running code generators
3538 Compile / PB .generate := (Compile / PB .generate).dependsOn(protofetchFetch).value,
3639
3740 // The rest of the sbt-protoc configuration
@@ -83,7 +86,6 @@ lazy val grpcDeps = (project in file("grpc-deps"))
8386 .enablePlugins(ProtofetchPlugin )
8487 .settings(
8588 protofetchModuleFile := baseDirectory.value / " .." / " protofetch.toml" ,
86- Compile / PB .protoSources += protofetchOutputDirectory.value,
8789 Compile / PB .targets := Seq (
8890 scalapb.gen(grpc = true ) -> (Compile / sourceManaged).value / " scalapb" ,
8991 scalapb.zio_grpc.ZioCodeGenerator -> (Compile / sourceManaged).value / " scalapb"
@@ -105,3 +107,4 @@ Note that this snippet is a drop-in replacement of what `sbt-protodep` does.
105107You don't necessarily need to have a dedicated ` grpcDeps ` sbt project,
106108these settings can as well be applied to some already existing project.
107109Also, you may not need all ` libraryDependencies ` that ` sbt-protodep ` used to add.
110+ ****
0 commit comments