Skip to content

Commit be6876b

Browse files
author
JeanMarc van Leerdam
committed
Update scala/sbt/dependency versions to make the project build and to pass the tests.
1 parent 746e068 commit be6876b

File tree

13 files changed

+31
-27
lines changed

13 files changed

+31
-27
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Experimental plugin for sbt to create Azure Function artefacts (function.json) n
1111

1212
in your `project/plugins.sbt` add sbt-assembly and sbt-azure-functions:
1313

14-
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.10")
14+
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.3.1")
1515
addSbtPlugin("nl.codestar" % "sbt-azure-functions" % "<latest version>")
1616

1717
in your `build.sbt` provide values for the assembly and azure-functions plugins:

build.sbt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ lazy val commonSettings = Seq(
88
Developer(
99
"jeanmarc",
1010
"Jean-Marc van Leerdam",
11-
"jean-marc.van.leerdam@ordina.nl",
12-
url("https://github.com/jeanmarc")
11+
"jean-marc.vanleerdam@soprasteria.com",
12+
url("https://soprasteria.com")
1313
)
1414
)
1515
)
1616

17-
lazy val root = (project in file("."))
17+
lazy val root = project.in(file("."))
1818
.aggregate(plugin)
1919
.settings(
2020
name := "sbt-azure-functions-plugin",
@@ -24,7 +24,7 @@ lazy val root = (project in file("."))
2424
publish := {}
2525
)
2626

27-
lazy val plugin = (project in file("plugin"))
27+
lazy val plugin = project.in(file("plugin"))
2828
.enablePlugins(SbtPlugin)
2929
.settings(
3030
name := "sbt-azure-functions",
@@ -48,14 +48,14 @@ lazy val plugin = (project in file("plugin"))
4848
"org.scalatest" %% "scalatest" % "3.2.2" % "test",
4949
"org.scala-sbt" %% "scripted-plugin" % sbtVersion.value
5050
),
51-
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.10"),
51+
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.3.1"),
5252
scriptedLaunchOpts := {
5353
scriptedLaunchOpts.value ++
5454
Seq("-Xmx1024M", "-Dplugin.version=" + version.value)
5555
},
5656
scriptedBufferLog := false,
57-
logBuffered in Test := false,
58-
publishArtifact in Test := false
57+
Test / logBuffered := false,
58+
Test / publishArtifact := false
5959
)
6060

6161
// workaround for interactive sessions that do not echo the user input (https://github.com/sbt/sbt-bintray/issues/177)

plugin/src/main/scala/sbtazurefunctions/CreateZipFileTask.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ object CreateZipFileTask {
1919

2020
val log = sbt.Keys.streams.value.log
2121

22-
val tgtFolder = (target in Compile).value
22+
val tgtFolder = (Compile / target).value
2323

2424
log.info("Running azfunCreateZipFile task...")
2525
log.info(
@@ -28,7 +28,7 @@ object CreateZipFileTask {
2828

2929
val src = azfunTargetFolder.value
3030
val tgt = tgtFolder / ensureExtension(azfunZipName.value, "zip")
31-
IO.zip(allSubpaths(src), tgt)
31+
IO.zip(allSubpaths(src), tgt, None)
3232
tgt
3333
}
3434
)

plugin/src/main/scala/sbtazurefunctions/DefaultSettings.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ object DefaultSettings {
1818
def settings: Seq[Setting[_]] =
1919
Seq(
2020
azfunAppInsightsName := azfunFunctionAppName.value,
21-
azfunHostJsonFile := (baseDirectory in Compile).value / "host.json",
21+
azfunHostJsonFile := (Compile / baseDirectory).value / "host.json",
2222
azfunJarName := "AzureFunction.jar",
23-
azfunLocalSettingsFile := (baseDirectory in Compile).value / "local.settings.json",
23+
azfunLocalSettingsFile := (Compile / baseDirectory).value / "local.settings.json",
2424
azfunSKU := "Standard_LRS",
25-
azfunTargetFolder := (target in Compile).value / stripExtension(azfunZipName.value),
25+
azfunTargetFolder := (Compile / target).value / stripExtension(azfunZipName.value),
2626
azfunZipName := "AzureFunction.zip"
2727
)
2828

plugin/src/sbt-test/sbt-azure-functions/deploy/build.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import sbt.Keys.libraryDependencies
33
lazy val root = (project in file("."))
44
.settings(
55
version := "0.1",
6-
scalaVersion := "2.12.7",
6+
scalaVersion := "2.12.18",
77
libraryDependencies ++= Seq(
88
"com.microsoft.azure.functions" % "azure-functions-java-library" % "1.3.1"
99
),
10-
assemblyJarName in assembly := "ScalaFunctions.jar",
10+
assembly / assemblyJarName := "ScalaFunctions.jar",
1111
azfunFunctionAppName := "rd-scala-functions",
1212
azfunLocation := "westeurope",
1313
azfunResourceGroup := "rg-rd-scala-functions",

plugin/src/sbt-test/sbt-azure-functions/deploy/project/plugins.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.10")
1+
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.3.1")
22

33
sys.props.get("plugin.version") match {
44
case Some(x) => addSbtPlugin("nl.codestar" % "sbt-azure-functions" % x)

plugin/src/sbt-test/sbt-azure-functions/simple/build.sbt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@ import sbt.Keys.libraryDependencies
33
lazy val root = (project in file("."))
44
.settings(
55
version := "0.1",
6-
scalaVersion := "2.12.7",
6+
scalaVersion := "2.12.18",
77
libraryDependencies ++= Seq(
88
"com.microsoft.azure.functions" % "azure-functions-java-library" % "1.3.1"
99
),
10-
assemblyJarName in assembly := "ScalaFunctions.jar"
10+
assembly / assemblyJarName := "ScalaFunctions.jar",
11+
azfunFunctionAppName := "rd-scala-functions",
12+
azfunLocation := "westeurope",
13+
azfunResourceGroup := "rg-rd-scala-functions",
14+
azfunStorageAccount := "a77a749630954151919e"
1115
)

plugin/src/sbt-test/sbt-azure-functions/simple/project/plugins.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.10")
1+
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.3.1")
22

33
sys.props.get("plugin.version") match {
44
case Some(x) => addSbtPlugin("nl.codestar" % "sbt-azure-functions" % x)

plugin/src/test/scala/nl/codestar/azurefunctions/FunctionConfigGeneratorTest.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ class FunctionConfigGeneratorTest extends AnyFlatSpec {
3030

3131
"An annotated function" should "be found" in {
3232
val result = FunctionConfigGenerator.getFunctions(List(getClassUrl))
33-
assert(result.isEmpty == false)
33+
assert(result.nonEmpty)
3434
}
3535

3636
"An annotated function" should "produce a configuration" in {
3737
val result = FunctionConfigGenerator.getConfigs(List(getClassUrl))
38-
assert(result.isEmpty == false)
38+
assert(result.nonEmpty)
3939
assert(result.get("ScalaFunction") != null)
40-
val config = result.get("ScalaFunction").get
40+
val config = result("ScalaFunction")
4141
assert(config.getEntryPoint == "nl.codestar.azurefunctions.FunctionConfigGeneratorTest.SampleAzureFunctions.run")
4242
assert(config.getScriptFile == null)
4343
val binding = config.getBindings.get(0)

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.3.12
1+
sbt.version=1.11.0

0 commit comments

Comments
 (0)