Skip to content

Commit

Permalink
Add comments on why we are not using srcGenerators with src_managed
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostbuster91 committed Jul 17, 2020
1 parent d956824 commit c879f91
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ lazy val petstoreApi: Project = project
.settings(
openApiInputSpec := s"${baseDirectory.value.getPath}/petstore.yaml",
openApiGeneratorName := "scala-sttp",
//We can't use src_managed because there is no option to tell openapi-generator to generate files into different folder than src
//see https://github.com/OpenAPITools/openapi-generator/issues/6685 for more details
openApiOutputDir := baseDirectory.value.name,
//Below setting is needed to configure generator not to generate other files besides src/main/scala
openApiIgnoreFileOverride := s"${baseDirectory.in(ThisBuild).value.getPath}/openapi-ignore-file",
Expand All @@ -17,7 +19,11 @@ lazy val petstoreApi: Project = project
"com.softwaremill.sttp.client" %% "json4s" % "2.2.0",
"org.json4s" %% "json4s-jackson" % "3.6.8"
),
//We can't use sourceGenerators because this requires all files to compile and openapi-generator generates
//some additional metadata files which breaks compilation.
//see https://github.com/OpenAPITools/openapi-generator/issues/6685 for more details
(compile in Compile) := ((compile in Compile) dependsOn openApiGenerate).value,
//As we don't generate files into src_managed we have to do cleaning by our own
cleanFiles += baseDirectory.value / "src"
)

Expand Down

0 comments on commit c879f91

Please sign in to comment.