You need to build your layer into a .jar file and then put that on Daffodil's classpath.

If you're use the Daffodil CLI, you can add jars to the CLI classpath by setting the DAFFODIL_CLASSPATH environment variable, for example:

  export DAFFODIL_CLASSPATH="/path/to/custom/checksum/layer.jar"
  daffodil parse -s schema.dfdl.xsd ...

If instead you're running TDML tests using SBT, a common technique is to publish the layer jar to a local repository, then add it as a dependency to the schema project that uses it. For example, you could do this to publish locally:

  cd /layer-project
  sbt publishLocal

And add this to your schema project build.sbt file:

  libraryDependencies ++= Seq(
    "org.example" % "layer-project" % "1.0.0"
  )

And then just run "sbt test" from the schema project. SBT will find the locally published layer and automatically add it to the classpath when running tests.



On 2024-10-25 12:51 PM, Mark Kozak wrote:
Hello folks,

I have a custom checksum calculator I need to run on an entity. I have been studying the ethernetIP example <https://github.com/DFDLSchemas/ethernetIP> and the layers documentation <https://daffodil.apache.org/layers>, but am unable to figure out where to place my scala implementation for it to be found. Is there some documentation I am missing?

Thanks as always for the support,

Mark

Mark Kozak

Director of Engineering

Adeptus Cyber Solutions

Adeptus-CS.com


Reply via email to