Skip to content

Commit

Permalink
Include the crossVersion in daffodil jars packaged in tar/zip/RPM
Browse files Browse the repository at this point in the history
The sbt-native-packager plugin does not include the crossVersion in the
Daffodil jars that it packages in tar/zip/RPM/etc. This could be useful
for more easily comparing jars from maven (which do include the
crossVersion) or creating a local Ivy/maven repo.

The plugin does not have an configuration option to set this, so this
directly modifies the mappings that the plugin creates to include the
crossVersion for Daffodil jars only.

For example, a package mapping that was previously this:

  lib/org.apache.daffodil.daffodil-lib-3.7.0.jar

is now changed to this:

  lib/org.apache.daffodil.daffodil-lib_2.12-3.7.0.jar

DAFFODIL-2849
  • Loading branch information
stevedlawrence committed Jan 17, 2024
1 parent cdb4121 commit fd70059
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions daffodil-cli/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,22 @@ Universal / mappings ++= Seq(
baseDirectory.value / "README.md" -> "README.md",
)

// When the sbt-native-packger plugin creates a tar/zip/RPM/etc, it does not include the
// crossVersion in mapping of jars built from this project (i.e. org.apache.daffodil jars only).
// There are cases where this crossVersion would be useful (e.g. consistency with Ivy jar names
// that do include the crossVersion), so this modifies the mapping to include that. Note that
// the name of the path already has what we need, we just need to prepend "lib/" and our
// organization.
Universal / mappings := (Universal / mappings).value.map { case (path, mapping) =>
val thisProjectJarPrefix = "lib/" + organization.value + "."
val newMapping =
if (mapping.startsWith(thisProjectJarPrefix))
thisProjectJarPrefix + path.getName
else
mapping
(path, newMapping)
}

maintainer := "Apache Daffodil <[email protected]>"

//
Expand Down

0 comments on commit fd70059

Please sign in to comment.