1

I am using the this scala protobuf plugin: https://scalapb.github.io/

I 'm having a problem where every time I run "sbt clean", the generated protobuf files are also cleaned.

Is there any way I can Configured the plugin so that scalapb's clean task is NOT part of the sbt clean task?(aka "sbt clean" will only clean the targets folder)

Thanks! Any help really appreciated!

Marlon Ou
  • 471
  • 1
  • 6
  • 19

1 Answers1

0

By default proto generated into target/src_managed. To customize add to 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")
      )
    }
Slavik Muz
  • 1,157
  • 1
  • 15
  • 28