diff --git a/.circleci/config.yml b/.circleci/config.yml index 1c17e23c..ba3f9edc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -54,7 +54,7 @@ commands: parameters: version: type: string - default: "1.4.9" + default: "1.7.2" steps: - install-java-11 - run: @@ -84,7 +84,7 @@ commands: parameters: version: type: string - default: "1.4.9" + default: "1.7.2" steps: - install-java-11-win - run: @@ -99,20 +99,28 @@ commands: curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install-latest.sh | bash save_deps_cache: - description: "Save dependency cache" + description: "Save sbt caches" steps: - save_cache: - key: deps-cache-01 + key: sbt-cache-v3-{{ checksum "codegen/project/build.properties" }}- paths: - - "~/.ivy2/cache" - "~/.sbt" + - save_cache: + key: sbt-dependencies-v1-{{ checksum "codegen/build.sbt" }}- + paths: + - "~/.ivy2/cache" - "~/.cache/coursier" restore_deps_cache: - description: "Restore dependency cache" + description: "Restore sbt caches" steps: - restore_cache: - key: deps-cache-01 + # https://circleci.com/docs/caching#restoring-cache + keys: + # new cache if sbt version changed + - sbt-cache-v3-{{ checksum "codegen/project/build.properties" }}- + - restore_cache: + key: sbt-dependencies-v1-{{ checksum "codegen/build.sbt" }}- publish_to_cloudsmith: parameters: diff --git a/codegen/build.sbt b/codegen/build.sbt index 87ef8409..d908c2d8 100644 --- a/codegen/build.sbt +++ b/codegen/build.sbt @@ -1,12 +1,8 @@ -// ***************************************************************************** -// Projects -// ***************************************************************************** - lazy val `kalix-codegen` = project .in(file(".")) .enablePlugins(AutomateHeaderPlugin) - .settings(commonSettings ++ Seq(skip in publish := true)) + .settings(commonSettings ++ Seq(publish / skip := true)) .aggregate(`kalix-codegen-core`, `kalix-codegen-js`, `kalix-codegen-js-cli`) lazy val `kalix-codegen-core` = @@ -48,7 +44,7 @@ lazy val `kalix-codegen-js-cli` = .settings( buildInfoKeys := Seq[BuildInfoKey](version), buildInfoPackage := "io.kalix.codegen.js", - name in NativeImage := "kalix-codegen-js", + NativeImage / name := "kalix-codegen-js", nativeImageVersion := "22.1.0", /** * Due to limitations of the Windows command prompt/PowerShell, with a the native-image command fails with a long @@ -57,7 +53,7 @@ lazy val `kalix-codegen-js-cli` = * * This has been raised as an issue against the plugin: https://github.com/scalameta/sbt-native-image/issues/26 */ - fullClasspath in Compile := Seq(Attributed(assembly.value)(AttributeMap.empty)), + Compile / fullClasspath := Seq(Attributed(assembly.value)(AttributeMap.empty)), cachedNativeImage := Def.taskDyn { import sbt.util.CacheImplicits._ @@ -79,10 +75,10 @@ lazy val `kalix-codegen-js-cli` = nativeImageAgentMerge := true, nativeImageOptions ++= Seq( "--no-fallback", - "-H:JNIConfigurationFiles=" + (resourceDirectory in Compile).value / "jni-config.json", - "-H:DynamicProxyConfigurationFiles=" + (resourceDirectory in Compile).value / "proxy-config.json", - "-H:ReflectionConfigurationFiles=" + (resourceDirectory in Compile).value / "reflect-config.json", - "-H:ResourceConfigurationFiles=" + (resourceDirectory in Compile).value / "resource-config.json"), + "-H:JNIConfigurationFiles=" + (Compile / resourceDirectory).value / "jni-config.json", + "-H:DynamicProxyConfigurationFiles=" + (Compile / resourceDirectory).value / "proxy-config.json", + "-H:ReflectionConfigurationFiles=" + (Compile / resourceDirectory).value / "reflect-config.json", + "-H:ResourceConfigurationFiles=" + (Compile / resourceDirectory).value / "resource-config.json"), libraryDependencies ++= Seq( library.scopt, library.munit % "it,test", @@ -91,8 +87,8 @@ lazy val `kalix-codegen-js-cli` = library.requests % "it", library.testcontainers % "it", library.typesafeConfig % "it"), - testOptions in IntegrationTest += Tests.Argument(s"-Djs-codegen-cli.native-image=${cachedNativeImage.value}"), - skip in publish := true) + IntegrationTest / testOptions += Tests.Argument(s"-Djs-codegen-cli.native-image=${cachedNativeImage.value}"), + publish / skip := true) .dependsOn(`kalix-codegen-js`) // ***************************************************************************** @@ -155,7 +151,7 @@ lazy val commonSettings = sys.env.getOrElse("CLOUDSMITH_USER", ""), sys.env.getOrElse("CLOUDSMITH_PASS", "")), // Assembly - assemblyMergeStrategy in assembly := { + assembly / assemblyMergeStrategy := { case s if s.endsWith(".proto") => MergeStrategy.first case "module-info.class" => MergeStrategy.discard diff --git a/codegen/project/build.properties b/codegen/project/build.properties index ddffd371..1cfbe550 100644 --- a/codegen/project/build.properties +++ b/codegen/project/build.properties @@ -1 +1 @@ -sbt.version = 1.4.9 +sbt.version = 1.7.2 diff --git a/codegen/project/plugins.sbt b/codegen/project/plugins.sbt index b82634b8..9c5e45eb 100644 --- a/codegen/project/plugins.sbt +++ b/codegen/project/plugins.sbt @@ -1,11 +1,11 @@ addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1") -addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0") +addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.7.0") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.5") addSbtPlugin("org.wartremover" % "sbt-wartremover" % "2.4.13") addSbtPlugin("org.scalameta" % "sbt-native-image" % "0.3.0") -addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0") +addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0") addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.15.0") addSbtPlugin("com.thesamet" % "sbt-protoc" % "1.0.6") -libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.11.10" +libraryDependencies += "com.thesamet.scalapb" %% "compilerplugin" % "0.11.11"