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


##########
daffodil-lib/src/main/scala/org/apache/daffodil/lib/util/Misc.scala:
##########
@@ -250,12 +251,9 @@ object Misc {
    * Returns the primary version of daffodil from the jar
    */
   def getDaffodilVersion: String = {
-    val implVersion = this.getClass.getPackage.getImplementationVersion
-    if (implVersion == null) {
-      ""
-    } else {
-      implVersion
-    }
+    val uri = getRequiredResource("org/apache/daffodil/lib/VERSION")
+    val version = Source.fromInputStream(uri.toURL.openStream, 
"UTF-8").mkString
+    version

Review Comment:
   Yep. To be a little bit more exact, the new `genVersion` task writes the 
version to 
`daffodil-lib/resource_managed/main/org/apache/daffodil/lib/VERSION`, which sbt 
copies to `daffodil-lib/target/classes/org/apache/daffodil/lib/` before it 
generates the jar. 
   
   Both the `resource_managed` and `target` directories are in the .gitignore 
so the file is never committed, its just generated for every build.



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