2017-04-21 32 views

回答

0

默认情况下,proto生成到target/src_managed。要自定义添加到build.sbt:

// use another source directory for proto because its cleaned in every compile 
unmanagedSourceDirectories in Compile += baseDirectory.value/"com" 

    // ScalaPB configuration 
    PB.targets in Compile := { 
     Seq(
     scalapb.gen(
      singleLineToString = true 
     ) -> file(baseDirectory.value + "/src/main/com") 
    ) 
    } 
+0

我加unmanagedsourcedirectory,但干净的任务也将清除该目录 –

+0

https://github.com/thesamet/sbt-protoc –