Skip to content

Commit

Permalink
Update to use Daffodil SBT plugin
Browse files Browse the repository at this point in the history
Also changes the default to be namespaced, non-namespaced should only be
used for testing or examples
  • Loading branch information
stevedlawrence committed Apr 30, 2024
1 parent 55d4b32 commit 9c380cb
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 30 deletions.
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
28 changes: 4 additions & 24 deletions src/main/g8/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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$
4 changes: 2 additions & 2 deletions src/main/g8/default.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion src/main/g8/project/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 17 additions & 0 deletions src/main/g8/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$!
// 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" % "$daffodil_plugin_version$")

0 comments on commit 9c380cb

Please sign in to comment.