Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into forwarder-script2
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/mima-filters/1.3.15.backward.excludes
  • Loading branch information
Seetaramayya committed Apr 24, 2024
2 parents a7e2f5d + 0f69b0c commit b35bf6e
Show file tree
Hide file tree
Showing 83 changed files with 1,146 additions and 888 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/validate-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ jobs:
- name: Setup GraalVM environment
uses: olafurpg/setup-scala@v10
with:
java-version: graalvm@22.0.0=tgz+https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/graalvm-ce-java11-linux-amd64-22.0.0.2.tar.gz
java-version: graalvm@22.3.3=tgz+https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.3/graalvm-ce-java11-linux-amd64-22.3.3.tar.gz
- name: Install native-image
run: gu install native-image
- name: Validate
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ target/
.ensime*
.bloop/*
.metals/*
.bsp/
14 changes: 13 additions & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# Version https://scalameta.org/scalafmt/docs/configuration.html#version
version = 3.8.1
# Dialect https://scalameta.org/scalafmt/docs/configuration.html#scala-dialects
runner.dialect = scala212

style = IntelliJ
maxColumn = 120
rewrite.rules = [SortImports, RedundantBraces]
rewrite.rules = [SortImports, RedundantBraces]
docstrings.blankFirstLine = yes

project.excludePaths = [
# [error] (Compile / scalafmt) org.scalafmt.sbt.ScalafmtSbtReporter$ScalafmtSbtError: scalafmt:
# WixHelper.scala:105: error: Unable to format file due to bug in scalafmt
"glob:**/src/main/scala/com/typesafe/sbt/packager/windows/WixHelper.scala"
]
16 changes: 8 additions & 8 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ organization := "com.github.sbt"
homepage := Some(url("https://github.com/sbt/sbt-native-packager"))

Global / onChangedBuildSource := ReloadOnSourceChanges
Global / scalaVersion := "2.12.12"
Global / scalaVersion := "2.12.19"

// crossBuildingSettings
crossSbtVersions := Vector("1.1.6")
Expand All @@ -15,21 +15,21 @@ 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.3" % Provided,
"org.vafer" % "jdeb" % "1.7" % Provided artifacts Artifact("jdeb", "jar", "jar"),
"org.apache.commons" % "commons-compress" % "1.21",
"com.spotify" % "docker-client" % "8.14.5" % Provided,
"org.vafer" % "jdeb" % "1.10" % Provided artifacts Artifact("jdeb", "jar", "jar"),
"org.apache.commons" % "commons-compress" % "1.26.1",
// for jdkpackager
"org.apache.ant" % "ant" % "1.10.12",
"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.5" % Test
"org.scalatest" %% "scalatest" % "3.0.9" % Test
)

// sbt dependent libraries
libraryDependencies ++= {
(pluginCrossBuild / sbtVersion).value match {
case v if v.startsWith("1.") =>
Seq("org.scala-sbt" %% "io" % "1.2.2")
Seq("org.scala-sbt" %% "io" % "1.9.9")
case _ => Seq()
}
}
Expand All @@ -45,7 +45,7 @@ libraryDependencies ++= {
// like the 2.12.x Scala compiler, otherwise we run into conflicts when using sbt 1.5+
// See https://github.com/scala/scala/pull/9743
"org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.2", // Do not upgrade beyond 1.x
"org.scala-lang.modules" %% "scala-xml" % "2.1.0"
"org.scala-lang.modules" %% "scala-xml" % "2.2.0"
)
}
}
Expand Down
2 changes: 0 additions & 2 deletions integration-tests-ansible/test-project-play-rpm/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ scalacOptions in ThisBuild ++= Seq(
"-Xlint"
)

resolvers in ThisBuild += Resolver.typesafeRepo("releases")

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

description := "Demo of RPM packaging"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.8
sbt.version=1.9.9
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
resolvers += Resolver.typesafeRepo("releases")

libraryDependencies <+= Def.setting[ModuleID] {
Defaults
.sbtPluginExtra(
Expand Down
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.9.9
12 changes: 6 additions & 6 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.3")
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.4.0")
addSbtPlugin("com.github.sbt" % "sbt-ghpages" % "0.8.0")
addSbtPlugin("com.github.sbt" % "sbt-site-sphinx" % "1.7.0")

// releasing
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")

libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value

// Scripted plugin needs to declare this as a dependency
libraryDependencies += "jline" % "jline" % "2.11"
libraryDependencies += "jline" % "jline" % "2.14.6"

// For code formatting
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")

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

// for enterprise Artifactory compatibility
addSbtPlugin("com.scalawilliam.esbeetee" % "sbt-vspp" % "0.4.11")
3 changes: 3 additions & 0 deletions src/main/mima-filters/1.3.15.backward.excludes
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ ProblemFilters.exclude[ReversedMissingMethodProblem]("com.typesafe.sbt.packager.
ProblemFilters.exclude[ReversedMissingMethodProblem]("com.typesafe.sbt.packager.linux.LinuxKeys.daemonHome")
ProblemFilters.exclude[DirectMissingMethodProblem]("com.typesafe.sbt.packager.linux.LinuxPlugin.makeReplacements")

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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ realpath () {
)
}

# ash-template is not designed to be used with Cygwin
is_cygwin() {
return 1
}

# Allow user and template_declares (see below) to add java options.
addJava () {
java_opts="$java_opts $1"
Expand All @@ -38,8 +43,12 @@ addApp () {
app_commands="$app_commands $1"
}

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

addResidual () {
residual_args="$residual_args \"$1\""
residual_args="$residual_args $(shellEscape "$1")"
}

# Allow user to specify java options. These get listed first per bash-template.
Expand Down Expand Up @@ -85,7 +94,7 @@ process_args () {
-java-home) require_arg path "$1" "$2" && jre=`eval echo $2` && java_cmd="$jre/bin/java" && shift 2 ;;

-D*|-agentlib*|-agentpath*|-javaagent*|-XX*) addJava "$1" && shift ;;
-J*) addJava "${1:2}" && shift ;;
-J*) addJava "$(printf %s "$1" | sed s/^..//)" && shift ;;
*) addResidual "$1" && shift ;;
esac
done
Expand Down Expand Up @@ -124,4 +133,5 @@ java_cmd="$(get_java_cmd)"
# If a configuration file exist, read the contents to $opts
[ -f "$script_conf_file" ] && opts=$(loadConfigFile "$script_conf_file")

eval "exec $java_cmd $java_opts -classpath $app_classpath $opts $app_mainclass $app_commands $residual_args"
eval "set -- $residual_args"
exec $java_cmd $java_opts -classpath $app_classpath $opts $app_mainclass $app_commands "$@"
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ if defined BUNDLED_JVM (

if "%_JAVACMD%"=="" set _JAVACMD=java

rem if configuration files exist, prepend their contents to the script arguments so it can be processed by this runner
call :parse_config "%SCRIPT_CONF_FILE%" SCRIPT_CONF_ARGS

call :process_args %SCRIPT_CONF_ARGS% %%*

rem Detect if this java is ok to use.
for /F %%j in ('"%_JAVACMD%" -version 2^>^&1') do (
if %%~j==java set JAVAINSTALLED=1
Expand Down Expand Up @@ -86,11 +91,6 @@ if "%JAVAOK%"=="false" (
exit /B 1
)

rem if configuration files exist, prepend their contents to the script arguments so it can be processed by this runner
call :parse_config "%SCRIPT_CONF_FILE%" SCRIPT_CONF_ARGS

call :process_args %SCRIPT_CONF_ARGS% %%*

set _JAVA_OPTS=!_JAVA_OPTS! !_JAVA_PARAMS!

if defined CUSTOM_MAIN_CLASS (
Expand Down Expand Up @@ -135,23 +135,36 @@ exit /B 0
rem Processes incoming arguments and places them in appropriate global variables
:process_args
:param_loop
call set _PARAM1=%%1
set "_TEST_PARAM=%~1"
shift
call set _PARAM1=%%0
set "_TEST_PARAM=%~0"

if ["!_PARAM1!"]==[""] goto param_afterloop

if "!_TEST_PARAM!"=="-main" (
call set CUSTOM_MAIN_CLASS=%%1
shift
goto param_loop
)

rem ignore arguments that do not start with '-'
if "%_TEST_PARAM:~0,1%"=="-" goto param_java_check
set _APP_ARGS=!_APP_ARGS! !_PARAM1!
shift
goto param_loop
if "!_TEST_PARAM!"=="-java-home" (
set "JAVA_HOME=%~1"
set "_JAVACMD=%~1\bin\java.exe"
shift
goto param_loop
)

:param_java_check
if "!_TEST_PARAM:~0,2!"=="-J" (
rem strip -J prefix
set _JAVA_PARAMS=!_JAVA_PARAMS! !_TEST_PARAM:~2!
shift
call set _TEST_PARAM=!_TEST_PARAM:~2!
if not "!_TEST_PARAM:~0,5!" == "-XX:+" if not "!_TEST_PARAM:~0,5!" == "-XX:-" if "!_TEST_PARAM:~0,3!" == "-XX" (
rem special handling for -J-XX since '=' gets parsed away
for /F "delims== tokens=1,*" %%G in ("!_TEST_PARAM!") DO (
call set _TEST_PARAM=!_TEST_PARAM!=%%1
shift
)
)
set _JAVA_PARAMS=!_JAVA_PARAMS! !_TEST_PARAM!
goto param_loop
)

Expand All @@ -160,22 +173,18 @@ rem Processes incoming arguments and places them in appropriate global variables
for /F "delims== tokens=1,*" %%G in ("!_TEST_PARAM!") DO (
if not ["%%H"] == [""] (
set _JAVA_PARAMS=!_JAVA_PARAMS! !_PARAM1!
) else if [%2] neq [] (
) else if [%1] neq [] (
rem it was a normal property: -Dprop=42 or -Drop="42"
call set _PARAM1=%%1=%%2
call set _PARAM1=%%0=%%1
set _JAVA_PARAMS=!_JAVA_PARAMS! !_PARAM1!
shift
)
)
) else (
if "!_TEST_PARAM!"=="-main" (
call set CUSTOM_MAIN_CLASS=%%2
shift
) else (
set _APP_ARGS=!_APP_ARGS! !_PARAM1!
)
goto param_loop
)
shift

set _APP_ARGS=!_APP_ARGS! !_PARAM1!

goto param_loop
:param_afterloop

Expand Down
13 changes: 7 additions & 6 deletions src/main/scala-sbt-1.0/com/typesafe/sbt/packager/Compat.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.typesafe.sbt.packager

import sbt.{PathFinder, librarymanagement => lm}
import sbt.{librarymanagement => lm, PathFinder}
import sbt.internal.{librarymanagement => ilm, BuildDependencies => InternalBuildDependencies}
import sbt.util.CacheStore

Expand All @@ -14,7 +14,7 @@ object Compat {

/**
* Used in
* - [[com.typesafe.sbt.packager.archetypes.JavaAppPackaging]]
* - [[com.typesafe.sbt.packager.archetypes.JavaAppPackaging]]
*/
type BuildDependencies = InternalBuildDependencies

Expand All @@ -24,15 +24,16 @@ object Compat {

/**
* Used in
* - [[com.typesafe.sbt.packager.docker.DockerPlugin]]
* - [[com.typesafe.sbt.packager.docker.DockerPlugin]]
*/
type ProcessLogger = sys.process.ProcessLogger

/**
* Used in
* - [[com.typesafe.sbt.packager.Stager]]
* Used in
* - [[com.typesafe.sbt.packager.Stager]]
* @param file
* @return a CacheStore
* @return
* a CacheStore
*/
implicit def fileToCacheStore(file: java.io.File): CacheStore = CacheStore(file)
}
Loading

0 comments on commit b35bf6e

Please sign in to comment.