This is an automated email from the ASF dual-hosted git repository.

slawrence pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/daffodil-sbt.git


The following commit(s) were added to refs/heads/main by this push:
     new 1b907ac  Add packageDaffodilBin to use config files
1b907ac is described below

commit 1b907ac4a9ca7727454715bfa04f87fcf6b83ceb
Author: Steve Lawrence <[email protected]>
AuthorDate: Mon Jul 8 15:45:06 2024 -0400

    Add packageDaffodilBin to use config files
    
    The daffodilPackageBinInfos setting is changed from a tuple to a new
    DaffodilBinInfo class that is specific to Daffodil. This makes it easier
    to allow for optional fields or extend in the future. For backwards
    compatibilty, an implicit def is added to automatically convert existing
    3-tuples to the new type.
    
    A new optional field is added to DaffodilBinInfo to specify a config
    file which is used during compilation of saved parsers. This currently
    only supports tunables since config files can only contain tunables and
    variable bindings, and variable bindings are excluded when saving a
    parser.
    
    Closes #6
---
 README.md                                          | 22 +++++---
 .../scala/org/apache/daffodil/DaffodilPlugin.scala | 61 +++++++++++++++-------
 .../scala/org/apache/daffodil/DaffodilSaver.scala  | 22 ++++++--
 .../sbt-daffodil/saved-parsers-01/build.sbt        |  4 +-
 .../build.sbt                                      |  1 +
 .../saved-parsers-02/project/plugins.sbt           | 20 +++++++
 .../src/main/resources/test.dfdl.xsd               | 39 ++++++++++++++
 .../sbt-daffodil/saved-parsers-02/test.script      | 31 +++++++++++
 .../build.sbt                                      |  6 +--
 .../saved-parsers-03/project/plugins.sbt           | 20 +++++++
 .../saved-parsers-03/src/main/resources/test.cfg   | 28 ++++++++++
 .../src/main/resources/test.dfdl.xsd               | 39 ++++++++++++++
 .../sbt-daffodil/saved-parsers-03/test.script      | 23 ++++++++
 .../sbt-daffodil/tdml-saved-parser-01/build.sbt    |  4 +-
 src/sbt-test/sbt-daffodil/versions-01/build.sbt    |  2 +-
 15 files changed, 283 insertions(+), 39 deletions(-)

diff --git a/README.md b/README.md
index 88061c4..5e28866 100644
--- a/README.md
+++ b/README.md
@@ -59,17 +59,23 @@ compatible Scala version] if required.
 This plugin adds the ability to create and publish saved parsers of a schema.
 
 For each saved parser to generate, add an entry to the
-`daffodilPackageBinInfos` setting. This setting is a Seq of 3-tuples made up of
-the resource path to the schema, an optional root element to use in that
-schema, and an optional name that is added to the artifact classifier to
-differentiate multiple saved parsers. If the optional root element is `None`,
-then the first element in the schemas is used. An example of this settings
-supporting two roots looks like this:
+`daffodilPackageBinInfos` setting. This setting is a `Seq[DaffodilBinInfo]`,
+where each element in the sequence defines information to create a saved parser
+with the following parameters:
+
+|Name    |Type             |Reqiured | Description |
+|--------|-----------------|---------|-------------|
+|schema  |`String`         |yes      |Resource path to the main schema |
+|root    |`Option[String]` |no       |Root element in the schema. If `None`, 
uses the first element in the schema |
+|name    |`Option[String]` |no       |If `Some`, includes value in the jar 
classifier, useful to distinguish saved parsers |
+|config  |`Option[File]`   |no       |Path to a configuration file used during 
compilation |
+
+An example of this settings supporting two roots looks like this:
 
 ```scala
 daffodilPackageBinInfos := Seq(
-  ("/com/example/xsd/mainSchema.dfdl.xsd", Some("record"), None)
-  ("/com/example/xsd/mainSchema.dfdl.xsd", Some("fileOrRecords"), Some("file"))
+  DaffodilBinInfo("/com/example/xsd/mainSchema.dfdl.xsd", Some("record"))
+  DaffodilBinInfo("/com/example/xsd/mainSchema.dfdl.xsd", 
Some("fileOfRecords"), Some("file"))
 )
 ```
 
diff --git a/src/main/scala/org/apache/daffodil/DaffodilPlugin.scala 
b/src/main/scala/org/apache/daffodil/DaffodilPlugin.scala
index 810b45c..11a109d 100644
--- a/src/main/scala/org/apache/daffodil/DaffodilPlugin.scala
+++ b/src/main/scala/org/apache/daffodil/DaffodilPlugin.scala
@@ -18,6 +18,7 @@
 package org.apache.daffodil
 
 import java.io.File
+import scala.language.implicitConversions
 import scala.util.Properties
 
 import sbt.Keys._
@@ -26,8 +27,8 @@ import sbt._
 object DaffodilPlugin extends AutoPlugin {
 
   object autoImport {
-    val daffodilPackageBinInfos = settingKey[Seq[(String, Option[String], 
Option[String])]](
-      "Sequence of 3-tuple defining the main schema resource, optional root 
element, and optional name",
+    val daffodilPackageBinInfos = settingKey[Seq[DaffodilBinInfo]](
+      "Information used to create compiled parsers",
     )
     val daffodilPackageBinVersions = settingKey[Seq[String]](
       "Versions of daffodil to create saved parsers for",
@@ -50,13 +51,35 @@ object DaffodilPlugin extends AutoPlugin {
     val daffodilTdmlUsesPackageBin = settingKey[Boolean](
       "Whether or not TDML files use the saved parsers created by 
daffodilPackageBin",
     )
+
+    /**
+     * Class to define daffodilPackageBinInfos, auto-imported to simplify sbt 
configs
+     */
+    case class DaffodilBinInfo(
+      schema: String,
+      root: Option[String] = None,
+      name: Option[String] = None,
+      config: Option[File] = None,
+    )
+
+    /**
+     * Provides backwards compatibility with the older versions of the plugin 
where
+     * daffodilPackagBinInfos was a Seq of 3-tuples instead of a 
DaffodilBinInfo
+     */
+    implicit def threeTupleToDaffodilBinInfo(t: (String, Option[String], 
Option[String])) = {
+      DaffodilBinInfo(
+        schema = t._1,
+        root = t._2,
+        name = t._3,
+      )
+    }
   }
 
   import autoImport._
 
   /**
-  * Generate a daffodil version specific ivy configuration string by removing 
everything
-  * except for alphanumeric characters
+   * Generate a daffodil version specific ivy configuration string by removing 
everything
+   * except for alphanumeric characters
    */
   def ivyConfigName(daffodilVersion: String): String = {
     "daffodil" + daffodilVersion.replaceAll("[^a-zA-Z0-9]", "")
@@ -246,12 +269,12 @@ object DaffodilPlugin extends AutoPlugin {
      */
     packageDaffodilBin / artifacts := {
       daffodilPackageBinVersions.value.flatMap { daffodilVersion =>
-        daffodilPackageBinInfos.value.map { case (_, _, optName) =>
+        daffodilPackageBinInfos.value.map { dbi =>
           // each artifact has the same name as the jar, in the "parser" type, 
"bin" extension,
-          // and daffodil version specific classifier. If optName is provided, 
it is prepended
+          // and daffodil version specific classifier. If dbi.name is Some, it 
is prepended
           // to the classifier separated by a hyphen. Note that publishing as 
maven style will
           // only use the name, extension, and classifier
-          val classifier = classifierName(optName, daffodilVersion)
+          val classifier = classifierName(dbi.name, daffodilVersion)
           Artifact(name.value, "parser", "bin", Some(classifier), Vector(), 
None)
         }
       }.toSeq
@@ -278,9 +301,7 @@ object DaffodilPlugin extends AutoPlugin {
 
       // the name field is the only thing that makes saved parser artifacts 
unique. Ensure there
       // are no duplicates.
-      val groupedClassifiers = daffodilPackageBinInfos.value.groupBy { case 
(_, _, optName) =>
-        optName
-      }
+      val groupedClassifiers = daffodilPackageBinInfos.value.groupBy { _.name }
       val duplicates = groupedClassifiers.filter { case (k, v) => v.length > 1 
}.keySet
       if (duplicates.size > 0) {
         val dupsStr = duplicates.mkString(", ")
@@ -311,8 +332,8 @@ object DaffodilPlugin extends AutoPlugin {
           // on the classpath before projectClasspath jars
           val classpathFiles = Seq(pluginJar) ++ daffodilJars ++ 
projectClasspath
 
-          daffodilPackageBinInfos.value.map { case (mainSchema, optRoot, 
optName) =>
-            val classifier = classifierName(optName, daffodilVersion)
+          daffodilPackageBinInfos.value.map { dbi =>
+            val classifier = classifierName(dbi.name, daffodilVersion)
             val targetFile = target.value / 
s"${name.value}-${version.value}-${classifier}.bin"
 
             // extract options out of DAFFODIL_JAVA_OPTS or JAVA_OPTS 
environment variables.
@@ -328,9 +349,11 @@ object DaffodilPlugin extends AutoPlugin {
               "-classpath",
               classpathFiles.mkString(File.pathSeparator),
               mainClass,
-              mainSchema,
+              dbi.schema,
               targetFile.toString,
-            ) ++ optRoot.toSeq
+              dbi.root.getOrElse(""),
+              dbi.config.map { _.toString }.getOrElse(""),
+            )
 
             logger.info(s"compiling daffodil parser to ${targetFile} ...")
 
@@ -392,10 +415,10 @@ object DaffodilPlugin extends AutoPlugin {
         // copy the saved parsers for the current daffodilVersion to the root 
of the
         // resourceManaged directory, and consider those our generated 
resources
         val destDir = (Test / resourceManaged).value
-        val tdmlParserFiles = daffodilPackageBinInfos.value.map { case (_, _, 
optName) =>
-          val sourceClassifier = classifierName(optName, daffodilVersion.value)
+        val tdmlParserFiles = daffodilPackageBinInfos.value.map { dbi =>
+          val sourceClassifier = classifierName(dbi.name, 
daffodilVersion.value)
           val source = target.value / 
s"${name.value}-${version.value}-${sourceClassifier}.bin"
-          val destClassifier = optName.map { "-" + _ }.getOrElse("")
+          val destClassifier = dbi.name.map { "-" + _ }.getOrElse("")
           val dest = destDir / s"${name.value}${destClassifier}.bin"
           IO.copyFile(source, dest)
           dest
@@ -415,8 +438,8 @@ object DaffodilPlugin extends AutoPlugin {
     Test / packageBin / mappings := {
       val existingMappings = (Test / packageBin / mappings).value
       if (daffodilTdmlUsesPackageBin.value) {
-        val tdmlParserNames = daffodilPackageBinInfos.value.map { case (_, _, 
optName) =>
-          val destClassifier = optName.map { "-" + _ }.getOrElse("")
+        val tdmlParserNames = daffodilPackageBinInfos.value.map { dbi =>
+          val destClassifier = dbi.name.map { "-" + _ }.getOrElse("")
           s"${name.value}${destClassifier}.bin"
         }
         existingMappings.filterNot { case (_, name) => 
tdmlParserNames.contains(name) }
diff --git a/src/main/scala/org/apache/daffodil/DaffodilSaver.scala 
b/src/main/scala/org/apache/daffodil/DaffodilSaver.scala
index 2eabd55..2a8f5fd 100644
--- a/src/main/scala/org/apache/daffodil/DaffodilSaver.scala
+++ b/src/main/scala/org/apache/daffodil/DaffodilSaver.scala
@@ -34,17 +34,22 @@ import scala.collection.JavaConverters._
 object DaffodilSaver {
 
   /**
-   * Usage: daffodilReflectionSave <schemaFile> <outputFile> [root]
+   * Usage: daffodilReflectionSave <schemaFile> <outputFile> <root> <config>
+   *
+   * If <root> or <config> is unknown/not-provided, they must be the empty 
string
    */
   def main(args: Array[String]): Unit = {
 
+    if (args.length != 4) System.err.println(s"[error] four arguments are 
required")
+
     val schemaFile = new File(this.getClass.getResource(args(0)).toURI)
     val output = FileChannel.open(
       Paths.get(args(1)),
       StandardOpenOption.CREATE,
       StandardOpenOption.WRITE,
     )
-    val root = if (args.length > 2) args(2) else null
+    val root = if (args(2) != "") args(2) else null
+    val config = if (args(3) != "") args(3) else null
 
     // parameter types
     val cFile = classOf[File]
@@ -58,6 +63,7 @@ object DaffodilSaver {
     val daffodilCompiler = daffodilClass.getMethod("compiler")
 
     val compilerClass = Class.forName("org.apache.daffodil.japi.Compiler")
+    val compilerWithTunable = compilerClass.getMethod("withTunable", cString, 
cString)
     val compilerCompileFile = compilerClass.getMethod("compileFile", cFile, 
cString, cString)
 
     val processorFactoryClass = 
Class.forName("org.apache.daffodil.japi.ProcessorFactory")
@@ -86,7 +92,17 @@ object DaffodilSaver {
     }
 
     // val compiler = Daffodil.compiler()
-    val compiler = daffodilCompiler.invoke(null)
+    var compiler = daffodilCompiler.invoke(null)
+
+    // compiler = compiler.withTunable(...)
+    if (config != null) {
+      val configXml = scala.xml.Utility.trim(scala.xml.XML.loadFile(config))
+      (configXml \ "tunables").foreach { tunablesNode =>
+        tunablesNode.child.foreach { node =>
+          compiler = compilerWithTunable.invoke(compiler, node.label, 
node.text)
+        }
+      }
+    }
 
     // val processorFactory = compiler.compileFile(schemaFile, root, None)
     val processorFactory = compilerCompileFile
diff --git a/src/sbt-test/sbt-daffodil/saved-parsers-01/build.sbt 
b/src/sbt-test/sbt-daffodil/saved-parsers-01/build.sbt
index 8b6c9fe..ea1a7a4 100644
--- a/src/sbt-test/sbt-daffodil/saved-parsers-01/build.sbt
+++ b/src/sbt-test/sbt-daffodil/saved-parsers-01/build.sbt
@@ -24,8 +24,8 @@ organization := "com.example"
 enablePlugins(DaffodilPlugin)
 
 daffodilPackageBinInfos := Seq(
-  ("/test.dfdl.xsd", None, None),
-  ("/test.dfdl.xsd", Some("test02"), Some("two")),
+  DaffodilBinInfo("/test.dfdl.xsd"),
+  DaffodilBinInfo("/test.dfdl.xsd", Some("test02"), Some("two")),
 )
 
 daffodilPackageBinVersions := Seq("3.6.0", "3.5.0")
diff --git a/src/sbt-test/sbt-daffodil/saved-parsers-01/build.sbt 
b/src/sbt-test/sbt-daffodil/saved-parsers-02/build.sbt
similarity index 95%
copy from src/sbt-test/sbt-daffodil/saved-parsers-01/build.sbt
copy to src/sbt-test/sbt-daffodil/saved-parsers-02/build.sbt
index 8b6c9fe..6c673b8 100644
--- a/src/sbt-test/sbt-daffodil/saved-parsers-01/build.sbt
+++ b/src/sbt-test/sbt-daffodil/saved-parsers-02/build.sbt
@@ -23,6 +23,7 @@ organization := "com.example"
 
 enablePlugins(DaffodilPlugin)
 
+// same as saved-parsers-01 but uses the old tuple syntax
 daffodilPackageBinInfos := Seq(
   ("/test.dfdl.xsd", None, None),
   ("/test.dfdl.xsd", Some("test02"), Some("two")),
diff --git a/src/sbt-test/sbt-daffodil/saved-parsers-02/project/plugins.sbt 
b/src/sbt-test/sbt-daffodil/saved-parsers-02/project/plugins.sbt
new file mode 100644
index 0000000..eaf249b
--- /dev/null
+++ b/src/sbt-test/sbt-daffodil/saved-parsers-02/project/plugins.sbt
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+addSbtPlugin("org.apache.daffodil" % "sbt-daffodil" % 
sys.props("plugin.version"))
diff --git 
a/src/sbt-test/sbt-daffodil/saved-parsers-02/src/main/resources/test.dfdl.xsd 
b/src/sbt-test/sbt-daffodil/saved-parsers-02/src/main/resources/test.dfdl.xsd
new file mode 100644
index 0000000..ae0d6db
--- /dev/null
+++ 
b/src/sbt-test/sbt-daffodil/saved-parsers-02/src/main/resources/test.dfdl.xsd
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<schema
+  xmlns="http://www.w3.org/2001/XMLSchema"; 
+  xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
+  xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/";
+  xmlns:ex="http://example.com";
+  targetNamespace="http://example.com";
+  elementFormDefault="unqualified">
+
+  <include 
schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+
+  <annotation>
+    <appinfo source="http://www.ogf.org/dfdl/";>
+      <dfdl:format ref="ex:GeneralFormat" />
+    </appinfo>
+  </annotation>
+
+  <element name="test01" type="xs:string" dfdl:lengthKind="delimited" />
+
+  <element name="test02" type="xs:string" dfdl:lengthKind="delimited" />
+
+</schema>
diff --git a/src/sbt-test/sbt-daffodil/saved-parsers-02/test.script 
b/src/sbt-test/sbt-daffodil/saved-parsers-02/test.script
new file mode 100644
index 0000000..c2e7033
--- /dev/null
+++ b/src/sbt-test/sbt-daffodil/saved-parsers-02/test.script
@@ -0,0 +1,31 @@
+## Licensed to the Apache Software Foundation (ASF) under one
+## or more contributor license agreements.  See the NOTICE file
+## distributed with this work for additional information
+## regarding copyright ownership.  The ASF licenses this file
+## to you under the Apache License, Version 2.0 (the
+## "License"); you may not use this file except in compliance
+## with the License.  You may obtain a copy of the License at
+## 
+##  http://www.apache.org/licenses/LICENSE-2.0
+## 
+## Unless required by applicable law or agreed to in writing,
+## software distributed under the License is distributed on an
+## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+## KIND, either express or implied.  See the License for the
+## specific language governing permissions and limitations
+## under the License.
+## 
+
+> packageDaffodilBin
+$ exists target/test-0.1-daffodil350.bin
+$ exists target/test-0.1-daffodil360.bin
+$ exists target/test-0.1-two-daffodil350.bin
+$ exists target/test-0.1-two-daffodil360.bin
+
+> set publishTo := Some(Resolver.file("file", new File("target/ivy-publish/")))
+> publish
+$ exists target/ivy-publish/com/example/test/0.1/test-0.1.jar
+$ exists target/ivy-publish/com/example/test/0.1/test-0.1-daffodil350.bin
+$ exists target/ivy-publish/com/example/test/0.1/test-0.1-daffodil360.bin
+$ exists target/ivy-publish/com/example/test/0.1/test-0.1-two-daffodil350.bin
+$ exists target/ivy-publish/com/example/test/0.1/test-0.1-two-daffodil360.bin
diff --git a/src/sbt-test/sbt-daffodil/tdml-saved-parser-01/build.sbt 
b/src/sbt-test/sbt-daffodil/saved-parsers-03/build.sbt
similarity index 81%
copy from src/sbt-test/sbt-daffodil/tdml-saved-parser-01/build.sbt
copy to src/sbt-test/sbt-daffodil/saved-parsers-03/build.sbt
index 9076580..17d1ed2 100644
--- a/src/sbt-test/sbt-daffodil/tdml-saved-parser-01/build.sbt
+++ b/src/sbt-test/sbt-daffodil/saved-parsers-03/build.sbt
@@ -24,12 +24,10 @@ organization := "com.example"
 enablePlugins(DaffodilPlugin)
 
 daffodilPackageBinInfos := Seq(
-  ("/com/example/test.dfdl.xsd", None, None),
-  ("/com/example/test.dfdl.xsd", Some("test02"), Some("two")),
+  DaffodilBinInfo("/test.dfdl.xsd", config = Some((Compile / 
resourceDirectory).value / "test.cfg")),
+  DaffodilBinInfo("/test.dfdl.xsd", Some("test02"), Some("two"), config = 
Some((Compile / resourceDirectory).value / "test.cfg")),
 )
 
 daffodilPackageBinVersions := Seq("3.6.0", "3.5.0")
 
 daffodilVersion := daffodilPackageBinVersions.value.head
-
-daffodilTdmlUsesPackageBin := true
diff --git a/src/sbt-test/sbt-daffodil/saved-parsers-03/project/plugins.sbt 
b/src/sbt-test/sbt-daffodil/saved-parsers-03/project/plugins.sbt
new file mode 100644
index 0000000..eaf249b
--- /dev/null
+++ b/src/sbt-test/sbt-daffodil/saved-parsers-03/project/plugins.sbt
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+addSbtPlugin("org.apache.daffodil" % "sbt-daffodil" % 
sys.props("plugin.version"))
diff --git 
a/src/sbt-test/sbt-daffodil/saved-parsers-03/src/main/resources/test.cfg 
b/src/sbt-test/sbt-daffodil/saved-parsers-03/src/main/resources/test.cfg
new file mode 100644
index 0000000..7545ee2
--- /dev/null
+++ b/src/sbt-test/sbt-daffodil/saved-parsers-03/src/main/resources/test.cfg
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<daf:dfdlConfig
+  xmlns:daf="urn:ogf:dfdl:2013:imp:daffodil.apache.org:2018:ext">
+  <daf:tunables>
+    <daf:suppressSchemaDefinitionWarnings>
+      encodingErrorPolicyError
+      facetExplicitLengthOutOfRange
+      multipleChoiceBranches
+    </daf:suppressSchemaDefinitionWarnings>
+  </daf:tunables>
+</daf:dfdlConfig>
diff --git 
a/src/sbt-test/sbt-daffodil/saved-parsers-03/src/main/resources/test.dfdl.xsd 
b/src/sbt-test/sbt-daffodil/saved-parsers-03/src/main/resources/test.dfdl.xsd
new file mode 100644
index 0000000..ae0d6db
--- /dev/null
+++ 
b/src/sbt-test/sbt-daffodil/saved-parsers-03/src/main/resources/test.dfdl.xsd
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<schema
+  xmlns="http://www.w3.org/2001/XMLSchema"; 
+  xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
+  xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/";
+  xmlns:ex="http://example.com";
+  targetNamespace="http://example.com";
+  elementFormDefault="unqualified">
+
+  <include 
schemaLocation="/org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd"/>
+
+  <annotation>
+    <appinfo source="http://www.ogf.org/dfdl/";>
+      <dfdl:format ref="ex:GeneralFormat" />
+    </appinfo>
+  </annotation>
+
+  <element name="test01" type="xs:string" dfdl:lengthKind="delimited" />
+
+  <element name="test02" type="xs:string" dfdl:lengthKind="delimited" />
+
+</schema>
diff --git a/src/sbt-test/sbt-daffodil/saved-parsers-03/test.script 
b/src/sbt-test/sbt-daffodil/saved-parsers-03/test.script
new file mode 100644
index 0000000..76a79ef
--- /dev/null
+++ b/src/sbt-test/sbt-daffodil/saved-parsers-03/test.script
@@ -0,0 +1,23 @@
+## Licensed to the Apache Software Foundation (ASF) under one
+## or more contributor license agreements.  See the NOTICE file
+## distributed with this work for additional information
+## regarding copyright ownership.  The ASF licenses this file
+## to you under the Apache License, Version 2.0 (the
+## "License"); you may not use this file except in compliance
+## with the License.  You may obtain a copy of the License at
+## 
+##  http://www.apache.org/licenses/LICENSE-2.0
+## 
+## Unless required by applicable law or agreed to in writing,
+## software distributed under the License is distributed on an
+## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+## KIND, either express or implied.  See the License for the
+## specific language governing permissions and limitations
+## under the License.
+## 
+
+> packageDaffodilBin
+$ exists target/test-0.1-daffodil350.bin
+$ exists target/test-0.1-daffodil360.bin
+$ exists target/test-0.1-two-daffodil350.bin
+$ exists target/test-0.1-two-daffodil360.bin
diff --git a/src/sbt-test/sbt-daffodil/tdml-saved-parser-01/build.sbt 
b/src/sbt-test/sbt-daffodil/tdml-saved-parser-01/build.sbt
index 9076580..14d4cb4 100644
--- a/src/sbt-test/sbt-daffodil/tdml-saved-parser-01/build.sbt
+++ b/src/sbt-test/sbt-daffodil/tdml-saved-parser-01/build.sbt
@@ -24,8 +24,8 @@ organization := "com.example"
 enablePlugins(DaffodilPlugin)
 
 daffodilPackageBinInfos := Seq(
-  ("/com/example/test.dfdl.xsd", None, None),
-  ("/com/example/test.dfdl.xsd", Some("test02"), Some("two")),
+  DaffodilBinInfo("/com/example/test.dfdl.xsd"),
+  DaffodilBinInfo("/com/example/test.dfdl.xsd", Some("test02"), Some("two")),
 )
 
 daffodilPackageBinVersions := Seq("3.6.0", "3.5.0")
diff --git a/src/sbt-test/sbt-daffodil/versions-01/build.sbt 
b/src/sbt-test/sbt-daffodil/versions-01/build.sbt
index a5a2849..884d8aa 100644
--- a/src/sbt-test/sbt-daffodil/versions-01/build.sbt
+++ b/src/sbt-test/sbt-daffodil/versions-01/build.sbt
@@ -24,7 +24,7 @@ organization := "com.example"
 enablePlugins(DaffodilPlugin)
 
 daffodilPackageBinInfos := Seq(
-  ("/com/example/test.dfdl.xsd", None, None),
+  DaffodilBinInfo("/com/example/test.dfdl.xsd"),
 )
 
 daffodilPackageBinVersions := Seq(daffodilVersion.value)

Reply via email to