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-schema.g8.git
The following commit(s) were added to refs/heads/main by this push:
new bf6755f Update to use Daffodil SBT plugin
bf6755f is described below
commit bf6755f97fce984c19aea0e9124c3d5ec84194a9
Author: Steve Lawrence <[email protected]>
AuthorDate: Thu Apr 25 10:03:18 2024 -0400
Update to use Daffodil SBT plugin
Also changes the default to be namespaced, non-namespaced should only be
used for testing or examples
---
build.sbt | 4 ++--
project/build.properties | 2 +-
src/main/g8/build.sbt | 28 ++++------------------------
src/main/g8/default.properties | 4 ++--
src/main/g8/project/build.properties | 2 +-
build.sbt => src/main/g8/project/plugins.sbt | 18 +++---------------
6 files changed, 13 insertions(+), 45 deletions(-)
diff --git a/build.sbt b/build.sbt
index c042d41..29c02ec 100644
--- a/build.sbt
+++ b/build.sbt
@@ -17,8 +17,8 @@ lazy val root = (project in file("."))
.enablePlugins(ScriptedPlugin)
.settings(
name := "daffodil-schema.g8",
- scalaVersion := "2.12.15",
- crossScalaVersions := Seq("2.12.15"),
+ scalaVersion := "2.12.19",
+ crossScalaVersions := Seq("2.12.19"),
Test / test := {
val _ = (Test / g8Test).toTask("").value
},
diff --git a/project/build.properties b/project/build.properties
index e7ff87f..36f0e34 100644
--- a/project/build.properties
+++ b/project/build.properties
@@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-sbt.version=1.6.2
+sbt.version=1.9.9
diff --git a/src/main/g8/build.sbt b/src/main/g8/build.sbt
index 32dd11c..3777bdc 100644
--- a/src/main/g8/build.sbt
+++ b/src/main/g8/build.sbt
@@ -20,29 +20,9 @@ organization := "$package$"
version := "0.1.0-SNAPSHOT"
-scalaVersion := "2.12.15"
+scalaVersion := "2.12.19"
-libraryDependencies ++= Seq(
- "com.github.sbt" % "junit-interface" % "0.13.2" % "test",
- "junit" % "junit" % "4.13.2" % "test",
- "org.apache.daffodil" %% "daffodil-tdml-processor" % "$daffodil_version$" %
"test",
- "org.apache.logging.log4j" % "log4j-core" % "2.17.1" % "test",
-)
+// for details about DaffodilPlugin settings, see
https://github.com/apache/daffodil-sbt
+enablePlugins(DaffodilPlugin)
-testOptions += Tests.Argument(TestFrameworks.JUnit, "-v")
-
-crossPaths := false
-
-$if(!namespaced.truthy)$
-// Use flat folder structure. This means *.java and *.scala files are in the
-// same directory as resources files, and source/resource files are only
-// differentiated by their file extension.
-Compile / unmanagedSourceDirectories := Seq(baseDirectory.value / "src")
-Compile / unmanagedResourceDirectories := Seq(baseDirectory.value / "src")
-Compile / unmanagedSources / includeFilter := "*.java" | "*.scala"
-Compile / unmanagedResources / excludeFilter := "*.java" | "*.scala"
-Test / unmanagedSourceDirectories := Seq(baseDirectory.value / "test")
-Test / unmanagedResourceDirectories := Seq(baseDirectory.value / "test")
-Test / unmanagedSources / includeFilter := "*.java" | "*.scala"
-Test / unmanagedResources / excludeFilter := "*.java" | "*.scala"
-$endif$
+$if(!namespaced.truthy)$daffodilFlatLayout := true$endif$
diff --git a/src/main/g8/default.properties b/src/main/g8/default.properties
index 002ef3f..efc329e 100644
--- a/src/main/g8/default.properties
+++ b/src/main/g8/default.properties
@@ -16,5 +16,5 @@
name=format
extension=dat
package=com.example
-namespaced=no
-daffodil_version=maven(org.apache.daffodil, daffodil-tdml-processor_2.12)
+namespaced=yes
+daffodil_plugin_version=maven(org.apache.daffodil, sbt-daffodil)
diff --git a/src/main/g8/project/build.properties
b/src/main/g8/project/build.properties
index f00b8c9..c3f8670 100644
--- a/src/main/g8/project/build.properties
+++ b/src/main/g8/project/build.properties
@@ -14,4 +14,4 @@ $!
# See the License for the specific language governing permissions and
# limitations under the License.
!$
-sbt.version=1.6.2
+sbt.version=1.9.9
diff --git a/build.sbt b/src/main/g8/project/plugins.sbt
similarity index 69%
copy from build.sbt
copy to src/main/g8/project/plugins.sbt
index c042d41..e61f357 100644
--- a/build.sbt
+++ b/src/main/g8/project/plugins.sbt
@@ -1,3 +1,4 @@
+$!
// 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.
@@ -12,18 +13,5 @@
// 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.
-
-lazy val root = (project in file("."))
- .enablePlugins(ScriptedPlugin)
- .settings(
- name := "daffodil-schema.g8",
- scalaVersion := "2.12.15",
- crossScalaVersions := Seq("2.12.15"),
- Test / test := {
- val _ = (Test / g8Test).toTask("").value
- },
- ratFailBinaries := true,
- ratExcludes := Seq(
- file(".git"),
- ),
- )
+!$
+addSbtPlugin("org.apache.daffodil" % "sbt-daffodil" %
"$daffodil_plugin_version$")