I have the following dummy project structure:
|───employee-uService
| ├───backend
| | ├───employee-api
| | ├───project
| | ├───src
| | │ └───main
| | │ ├───protobuf
| | │ └───scala
| | ├───build.sbt
| ├───build.sbt
|───build.sbt (root project build)
The build.sbt in the employee-api contains project definition with the .settings(scalapbSettings("."))
setting.
The scalapbSettings
function sets up the proto source folder like:
val protoSources = PB.protoSources in Compile := Seq(file(s"$projectFolder/src/main/protobuf"))
Where the projectFolder is a parameter of the function.
The build.sbt one level higher in the hierarchy (employee-uService) defines employee-api and the respective impl project and aggregates them, while the root build aggregates the ...-uService projects.
Depending on the project I'm compiling, the given string parameter for the scalapbSettings
function has to change to represent the proper path. (e.g.: in the root it has to be employee-uService/backend/employee-api
while when running the api compile, it's .
.
How could I pass a value to the function call that could be overwritten in the different build.sbt files?