stevedlawrence commented on code in PR #1022:
URL: https://github.com/apache/daffodil/pull/1022#discussion_r1218019165
##########
build.sbt:
##########
@@ -373,8 +375,23 @@ lazy val libManagedSettings = Seq(
}
cachedFun(filesToWatch).toSeq
},
- Compile / sourceGenerators += (Compile / genProps).taskValue,
- Compile / resourceGenerators += (Compile / genSchemas).taskValue,
+ Compile / genVersion := {
+ val resourceDir = (Compile / resourceManaged).value
+ val outFile = resourceDir / "org" / "apache" / "daffodil" / "lib" /
"VERSION"
+ if (!outFile.exists || IO.read(outFile) != version.value) {
Review Comment:
After a little testing and a little digging in the sbt code (I can't find
much documentation about this), it looks like sbt uses hashes for things in
`src/main/scala/` and uses last modification time for `src/main/resources`. I
guess he concern is resources could be very large and could slow things down? I
think it also uses last modification time for both managed sources and
resources. And since this is a managed resource it uses last modification time.
I do think it's configurable, but I'd rather not change it--the more
settings we tweak in sbt the more complicated it gets, and it's already too
complicated. And for sbt source/resourceGenerators it's common practice to do
something like this so we only generate files when needed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]