2017-04-21 63 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 –