stevedlawrence commented on code in PR #1022:
URL: https://github.com/apache/daffodil/pull/1022#discussion_r1214423936


##########
build.sbt:
##########
@@ -327,7 +328,8 @@ lazy val usesMacros = Seq(
 
 lazy val libManagedSettings = Seq(
   genManaged := {
-    (Compile / genProps).value ++ (Compile / genSchemas).value
+    (Compile / managedSources).value
+    (Compile / managedResources).value

Review Comment:
   Yep, that's the idea. Line 22 declares the task with a name, description, 
and type. Line 330 defines the actual body of that task to run when it is 
triggered at the sbt prompt (or if some other task triggers it). In this case, 
the body of the `genManaged` task just evaluates the two `managedSources` and 
`managedResources` tasks that are already defined by sbt. And since we added 
the `genVersion` task to `managedResources`, evaluating `managedResources` will 
evaluate `genVersion` (along with our other source/resource generators).
   
   Note that we could in theory not even have `genManaged` and if someone 
wanted to generated all the managed stuff they could just do something like 
`sbt managedSources managedResources`, but one command is a bit more obvious.



##########
build.sbt:
##########
@@ -19,10 +19,11 @@ import scala.collection.immutable.ListSet
 
 import sbtcc._
 
-lazy val genManaged = taskKey[Seq[File]]("Generate managed sources and 
resources")
+lazy val genManaged = taskKey[Unit]("Generate managed sources and resources")
 lazy val genProps = taskKey[Seq[File]]("Generate properties scala source")
 lazy val genSchemas = taskKey[Seq[File]]("Generate DFDL schemas")
 lazy val genCExamples = taskKey[Seq[File]]("Generate C example files")
+lazy val genVersion = taskKey[Seq[File]]("Generate a VERSION file")

Review Comment:
   Agreed, will fix.



-- 
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]

Reply via email to