fix(build): split path types in compile (#721)
BREAKING: Build paths now accept two different types
This commit is contained in:
@@ -381,24 +381,22 @@ impl Builder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Compile the .proto files and execute code generation.
|
/// Compile the .proto files and execute code generation.
|
||||||
pub fn compile<P>(self, protos: &[P], includes: &[P]) -> io::Result<()>
|
pub fn compile(
|
||||||
where
|
self,
|
||||||
P: AsRef<Path>,
|
protos: &[impl AsRef<Path>],
|
||||||
{
|
includes: &[impl AsRef<Path>],
|
||||||
|
) -> io::Result<()> {
|
||||||
self.compile_with_config(Config::new(), protos, includes)
|
self.compile_with_config(Config::new(), protos, includes)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Compile the .proto files and execute code generation using a
|
/// Compile the .proto files and execute code generation using a
|
||||||
/// custom `prost_build::Config`.
|
/// custom `prost_build::Config`.
|
||||||
pub fn compile_with_config<P>(
|
pub fn compile_with_config(
|
||||||
self,
|
self,
|
||||||
mut config: Config,
|
mut config: Config,
|
||||||
protos: &[P],
|
protos: &[impl AsRef<Path>],
|
||||||
includes: &[P],
|
includes: &[impl AsRef<Path>],
|
||||||
) -> io::Result<()>
|
) -> io::Result<()> {
|
||||||
where
|
|
||||||
P: AsRef<Path>,
|
|
||||||
{
|
|
||||||
let out_dir = if let Some(out_dir) = self.out_dir.as_ref() {
|
let out_dir = if let Some(out_dir) = self.out_dir.as_ref() {
|
||||||
out_dir.clone()
|
out_dir.clone()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user