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.18
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.19
Choose a head ref

Commits on Nov 16, 2023

  1. Verified

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

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

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

Commits on Dec 7, 2023

  1. Verified

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

Commits on Dec 15, 2023

  1. Verified

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

Commits on Dec 18, 2023

  1. Verified

    This commit was signed with the committer’s verified signature.
    andrzej-stencel Andrzej Stencel
    Copy the full SHA
    defa8e6 View commit details

Commits on Jan 1, 2024

  1. Copy the full SHA
    fd15711 View commit details

Commits on Jan 9, 2024

  1. Copy the full SHA
    9733348 View commit details

Commits on Jan 17, 2024

  1. Fix duplicate 'FROM' in Dockerfile example in README (#474)

    The example Dockerfile in the README.md had a typo with a repeated 'FROM' keyword. This commit removes the duplicate 'FROM', ensuring the Dockerfile example is correct and can be used as-is without modifications.
    Divine-Shadow authored Jan 17, 2024

    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
    bc3d754 View commit details

Commits on Jan 18, 2024

  1. Verified

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

Commits on Jan 31, 2024

  1. Verified

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

Commits on Feb 19, 2024

  1. Verified

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

Commits on Feb 20, 2024

  1. Copy the full SHA
    f498a55 View commit details

Commits on Feb 21, 2024

  1. Bump release-drafter/release-drafter from 5 to 6 (#477)

    Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5 to 6.
    - [Release notes](https://github.com/release-drafter/release-drafter/releases)
    - [Commits](release-drafter/release-drafter@v5...v6)
    
    ---
    updated-dependencies:
    - dependency-name: release-drafter/release-drafter
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Feb 21, 2024
    Copy the full SHA
    d155e9b View commit details

Commits on Feb 23, 2024

  1. Copy the full SHA
    23f12b5 View commit details

Commits on Feb 25, 2024

  1. Copy the full SHA
    00671de View commit details
  2. Copy the full SHA
    e8abd78 View commit details

Commits on Feb 27, 2024

  1. Copy the full SHA
    dc3fa8e View commit details
  2. Copy the full SHA
    0133cc1 View commit details

Commits on Feb 28, 2024

  1. Copy the full SHA
    6c26272 View commit details
  2. Update commons-compress to 1.26.0 (#478)

    * Update commons-compress to 1.26.0
    
    * Fix
    
    * Add commons-codec
    
    ---------
    
    Co-authored-by: Taro L. Saito <leo@xerial.org>
    xerial-bot and xerial authored Feb 28, 2024
    Copy the full SHA
    91bddb8 View commit details
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -23,6 +23,6 @@ jobs:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
- uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = 3.7.15
version = 3.8.0
project.layout = StandardConvention
runner.dialect = scala212
maxColumn = 120
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -213,7 +213,7 @@ packMain := Map("myapp"->"org.yourdomain.MyApp")
**Dockerfile**
```
# Using JDK17 from Amazon Corretto
FROM FROM amazoncorretto:17
FROM amazoncorretto:17
COPY target/pack /srv/myapp
10 changes: 6 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ pomIncludeRepository := { _ =>
false
}

ThisBuild / scalaVersion := "2.12.18"
ThisBuild / scalaVersion := "2.12.19"

parallelExecution := true
crossPaths := false
@@ -35,7 +35,9 @@ scriptedLaunchOpts ++= {
testFrameworks += new TestFramework("wvlet.airspec.Framework")

libraryDependencies ++= Seq(
"org.wvlet.airframe" %% "airspec" % "23.11.3" % Test,
"org.apache.commons" % "commons-compress" % "1.24.0",
"org.tukaani" % "xz" % "1.9"
"org.wvlet.airframe" %% "airspec" % "24.2.3" % Test,
"org.apache.commons" % "commons-compress" % "1.26.0",
// commons-codec is necessary for commons-compress
"commons-codec" % "commons-codec" % "1.16.1",
"org.tukaani" % "xz" % "1.9"
)
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.7
sbt.version=1.9.9
4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ThisBuild / libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always

addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.21")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.10.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.4")
addSbtPlugin("org.playframework.twirl" % "sbt-twirl" % "2.0.1")
addSbtPlugin("org.playframework.twirl" % "sbt-twirl" % "2.0.4")
addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.0.1")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")

42 changes: 22 additions & 20 deletions src/main/scala/xerial/sbt/pack/PackArchive.scala
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
package xerial.sbt.pack

import java.io._

import org.apache.commons.compress.archivers._
import org.apache.commons.compress.archivers.tar._
import org.apache.commons.compress.archivers.zip._
import java.io.*
import org.apache.commons.compress.archivers.*
import org.apache.commons.compress.archivers.tar.*
import org.apache.commons.compress.archivers.zip.*
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorOutputStream
import org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream
import org.apache.commons.compress.compressors.xz.XZCompressorOutputStream
import org.apache.commons.compress.utils.IOUtils
import sbt.Keys._
import sbt._
import org.apache.commons.io.IOUtils
import sbt.Keys.*
import sbt.*

trait PackArchive {

import PackPlugin.autoImport._

private def createArchive(
private def createArchive[EntryType <: ArchiveEntry](
archiveSuffix: String,
createOutputStream: (OutputStream) => ArchiveOutputStream,
createEntry: (File, String, File) => ArchiveEntry
createOutputStream: (OutputStream) => ArchiveOutputStream[EntryType],
createEntry: (File, String, File) => EntryType
) = Def.task {
val out = streams.value
val targetDir: File = packTargetDir.value
@@ -56,21 +55,22 @@ trait PackArchive {
targetDir / archiveName
}

private def createTarEntry(file: File, fileName: String, binDir: File) = {
private def createTarEntry(file: File, fileName: String, binDir: File): TarArchiveEntry = {
val archiveEntry = new TarArchiveEntry(file, fileName)
if (file.getAbsolutePath startsWith binDir.getAbsolutePath)
if (file.getAbsolutePath startsWith binDir.getAbsolutePath) {
archiveEntry.setMode(Integer.parseInt("0755", 8))
}
archiveEntry
}

private def createTarArchiveOutputStream(os: OutputStream) = {
private def createTarArchiveOutputStream(os: OutputStream): TarArchiveOutputStream = {
val tos = new TarArchiveOutputStream(os)
tos.setLongFileMode(TarArchiveOutputStream.LONGFILE_POSIX)
tos.setBigNumberMode(TarArchiveOutputStream.BIGNUMBER_POSIX)
tos
}

private def createZipEntry(file: File, fileName: String, binDir: File) = {
private def createZipEntry(file: File, fileName: String, binDir: File): ZipArchiveEntry = {
val archiveEntry = new ZipArchiveEntry(file, fileName)
if (file.getAbsolutePath.startsWith(binDir.getAbsolutePath)) {
archiveEntry.setUnixMode(Integer.parseInt("0755", 8))
@@ -88,28 +88,30 @@ trait PackArchive {
packArchiveTxzArtifact := Artifact(packArchivePrefix.value, "arch", "tar.xz"),
packArchiveZipArtifact := Artifact(packArchivePrefix.value, "arch", "zip"),
Def.derive(
packArchiveTgz := createArchive(
packArchiveTgz := createArchive[TarArchiveEntry](
"tar.gz",
(fos) => createTarArchiveOutputStream(new GzipCompressorOutputStream(fos)),
createTarEntry
).value
),
Def.derive(
packArchiveTbz := createArchive(
packArchiveTbz := createArchive[TarArchiveEntry](
"tar.bz2",
(fos) => createTarArchiveOutputStream(new BZip2CompressorOutputStream(fos)),
createTarEntry
).value
),
Def.derive(
packArchiveTxz := createArchive(
packArchiveTxz := createArchive[TarArchiveEntry](
"tar.xz",
(fos) => createTarArchiveOutputStream(new XZCompressorOutputStream(fos)),
createTarEntry
).value
),
Def.derive(packArchiveZip := createArchive("zip", new ZipArchiveOutputStream(_), createZipEntry).value),
Def.derive(packArchive := Seq(packArchiveTgz.value, packArchiveZip.value))
Def.derive(
packArchiveZip := createArchive[ZipArchiveEntry]("zip", new ZipArchiveOutputStream(_), createZipEntry).value
),
Def.derive(packArchive := Seq(packArchiveTgz.value, packArchiveZip.value))
)

def publishPackArchiveTgz: SettingsDefinition =
6 changes: 3 additions & 3 deletions src/main/scala/xerial/sbt/pack/PackPlugin.scala
Original file line number Diff line number Diff line change
@@ -144,14 +144,14 @@ object PackPlugin extends AutoPlugin with PackArchive {
packGenerateMakefile := true,
packMainDiscovered := Def.taskDyn {
val mainClasses =
getFromSelectedProjects(thisProjectRef.value, discoveredMainClasses in Compile, state.value, packExclude.value)
getFromSelectedProjects(thisProjectRef.value, Compile / discoveredMainClasses, state.value, packExclude.value)
Def.task {
mainClasses.value.flatMap(_._1.map(mainClass => hyphenize(mainClass.split('.').last) -> mainClass).toMap).toMap
}
}.value,
packAllUnmanagedJars := Def.taskDyn {
val allUnmanagedJars =
getFromSelectedProjects(thisProjectRef.value, unmanagedJars in Runtime, state.value, packExclude.value)
getFromSelectedProjects(thisProjectRef.value, Runtime / unmanagedJars, state.value, packExclude.value)
Def.task { allUnmanagedJars.value }
}.value,
Def.derive(
@@ -513,7 +513,7 @@ object PackPlugin extends AutoPlugin with PackArchive {
(currentProject +: (children flatMap transitiveDependencies)) filterNot (isExcluded)
}
val projects: Seq[ProjectRef] = transitiveDependencies(contextProject).distinct
projects.map(p => (Def.task { ((targetTask in p).value, p) }) evaluate structure.data).join
projects.map(p => (Def.task { ((p / targetTask).value, p) }) evaluate structure.data).join
}

private val humanReadableTimestampFormatter = new DateTimeFormatterBuilder()
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-pack/archive-modules/build.sbt
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ import xerial.sbt.pack.PackPlugin._

val commonSettings = Defaults.coreDefaultSettings ++
Seq(
scalaVersion := "2.12.18",
scalaVersion := "2.12.19",
version := "0.1",
crossPaths := false
)
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-pack/build-sbt/build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
enablePlugins(PackPlugin)

scalaVersion := "2.12.18"
scalaVersion := "2.12.19"

packExtraClasspath := Map("hello" -> Seq("${PROG_HOME}/extra"))
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-pack/convention-full/build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
enablePlugins(PackPlugin)

scalaVersion := "2.12.18"
scalaVersion := "2.12.19"

libraryDependencies := Seq("org.xerial" % "xerial-core" % "3.3.6")

2 changes: 1 addition & 1 deletion src/sbt-test/sbt-pack/convention-noversion/build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
enablePlugins(PackPlugin)

scalaVersion := "2.12.18"
scalaVersion := "2.12.19"

libraryDependencies := Seq("org.xerial" % "xerial-core" % "3.3.6")

4 changes: 2 additions & 2 deletions src/sbt-test/sbt-pack/copy-dependencies/build.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ThisBuild / scalaVersion := "2.12.18"
ThisBuild / scalaVersion := "2.12.19"

val commonSettings = Seq(
scalaVersion := "2.12.18",
scalaVersion := "2.12.19",
version := "0.1",
crossPaths := false,
packCopyDependenciesTarget := target.value / "WEB-INF/lib"
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-pack/duplicate-jars/build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ThisBuild / scalaVersion := "2.12.18"
ThisBuild / scalaVersion := "2.12.19"
val commonSettings = Defaults.coreDefaultSettings ++ Seq(
version := "0.1",
crossPaths := false
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-pack/env-vars/build.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
enablePlugins(PackPlugin)
name := "env-vars"

scalaVersion := "2.12.18"
scalaVersion := "2.12.19"
// custom settings here
crossPaths := false

2 changes: 1 addition & 1 deletion src/sbt-test/sbt-pack/exclude-jars/build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
enablePlugins(PackPlugin)
version := "0.1"
scalaVersion := "2.12.18"
scalaVersion := "2.12.19"
crossPaths := false
name := "exclude-jars"
libraryDependencies ++= Seq(
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-pack/exclude-makefile/build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
enablePlugins(PackPlugin)
scalaVersion := "2.12.18"
scalaVersion := "2.12.19"
crossPaths := false
name := "exclude-makefile"
version := "0.1"
4 changes: 2 additions & 2 deletions src/sbt-test/sbt-pack/exclude-test-config/build.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ThisBuild / scalaVersion := "2.12.18"
ThisBuild / scalaVersion := "2.12.19"

val commonSettings = Seq(
scalaVersion := "2.12.18",
scalaVersion := "2.12.19",
version := "0.1",
crossPaths := false
)
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-pack/min-project/build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
enablePlugins(PackPlugin)
name := "min-project"

scalaVersion := "2.12.18"
scalaVersion := "2.12.19"
// custom settings here
crossPaths := false
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-pack/multi-module/build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
val commonSettings = Defaults.coreDefaultSettings ++ Seq(
scalaVersion := "2.12.18",
scalaVersion := "2.12.19",
version := "0.1",
crossPaths := false
)
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-pack/nested-project/build.sbt
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ name := "nested"

ThisBuild / version := "0.1"

ThisBuild / scalaVersion := "2.12.18"
ThisBuild / scalaVersion := "2.12.19"

enablePlugins(PackPlugin)

2 changes: 1 addition & 1 deletion src/sbt-test/sbt-pack/pack-resources/build.sbt
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ lazy val root = Project(
base = file(".")
).enablePlugins(PackPlugin)
.settings(
scalaVersion := "2.12.18",
scalaVersion := "2.12.19",
// Copy files from ${root}/web/... to ${root}/target/pack/web-content...
packResourceDir += (baseDirectory.value / "web" -> "web-content"),
// custom settings here
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-pack/space in path/build.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
enablePlugins(PackPlugin)

scalaVersion := "2.12.18"
scalaVersion := "2.12.19"