Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: xerial/sbt-pack
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.14
Choose a base ref
...
head repository: xerial/sbt-pack
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.15
Choose a head ref

Commits on Jul 7, 2021

  1. 0.14 release notes

    xerial committed Jul 7, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    62a8e3c View commit details

Commits on Aug 15, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    b332070 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    d11635c View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    cc97f20 View commit details
  4. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    ca05646 View commit details
  5. Verified

    This commit was signed with the committer’s verified signature.
    andrzej-stencel Andrzej Stencel
    Copy the full SHA
    96f8dd8 View commit details
  6. Update commons-compress to 1.21 (#242)

    * Update commons-compress to 1.21
    
    * Update commons-compress to 1.21
    scala-steward authored Aug 15, 2021
    Copy the full SHA
    96933ca View commit details

Commits on Aug 25, 2021

  1. Update scalafmt-core to 3.0.0 (#250)

    * Update scalafmt-core to 3.0.0
    
    * Reformat with scalafmt 3.0.0
    scala-steward authored Aug 25, 2021
    Copy the full SHA
    a94a8ff View commit details

Commits on Aug 28, 2021

  1. Partially verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
    Copy the full SHA
    ab47f90 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    714a524 View commit details

Commits on Oct 9, 2021

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    5e8fd59 View commit details

Commits on Nov 17, 2021

  1. Update scalafmt-core to 3.0.8 (#261)

    * Update scalafmt-core to 3.0.8
    
    * Reformat with scalafmt 3.0.8
    scala-steward authored Nov 17, 2021

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    AustinAbro321 Austin Abro
    Copy the full SHA
    7c10037 View commit details

Commits on Dec 10, 2021

  1. Copy the full SHA
    0b8e1e5 View commit details
  2. Copy the full SHA
    32e5358 View commit details
  3. Update scalafmt-core to 3.2.1 (#266)

    * Update scalafmt-core to 3.2.1
    
    * Update .scalafmt.conf
    
    Co-authored-by: Taro L. Saito <leo@xerial.org>
    scala-steward and xerial authored Dec 10, 2021
    Copy the full SHA
    c99c8cb View commit details

Commits on May 3, 2022

  1. Copy the full SHA
    02ca758 View commit details

Commits on May 25, 2022

  1. Copy the full SHA
    a9cf124 View commit details
  2. Copy the full SHA
    61236bc View commit details
  3. Copy the full SHA
    4408863 View commit details

Commits on Jun 2, 2022

  1. Copy the full SHA
    7843887 View commit details
  2. Copy the full SHA
    81d6560 View commit details
  3. Copy the full SHA
    823db38 View commit details

Commits on Jun 3, 2022

  1. Copy the full SHA
    98374ff View commit details
  2. Copy the full SHA
    0f9b2c1 View commit details
  3. Copy the full SHA
    99ac69b View commit details
  4. Update scala-library to 2.12.15 (#282)

    * Update scala-library to 2.12.15
    
    * Update test
    
    * Update test
    
    Co-authored-by: Taro L. Saito <leo@xerial.org>
    xerial-bot and xerial authored Jun 3, 2022
    Copy the full SHA
    ca9d6e2 View commit details

Commits on Sep 17, 2022

  1. Copy the full SHA
    f8232d9 View commit details
  2. Copy the full SHA
    86113b9 View commit details
  3. Copy the full SHA
    bd4a502 View commit details
  4. Copy the full SHA
    38560af View commit details

Commits on Nov 2, 2022

  1. Copy the full SHA
    50feb06 View commit details
  2. Create dependabot.yml

    xerial authored Nov 2, 2022
    Copy the full SHA
    e43bf18 View commit details
  3. Copy the full SHA
    74be648 View commit details
  4. Update scalafmt-core to 3.6.0 (#300)

    Updates
    [org.scalameta:scalafmt-core](https://github.com/scalameta/scalafmt)
    from 3.5.9 to 3.6.0.
    [GitHub Release
    Notes](https://github.com/scalameta/scalafmt/releases/tag/v3.6.0) -
    [Version
    Diff](scalameta/scalafmt@v3.5.9...v3.6.0)
    
    
    I'll automatically update this PR to resolve conflicts as long as you
    don't change it yourself.
    
    If you'd like to skip this version, you can just close this PR. If you
    have any feedback, just mention me in the comments below.
    
    Configure Scala Steward for your repository with a
    [`.scala-steward.conf`](https://github.com/scala-steward-org/scala-steward/blob/a086a64dcf8d96ba28cacc817b402b093e8f0d1e/docs/repo-specific-configuration.md)
    file.
    
    Have a fantastic day writing Scala!
    
    <details>
    <summary>Adjust future updates</summary>
    
    Add this to your `.scala-steward.conf` file to ignore future updates of
    this dependency:
    ```
    updates.ignore = [ { groupId = "org.scalameta", artifactId = "scalafmt-core" } ]
    ```
    Or, add this to slow down future updates of this dependency:
    ```
    dependencyOverrides = [{
      pullRequests = { frequency = "@monthly" },
      dependency = { groupId = "org.scalameta", artifactId = "scalafmt-core" }
    }]
    ```
    </details>
    
    labels: library-update, early-semver-minor, semver-spec-minor,
    commit-count:1
    scala-steward authored Nov 2, 2022
    Copy the full SHA
    9d85e90 View commit details
  5. Copy the full SHA
    a7d3349 View commit details
  6. Copy the full SHA
    6aad410 View commit details
  7. Bump actions/checkout from 2 to 3 (#305)

    Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
    - [Release notes](https://github.com/actions/checkout/releases)
    - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
    - [Commits](actions/checkout@v2...v3)
    
    ---
    updated-dependencies:
    - dependency-name: actions/checkout
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Nov 2, 2022
    Copy the full SHA
    534c79c View commit details
  8. Bump olafurpg/setup-scala from 10 to 13 (#304)

    Bumps [olafurpg/setup-scala](https://github.com/olafurpg/setup-scala) from 10 to 13.
    - [Release notes](https://github.com/olafurpg/setup-scala/releases)
    - [Commits](olafurpg/setup-scala@v10...v13)
    
    ---
    updated-dependencies:
    - dependency-name: olafurpg/setup-scala
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Taro L. Saito <leo@xerial.org>
    dependabot[bot] and xerial authored Nov 2, 2022
    Copy the full SHA
    2156df2 View commit details
  9. 0.15 relese notes

    xerial committed Nov 2, 2022
    Copy the full SHA
    26985dc View commit details
Showing with 203 additions and 173 deletions.
  1. +11 −0 .github/dependabot.yml
  2. +3 −3 .github/workflows/test.yml
  3. +1 −0 .gitignore
  4. +3 −1 .scalafmt.conf
  5. +9 −0 ReleaseNotes.md
  6. +12 −13 build.sbt
  7. +1 −1 project/build.properties
  8. +7 −6 project/plugins.sbt
  9. +9 −6 sbt
  10. +4 −4 sonatype.sbt
  11. +5 −5 src/main/scala/xerial/sbt/pack/PackArchive.scala
  12. +28 −27 src/main/scala/xerial/sbt/pack/PackPlugin.scala
  13. +2 −1 src/main/scala/xerial/sbt/pack/VersionString.scala
  14. +25 −25 src/sbt-test/sbt-pack/archive-modules/build.sbt
  15. +1 −1 src/sbt-test/sbt-pack/archive-modules/project/plugins.sbt
  16. +1 −1 src/sbt-test/sbt-pack/build-sbt/build.sbt
  17. +1 −1 src/sbt-test/sbt-pack/build-sbt/project/plugins.sbt
  18. +1 −1 src/sbt-test/sbt-pack/command-launcher/project/plugins.sbt
  19. +20 −16 src/sbt-test/sbt-pack/command-launcher/src/main/scala/Launcher.scala
  20. +1 −1 src/sbt-test/sbt-pack/convention-full/build.sbt
  21. +1 −1 src/sbt-test/sbt-pack/convention-full/project/plugins.sbt
  22. +1 −1 src/sbt-test/sbt-pack/convention-noversion/build.sbt
  23. +1 −1 src/sbt-test/sbt-pack/convention-noversion/project/plugins.sbt
  24. +4 −4 src/sbt-test/sbt-pack/copy-dependencies/build.sbt
  25. +1 −1 src/sbt-test/sbt-pack/copy-dependencies/project/plugins.sbt
  26. +2 −2 src/sbt-test/sbt-pack/duplicate-jars/build.sbt
  27. +1 −1 src/sbt-test/sbt-pack/duplicate-jars/project/plugins.sbt
  28. +1 −1 src/sbt-test/sbt-pack/duplicate-jars/test
  29. +1 −1 src/sbt-test/sbt-pack/env-vars/build.sbt
  30. +1 −1 src/sbt-test/sbt-pack/env-vars/project/plugins.sbt
  31. +4 −5 src/sbt-test/sbt-pack/env-vars/src/main/scala/Test.scala
  32. +4 −4 src/sbt-test/sbt-pack/exclude-jars/build.sbt
  33. +1 −1 src/sbt-test/sbt-pack/exclude-jars/project/plugins.sbt
  34. +4 −4 src/sbt-test/sbt-pack/exclude-makefile/build.sbt
  35. +1 −2 src/sbt-test/sbt-pack/exclude-makefile/project/plugins.sbt
  36. +6 −6 src/sbt-test/sbt-pack/exclude-test-config/build.sbt
  37. +1 −1 src/sbt-test/sbt-pack/exclude-test-config/project/plugins.sbt
  38. +1 −1 src/sbt-test/sbt-pack/min-project/build.sbt
  39. +1 −1 src/sbt-test/sbt-pack/min-project/project/plugins.sbt
  40. +2 −2 src/sbt-test/sbt-pack/min-project/test
  41. +3 −3 src/sbt-test/sbt-pack/multi-module/build.sbt
  42. +1 −1 src/sbt-test/sbt-pack/multi-module/project/plugins.sbt
  43. +3 −3 src/sbt-test/sbt-pack/nested-project/build.sbt
  44. +1 −1 src/sbt-test/sbt-pack/nested-project/libs/lib1/src/main/scala/lib1/Lib1.scala
  45. +1 −1 src/sbt-test/sbt-pack/nested-project/libs/lib2/src/main/scala/lib2/Lib2.scala
  46. +3 −3 src/sbt-test/sbt-pack/nested-project/modules/module1/src/main/scala/service/Main.scala
  47. +3 −3 src/sbt-test/sbt-pack/nested-project/modules/module2/src/main/scala/service/Main.scala
  48. +1 −1 src/sbt-test/sbt-pack/nested-project/project/plugins.sbt
  49. +1 −1 src/sbt-test/sbt-pack/pack-resources/build.sbt
  50. +1 −1 src/sbt-test/sbt-pack/pack-resources/project/plugins.sbt
  51. +1 −1 src/sbt-test/sbt-pack/space in path/build.sbt
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -22,15 +22,15 @@ jobs:
name: Code format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: scalafmt test
run: ./sbt scalafmtCheckAll
test_sbt_plugin:
name: plugin test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v10
- uses: actions/checkout@v3
- uses: olafurpg/setup-scala@v13
with:
java-version: adopt@1.11
- name: scripted tests
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ lib_managed/
src_managed/
project/boot/
project/plugins/project/
.bsp

# Scala-IDE specific
.scala_dependencies
4 changes: 3 additions & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
version = 2.7.5
version = 3.6.0
project.layout = StandardConvention
runner.dialect = scala212
maxColumn = 120
style = defaultWithAlign
optIn.breaksInsideChains = true
9 changes: 9 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
### Release Notes

## 0.15
- Update dependencies to use scala-xml 2.x

## 0.14
- packArchiveStem := "" setting can be used for creating package for AWS Lambda
- Add packEnvVars setting for setting environment variables
- Improved packaging performance by removing redundant jar file copies
- Add packJarListFile setting to dump the list of written files

## 0.13
- Fixed the packZipArchive perfmission issue https://github.com/xerial/sbt-pack/pull/204
- Drop the support for sbt 0.13.x
25 changes: 12 additions & 13 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -3,23 +3,23 @@ Global / onChangedBuildSource := ReloadOnSourceChanges
enablePlugins(SbtTwirl)
enablePlugins(SbtPlugin)

organization := "org.xerial.sbt"
organizationName := "Xerial project"
name := "sbt-pack"
organization := "org.xerial.sbt"
organizationName := "Xerial project"
name := "sbt-pack"
organizationHomepage := Some(new URL("http://xerial.org/"))
description := "A sbt plugin for packaging distributable Scala code"
description := "A sbt plugin for packaging distributable Scala code"

publishMavenStyle := true
publishArtifact in Test := false
publishMavenStyle := true
Test / publishArtifact := false

pomIncludeRepository := { _ =>
false
}

ThisBuild / scalaVersion := "2.12.14"
ThisBuild / scalaVersion := "2.12.17"

parallelExecution := true
crossPaths := false
crossPaths := false
scalacOptions ++= Seq("-encoding", "UTF-8", "-deprecation", "-unchecked")

scriptedBufferLog := false
@@ -33,9 +33,8 @@ scriptedLaunchOpts ++= {
}

libraryDependencies ++= Seq(
"org.slf4j" % "slf4j-simple" % "1.7.30",
"org.apache.commons" % "commons-compress" % "1.20",
"org.scalatra.scalate" %% "scalate-core" % "1.9.6",
"org.tukaani" % "xz" % "1.9",
"org.specs2" %% "specs2-core" % "4.8.2" % "test"
"org.slf4j" % "slf4j-api" % "1.7.36",
"org.apache.commons" % "commons-compress" % "1.21",
"org.tukaani" % "xz" % "1.9",
"org.specs2" %% "specs2-core" % "4.17.0" % "test"
)
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.5.4
sbt.version=1.7.3
13 changes: 7 additions & 6 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.7")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.3")
addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % "1.5.1")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")
ThisBuild / libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always

addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.13")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.4")
addSbtPlugin("com.typesafe.play" % "sbt-twirl" % "1.6.0-M7")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")

libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value
15 changes: 9 additions & 6 deletions sbt
Original file line number Diff line number Diff line change
@@ -34,11 +34,11 @@

set -o pipefail

declare -r sbt_release_version="1.5.4"
declare -r sbt_unreleased_version="1.5.4"
declare -r sbt_release_version="1.7.3"
declare -r sbt_unreleased_version="1.7.3"

declare -r latest_213="2.13.6"
declare -r latest_212="2.12.14"
declare -r latest_213="2.13.10"
declare -r latest_212="2.12.17"
declare -r latest_211="2.11.12"
declare -r latest_210="2.10.7"
declare -r latest_29="2.9.3"
@@ -216,7 +216,8 @@ getJavaVersion() {
# but on 9 and 10 it's 9.x.y and 10.x.y.
if [[ "$str" =~ ^1\.([0-9]+)(\..*)?$ ]]; then
echo "${BASH_REMATCH[1]}"
elif [[ "$str" =~ ^([0-9]+)(\..*)?$ ]]; then
# Fixes https://github.com/dwijnand/sbt-extras/issues/326
elif [[ "$str" =~ ^([0-9]+)(\..*)?(-ea)?$ ]]; then
echo "${BASH_REMATCH[1]}"
elif [[ -n "$str" ]]; then
echoerr "Can't parse java version from: $str"
@@ -252,7 +253,9 @@ is_apple_silicon() { [[ "$(uname -s)" == "Darwin" && "$(uname -m)" == "arm64" ]]
# MaxPermSize critical on pre-8 JVMs but incurs noisy warning on 8+
default_jvm_opts() {
local -r v="$(java_version)"
if [[ $v -ge 10 ]]; then
if [[ $v -ge 17 ]]; then
echo "$default_jvm_opts_common"
elif [[ $v -ge 10 ]]; then
if is_apple_silicon; then
# As of Dec 2020, JVM for Apple Silicon (M1) doesn't support JVMCI
echo "$default_jvm_opts_common"
8 changes: 4 additions & 4 deletions sonatype.sbt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import xerial.sbt.Sonatype._

publishMavenStyle := true
sonatypeProfileName := "org.xerial"
sonatypeProjectHosting := Some(GitHubHosting(user="xerial", repository="sbt-pack", email="leo@xerial.org"))
publishMavenStyle := true
sonatypeProfileName := "org.xerial"
sonatypeProjectHosting := Some(GitHubHosting(user = "xerial", repository = "sbt-pack", email = "leo@xerial.org"))
developers := List(
Developer(id = "leo", name = "Taro L. Saito", email = "leo@xerial.org", url = url("http://xerial.org/leo"))
)
licenses := Seq("APL2" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt"))

publishTo := sonatypePublishToBundle.value

dynverSonatypeSnapshots in ThisBuild := true
ThisBuild / dynverSonatypeSnapshots := true
10 changes: 5 additions & 5 deletions src/main/scala/xerial/sbt/pack/PackArchive.scala
Original file line number Diff line number Diff line change
@@ -79,10 +79,10 @@ trait PackArchive {
}

lazy val packArchiveSettings = Seq[Def.Setting[_]](
packArchivePrefix := name.value,
packArchiveName := s"${packArchivePrefix.value}-${version.value}",
packArchiveStem := s"${packArchiveName.value}",
packArchiveExcludes := Seq.empty,
packArchivePrefix := name.value,
packArchiveName := s"${packArchivePrefix.value}-${version.value}",
packArchiveStem := s"${packArchiveName.value}",
packArchiveExcludes := Seq.empty,
packArchiveTgzArtifact := Artifact(packArchivePrefix.value, "arch", "tar.gz"),
packArchiveTbzArtifact := Artifact(packArchivePrefix.value, "arch", "tar.bz2"),
packArchiveTxzArtifact := Artifact(packArchivePrefix.value, "arch", "tar.xz"),
@@ -103,7 +103,7 @@ trait PackArchive {
createTarEntry
).value,
packArchiveZip := createArchive("zip", new ZipArchiveOutputStream(_), createZipEntry).value,
packArchive := Seq(packArchiveTgz.value, packArchiveZip.value)
packArchive := Seq(packArchiveTgz.value, packArchiveZip.value)
)

def publishPackArchiveTgz: SettingsDefinition = Seq(
55 changes: 28 additions & 27 deletions src/main/scala/xerial/sbt/pack/PackPlugin.scala
Original file line number Diff line number Diff line change
@@ -22,7 +22,8 @@ import scala.util.matching.Regex

/** Plugin for packaging projects
*
* @author Taro L. Saito
* @author
* Taro L. Saito
*/
object PackPlugin extends AutoPlugin with PackArchive {

@@ -53,13 +54,13 @@ object PackPlugin extends AutoPlugin with PackArchive {
val packTargetDir = settingKey[File]("target directory to pack default is target")
val packDir = settingKey[String]("pack directory name")

//val packBashTemplate = settingKey[String]("template file for bash scripts - defaults to pack's out-of-the-box template for bash")
//val packBatTemplate = settingKey[String]("template file for bash scripts - defaults to pack's out-of-the-box template for bat")
//val packMakeTemplate = settingKey[String]("template file for bash scripts - defaults to pack's out-of-the-box template for make")
// val packBashTemplate = settingKey[String]("template file for bash scripts - defaults to pack's out-of-the-box template for bash")
// val packBatTemplate = settingKey[String]("template file for bash scripts - defaults to pack's out-of-the-box template for bat")
// val packMakeTemplate = settingKey[String]("template file for bash scripts - defaults to pack's out-of-the-box template for make")

val packMain = taskKey[Map[String, String]]("prog_name -> main class table")
val packMainDiscovered = taskKey[Map[String, String]]("discovered prog_name -> main class table")
val packExclude = settingKey[Seq[String]]("specify projects whose dependencies will be excluded when packaging")
val packExclude = settingKey[Seq[String]]("specify projects whose dependencies will be excluded when packaging")
val packExcludeLibJars =
settingKey[Seq[String]]("specify projects to exclude when packaging. Its dependencies will be processed")
val packExcludeJars = settingKey[Seq[String]]("specify jar file name patterns to exclude when packaging")
@@ -81,10 +82,10 @@ object PackPlugin extends AutoPlugin with PackArchive {
val packJarNameConvention = settingKey[String](
"default: (artifact name)-(version).jar; original: original JAR name; full: (organization).(artifact name)-(version).jar; no-version: (organization).(artifact name).jar"
)
val packDuplicateJarStrategy = settingKey[String]("""deal with duplicate jars. default to use latest version
val packDuplicateJarStrategy = settingKey[String]("""deal with duplicate jars. default to use latest version
|latest: use the jar with a higher version; exit: exit the task with error""".stripMargin)
val packCopyDependenciesTarget = settingKey[File]("target folder used by the <packCopyDependencies> task.")
val packCopyDependencies = taskKey[Unit]("""just copies the dependencies to the <packCopyDependencies> folder.
val packCopyDependencies = taskKey[Unit]("""just copies the dependencies to the <packCopyDependencies> folder.
|Compared to the <pack> task, it doesn't try to create scripts.
""".stripMargin)
val packCopyDependenciesUseSymbolicLinks =
@@ -122,25 +123,25 @@ object PackPlugin extends AutoPlugin with PackArchive {

lazy val packSettings = Seq[Def.Setting[_]](
packTargetDir := target.value,
packDir := "pack",
//packBashTemplate := "/xerial/sbt/template/launch.mustache",
//packBatTemplate := "/xerial/sbt/template/launch-bat.mustache",
//packMakeTemplate := "/xerial/sbt/template/Makefile.mustache",
packMain := packMainDiscovered.value,
packExclude := Seq.empty,
packExcludeLibJars := Seq.empty,
packExcludeJars := Seq.empty,
packJarListFile := None,
packExcludeArtifactTypes := Seq("source", "javadoc", "test"),
packMacIconFile := "icon-mac.png",
packResourceDir := Map(baseDirectory.value / "src/pack" -> ""),
packJvmOpts := Map.empty,
packExtraClasspath := Map.empty,
packExpandedClasspath := false,
packJarNameConvention := "default",
packDuplicateJarStrategy := "latest",
packDir := "pack",
// packBashTemplate := "/xerial/sbt/template/launch.mustache",
// packBatTemplate := "/xerial/sbt/template/launch-bat.mustache",
// packMakeTemplate := "/xerial/sbt/template/Makefile.mustache",
packMain := packMainDiscovered.value,
packExclude := Seq.empty,
packExcludeLibJars := Seq.empty,
packExcludeJars := Seq.empty,
packJarListFile := None,
packExcludeArtifactTypes := Seq("source", "javadoc", "test"),
packMacIconFile := "icon-mac.png",
packResourceDir := Map(baseDirectory.value / "src/pack" -> ""),
packJvmOpts := Map.empty,
packExtraClasspath := Map.empty,
packExpandedClasspath := false,
packJarNameConvention := "default",
packDuplicateJarStrategy := "latest",
packGenerateWindowsBatFile := true,
packGenerateMakefile := true,
packGenerateMakefile := true,
packMainDiscovered := Def.taskDyn {
val mainClasses =
getFromSelectedProjects(thisProjectRef.value, discoveredMainClasses in Compile, state.value, packExclude.value)
@@ -170,7 +171,7 @@ object PackPlugin extends AutoPlugin with PackArchive {
toExclude
}

val df = configurationFilter(name = "runtime") //&&
val df = configurationFilter(name = "runtime") // &&

val dependentJars =
for {
@@ -204,7 +205,7 @@ object PackPlugin extends AutoPlugin with PackArchive {
distinctDpJars.toSeq.distinct.sortBy(_.noVersionModuleName)
},
packCopyDependenciesUseSymbolicLinks := true,
packCopyDependenciesTarget := target.value / "lib",
packCopyDependenciesTarget := target.value / "lib",
packCopyDependencies := {
val log = streams.value.log

3 changes: 2 additions & 1 deletion src/main/scala/xerial/sbt/pack/VersionString.scala
Original file line number Diff line number Diff line change
@@ -10,7 +10,8 @@ package xerial.sbt.pack
import scala.util.{Success, Try}

/** Class to represent version strings
* @author Christian Hoffmeister
* @author
* Christian Hoffmeister
*/
case class VersionString(numbers: List[String], suffix: Option[String]) {
def major = numbers.head
50 changes: 25 additions & 25 deletions src/sbt-test/sbt-pack/archive-modules/build.sbt
Original file line number Diff line number Diff line change
@@ -2,50 +2,50 @@ import xerial.sbt.pack.PackPlugin._
// publish tar.gz archive to the repository (since sbt-pack-0.3.6)

val commonSettings = Defaults.coreDefaultSettings ++
Seq(
scalaVersion := "2.12.14",
version := "0.1",
crossPaths := false
)
Seq(
scalaVersion := "2.12.17",
version := "0.1",
crossPaths := false
)

lazy val root =
Project(
id = "archive-modules",
base = file(".")
).enablePlugins(PackPlugin)
.settings(commonSettings)
.settings(publishPackArchives)
.aggregate(module1, module2) // dependency of module2 should not be included
.dependsOn(module1)
.settings(commonSettings)
.settings(publishPackArchives)
.aggregate(module1, module2) // dependency of module2 should not be included
.dependsOn(module1)

lazy val module1 = Project(
id = "module1",
base = file("module1")
).enablePlugins(PackPlugin)
.settings(commonSettings)
.settings(publishPackArchives)
.settings(
libraryDependencies += "org.xerial" % "xerial-core" % "3.3.6"
)
.settings(commonSettings)
.settings(publishPackArchives)
.settings(
libraryDependencies += "org.xerial" % "xerial-core" % "3.3.6"
)

lazy val module2 = Project(
id = "module2",
base = file("module2")
).enablePlugins(PackPlugin)
.settings(commonSettings)
.settings(publishPackArchives)
.settings(
libraryDependencies += "org.xerial.snappy" % "snappy-java" % "1.1.1.6"
)
.settings(commonSettings)
.settings(publishPackArchives)
.settings(
libraryDependencies += "org.xerial.snappy" % "snappy-java" % "1.1.1.6"
)

// Empty archive stem test
lazy val module3 = Project(
id = "module3",
base = file("module3")
).enablePlugins(PackPlugin)
.settings(commonSettings)
.settings(publishPackArchives)
.settings(
libraryDependencies += "org.xerial.snappy" % "snappy-java" % "1.1.1.6",
packArchiveStem := ""
)
.settings(commonSettings)
.settings(publishPackArchives)
.settings(
libraryDependencies += "org.xerial.snappy" % "snappy-java" % "1.1.1.6",
packArchiveStem := ""
)
Loading