Skip to content

Commit

Permalink
sbt 1.7.2 and CI caching (#419)
Browse files Browse the repository at this point in the history
* sbt 1.7.2 and CI caching

* Yaml
  • Loading branch information
ennru authored Oct 12, 2022
1 parent ed779ec commit 8831ccb
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 25 deletions.
22 changes: 15 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ commands:
parameters:
version:
type: string
default: "1.4.9"
default: "1.7.2"
steps:
- install-java-11
- run:
Expand Down Expand Up @@ -84,7 +84,7 @@ commands:
parameters:
version:
type: string
default: "1.4.9"
default: "1.7.2"
steps:
- install-java-11-win
- run:
Expand All @@ -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:
Expand Down
24 changes: 10 additions & 14 deletions codegen/build.sbt
Original file line number Diff line number Diff line change
@@ -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` =
Expand Down Expand Up @@ -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
Expand All @@ -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._

Expand All @@ -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",
Expand All @@ -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`)

// *****************************************************************************
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion codegen/project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 1.4.9
sbt.version = 1.7.2
6 changes: 3 additions & 3 deletions codegen/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 8831ccb

Please sign in to comment.