Skip to content

Commit

Permalink
Merge pull request #138 from danielleontiev/publish-generated-sources
Browse files Browse the repository at this point in the history
[feat] add sources generated by codegen plugin to sources.jar
  • Loading branch information
vigoo committed Apr 11, 2024
2 parents 7200bac + c293101 commit 760e166
Showing 1 changed file with 9 additions and 1 deletion.
Expand Up @@ -98,6 +98,14 @@ object ZioOpenAICodegenPlugin extends AutoPlugin {

override def projectSettings: Seq[Def.Setting[?]] =
Seq(
Compile / sourceGenerators += generateSources.taskValue
Compile / sourceGenerators += generateSources.taskValue,
// adds generated files to the sources jar. See sbt/sbt#2205
Compile / packageSrc / mappings ++= {
val base = (Compile / sourceManaged).value
val files = (Compile / managedSources).value
files
.map(f => (f, f.relativeTo(base)))
.collect { case (f, Some(relF)) => f -> relF.getPath() }
}
)
}

0 comments on commit 760e166

Please sign in to comment.