Skip to content

Commit

Permalink
Merge branch 'master' into update/io-1.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
muuki88 authored Aug 15, 2024
2 parents 25d6a03 + f487740 commit 88a3b71
Show file tree
Hide file tree
Showing 97 changed files with 517 additions and 328 deletions.
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Scala Steward: Reformat with scalafmt 3.8.3
fb3b1e158c70f5b76207764dc42b128cb878b3be
31 changes: 31 additions & 0 deletions .github/workflows/publish-site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish Site
on:
push:
tags: ["*"]
jobs:
publish:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

# setup build environment
- uses: coursier/cache-action@v5
- uses: olafurpg/setup-scala@v12

# this setup is all for the github pages deployment to work
- name: install sphinx
run: |
pip3 install --user sphinx sphinx_rtd_theme
which sphinx-build
- name: setup git
run: |
git config --global user.name github-actions
git config --global user.email github-actions@github.com
- name: Publish Site
run: sbt ghpagesPushSite
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 0 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,6 @@ jobs:
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

# this setup is all for the github pages deployment to work
- name: install sphinx
run: |
pip3 install --user sphinx sphinx_rtd_theme
which sphinx-build
- name: setup git
run: |
git config user.name github-actions
git config user.email github-actions@github.com
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
- run: sbt ghpagesPushSite

# generate a github release
- name: Generate release changelog
id: changelog
Expand Down
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Version https://scalameta.org/scalafmt/docs/configuration.html#version
version = 3.8.1
version = 3.8.3
# Dialect https://scalameta.org/scalafmt/docs/configuration.html#scala-dialects
runner.dialect = scala212

Expand Down
13 changes: 9 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ javacOptions ++= Seq("-source", "1.8", "-target", "1.8")
classpathTypes += "maven-plugin"
libraryDependencies ++= Seq(
// these dependencies have to be explicitly added by the user
"com.spotify" % "docker-client" % "8.14.5" % Provided,
"com.spotify" % "docker-client" % "8.16.0" % Provided,
"org.vafer" % "jdeb" % "1.10" % Provided artifacts Artifact("jdeb", "jar", "jar"),
"org.apache.commons" % "commons-compress" % "1.26.1",
"org.apache.commons" % "commons-compress" % "1.26.2",
// for jdkpackager
"org.apache.ant" % "ant" % "1.10.14",
// workaround for the command line size limit
"com.github.eldis" % "tool-launcher" % "0.2.2",
"org.scalatest" %% "scalatest" % "3.0.9" % Test
"org.scalatest" %% "scalatest" % "3.2.19" % Test
)

// sbt dependent libraries
Expand Down Expand Up @@ -53,7 +53,12 @@ libraryDependencies ++= {
// configure github page
enablePlugins(SphinxPlugin, SiteScaladocPlugin, GhpagesPlugin, SbtPlugin)

git.remoteRepo := "git@github.com:sbt/sbt-native-packager.git"
git.remoteRepo := {
sys.env.get("GITHUB_TOKEN") match {
case Some(token) => s"https://x-access-token:$token@github.com/sbt/sbt-native-packager"
case None => "git@github.com:sbt/sbt-native-packager.git"
}
}

// scripted test settings
scriptedLaunchOpts += "-Dproject.version=" + version.value
Expand Down
10 changes: 1 addition & 9 deletions integration-tests-ansible/test-project-play-rpm/build.sbt
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
scalaVersion in ThisBuild := "2.11.6"

scalacOptions in ThisBuild ++= Seq(
"-deprecation",
"-encoding",
"UTF-8",
"-feature",
"-unchecked",
"-Xfuture",
"-Xlint"
)
scalacOptions in ThisBuild ++= Seq("-deprecation", "-encoding", "UTF-8", "-feature", "-unchecked", "-Xfuture", "-Xlint")

name := "test-project-play-rpm"

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.9
sbt.version=1.10.1
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.9
sbt.version=1.10.1
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ libraryDependencies += "jline" % "jline" % "2.14.6"
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")

// binary compatibility checks
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.3")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.4")

// for enterprise Artifactory compatibility
addSbtPlugin("com.scalawilliam.esbeetee" % "sbt-vspp" % "0.4.11")
11 changes: 11 additions & 0 deletions src/main/mima-filters/1.3.15.backward.excludes
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,14 @@ ProblemFilters.exclude[DirectMissingMethodProblem]("com.typesafe.sbt.packager.li

ProblemFilters.exclude[ReversedMissingMethodProblem]("com.typesafe.sbt.packager.docker.DockerKeys.dockerBuildEnvVars")
ProblemFilters.exclude[ReversedMissingMethodProblem]("com.typesafe.sbt.packager.docker.DockerKeys.com$typesafe$sbt$packager$docker$DockerKeys$_setter_$dockerBuildEnvVars_=")

# added via #1557
ProblemFilters.exclude[ReversedMissingMethodProblem]("com.typesafe.sbt.packager.archetypes.scripts.BashStartScriptKeys.com$typesafe$sbt$packager$archetypes$scripts$BashStartScriptKeys$_setter_$bashForwarderTemplateLocation_=")
ProblemFilters.exclude[ReversedMissingMethodProblem]("com.typesafe.sbt.packager.archetypes.scripts.BashStartScriptKeys.bashForwarderTemplateLocation")
ProblemFilters.exclude[DirectMissingMethodProblem]("com.typesafe.sbt.packager.archetypes.scripts.BashStartScriptPlugin#BashScriptConfig.copy")
ProblemFilters.exclude[DirectMissingMethodProblem]("com.typesafe.sbt.packager.archetypes.scripts.BashStartScriptPlugin#BashScriptConfig.this")
ProblemFilters.exclude[MissingTypesProblem]("com.typesafe.sbt.packager.archetypes.scripts.BashStartScriptPlugin$BashScriptConfig$")
ProblemFilters.exclude[DirectMissingMethodProblem]("com.typesafe.sbt.packager.archetypes.scripts.BashStartScriptPlugin#BashScriptConfig.apply")
ProblemFilters.exclude[ReversedMissingMethodProblem]("com.typesafe.sbt.packager.archetypes.scripts.BatStartScriptKeys.com$typesafe$sbt$packager$archetypes$scripts$BatStartScriptKeys$_setter_$batForwarderTemplateLocation_=")
ProblemFilters.exclude[ReversedMissingMethodProblem]("com.typesafe.sbt.packager.archetypes.scripts.BatStartScriptKeys.batForwarderTemplateLocation")
ProblemFilters.exclude[ReversedMissingMethodProblem]("com.typesafe.sbt.packager.archetypes.scripts.CommonStartScriptGenerator#ScriptConfig.forwarderTemplateLocation")
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/bin/sh

# Absolute path to this script
# macOS doesn't support "readlink -f"
realpath () {
TARGET_FILE="$1"
CHECK_CYGWIN="$2"

cd "$(dirname "$TARGET_FILE")"
TARGET_FILE=$(basename "$TARGET_FILE")

COUNT=0
while [ -L "$TARGET_FILE" -a $COUNT -lt 100 ]
do
TARGET_FILE=$(readlink "$TARGET_FILE")
cd "$(dirname "$TARGET_FILE")"
TARGET_FILE=$(basename "$TARGET_FILE")
COUNT=$(($COUNT + 1))
done

if [ "$TARGET_FILE" == "." -o "$TARGET_FILE" == ".." ]; then
cd "$TARGET_FILE"
TARGET_FILEPATH=
else
TARGET_FILEPATH=/$TARGET_FILE
fi

# make sure we grab the actual windows path, instead of cygwin's path.
if [[ "x$CHECK_CYGWIN" == "x" ]]; then
echo "$(pwd -P)/$TARGET_FILE"
else
echo $(cygwinpath "$(pwd -P)/$TARGET_FILE")
fi
}

# Uses uname to detect if we're in the odd cygwin environment.
is_cygwin() {
local os=$(uname -s)
case "$os" in
CYGWIN*) return 0 ;;
*) return 1 ;;
esac
}

# This can fix cygwin style /cygdrive paths so we get the
# windows style paths.
cygwinpath() {
local file="$1"
if is_cygwin; then
echo $(cygpath -w $file)
else
echo $file
fi
}

# get the absolute path for the current script
SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")

# execute the main start script
$SCRIPTPATH/${{startScript}} -main ${{qualifiedClassName}} "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ addApp () {
}

shellEscape () {
printf "'%s'" "$(printf %s "$1" | sed "s/'/'\\\\''/")"
printf "'%s'" "$(printf %s "$1" | sed "s/'/'\\\\''/g")"
}

addResidual () {
Expand Down
24 changes: 14 additions & 10 deletions src/main/scala-sbt-0.13/com/typesafe/sbt/packager/Compat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ object Compat {
/**
* Used in:
*
* - [[com.typesafe.sbt.packager.windows.WindowsPlugin]]
* - [[com.typesafe.sbt.packager.rpm.RpmHelper]]
* - [[com.typesafe.sbt.packager.docker.DockerPlugin]]
* - [[com.typesafe.sbt.packager.debian.DebianNativePackaging]]
* - [[com.typesafe.sbt.packager.rpm.RpmPlugin]]
* - [[com.typesafe.sbt.packager.windows.WindowsPlugin]]
* - [[com.typesafe.sbt.packager.rpm.RpmHelper]]
* - [[com.typesafe.sbt.packager.docker.DockerPlugin]]
* - [[com.typesafe.sbt.packager.debian.DebianNativePackaging]]
* - [[com.typesafe.sbt.packager.rpm.RpmPlugin]]
*
* @param log
* @return turns a Logger into a ProcessLogger
* @return
* turns a Logger into a ProcessLogger
*/
implicit def log2ProcessLogger(log: Logger): sys.process.ProcessLogger =
new BufferedLogger(new FullLogger(log)) with sys.process.ProcessLogger {
Expand All @@ -27,17 +28,20 @@ object Compat {
/**
* Used in
*
* - [[com.typesafe.sbt.packager.docker.DockerPlugin]]
* - [[com.typesafe.sbt.packager.docker.DockerPlugin]]
*
* @param logger The sbt.ProcessLogger that should be wrapped
* @return A scala ProcessLogger
* @param logger
* The sbt.ProcessLogger that should be wrapped
* @return
* A scala ProcessLogger
*/
implicit def sbtProcessLogger2ScalaProcessLogger(logger: sbt.ProcessLogger): sys.process.ProcessLogger =
ProcessLogger(msg => logger.info(msg), err => logger.error(err))

/**
* Use in the scripted `universal/multiproject-classifiers` test.
* @param artifact polyfill new methods
* @param artifact
* polyfill new methods
*/
implicit class CompatArtifact(artifact: Artifact) {
def withClassifier(classifier: Option[String]): Artifact =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ object MappingsHelper {
* return a Seq of mappings which effect is to add a whole directory in the generated package
*
* @example
* {{{
* {{{
* mappings in Universal ++= directory(baseDirectory.value / "extra")
* }}}
* }}}
*
* @param sourceDir
* @return mappings
* @return
* mappings
*/
def directory(sourceDir: File): Seq[(File, String)] =
Option(sourceDir.getParentFile)
Expand All @@ -25,27 +26,29 @@ object MappingsHelper {
* It lightens the build file if one wants to give a string instead of file.
*
* @example
* {{{
* {{{
* mappings in Universal ++= directory("extra")
* }}}
* }}}
*
* @param sourceDir
* @return mappings
* @return
* mappings
*/
def directory(sourceDir: String): Seq[(File, String)] =
directory(file(sourceDir))

/**
* return a Seq of mappings which effect is to add the content of directory in the generated package,
* excluding the directory itself.
* return a Seq of mappings which effect is to add the content of directory in the generated package, excluding the
* directory itself.
*
* @example
* {{{
* {{{
* mappings in Universal ++= sourceDir(baseDirectory.value / "extra")
* }}}
* }}}
*
* @param sourceDir
* @return mappings
* @return
* mappings
*/
def contentOf(sourceDir: File): Seq[(File, String)] =
(sourceDir.*** --- sourceDir) pair relativeTo(sourceDir)
Expand All @@ -54,50 +57,57 @@ object MappingsHelper {
* It lightens the build file if one wants to give a string instead of file.
*
* @example
* {{{
* {{{
* mappings in Universal ++= sourceDir("extra")
* }}}
* }}}
*
* @param sourceDir as string representation
* @return mappings
* @param sourceDir
* as string representation
* @return
* mappings
*/
def contentOf(sourceDir: String): Seq[(File, String)] =
contentOf(file(sourceDir))

/**
* Create mappings from your classpath. For example if you want to add additional
* dependencies, like test or model.
* Create mappings from your classpath. For example if you want to add additional dependencies, like test or model.
*
* @example Add all test artifacts to a separated test folder
* {{{
* @example
* Add all test artifacts to a separated test folder
* {{{
* mappings in Universal ++= fromClasspath((managedClasspath in Test).value, target = "test")
* }}}
* }}}
*
* @param entries
* @param target
* @return a list of mappings
* @return
* a list of mappings
*/
def fromClasspath(entries: Seq[Attributed[File]], target: String): Seq[(File, String)] =
fromClasspath(entries, target, _ => true)

/**
* Create mappings from your classpath. For example if you want to add additional
* dependencies, like test or model. You can also filter the artifacts that should
* be mapped to mappings.
* Create mappings from your classpath. For example if you want to add additional dependencies, like test or model.
* You can also filter the artifacts that should be mapped to mappings.
*
* @example Filter all osgi bundles
* {{{
* @example
* Filter all osgi bundles
* {{{
* mappings in Universal ++= fromClasspath(
* (managedClasspath in Runtime).value,
* "osgi",
* artifact => artifact.`type` == "bundle"
* )
* }}}
* }}}
*
* @param entries from where mappings should be created from
* @param target folder, e.g. `model`. Must not end with a slash
* @param includeArtifact function to determine if an artifact should result in a mapping
* @param includeOnNoArtifact default is false. When there's no Artifact meta data remove it
* @param entries
* from where mappings should be created from
* @param target
* folder, e.g. `model`. Must not end with a slash
* @param includeArtifact
* function to determine if an artifact should result in a mapping
* @param includeOnNoArtifact
* default is false. When there's no Artifact meta data remove it
*/
def fromClasspath(
entries: Seq[Attributed[File]],
Expand Down
Loading

0 comments on commit 88a3b71

Please sign in to comment.