Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Update Scala and SBT versions #836

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
fetch-depth: 0
- name: Mega-Linter
id: ml
uses: megalinter/megalinter@v6
uses: megalinter/megalinter@v7
- name: Archive production artifacts
if: success() || failure()
uses: actions/upload-artifact@v3
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ out/
**/.bloop/
*.worksheet.sc
**/metals.sbt
prism-interactive-demo-web/src/protos/intdemo
*.aux
*.aux
*.toc
*.pdf
.idea_modules
Expand All @@ -35,3 +34,4 @@ mill
client-storage.txt
.bsp
*.sc
megalinter-reports
38 changes: 20 additions & 18 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,25 @@
APPLY_FIXES: all
DEFAULT_BRANCH: main
DISABLE_LINTERS: [
REPOSITORY_DEVSKIM,
REPOSITORY_GITLEAKS,
DOCKERFILE_HADOLINT,
REPOSITORY_TRIVY,
REPOSITORY_CHECKOV,
REPOSITORY_SECRETLINT,
SCALA_SCALAFIX,
SQL_TSQLLINT,
C_CPPLINT, # For pollux/lib/anoncreds/src/main/c
CPP_CPPLINT, # For pollux/lib/anoncreds/src/main/c
JAVA_CHECKSTYLE, # For pollux/lib/anoncreds/src/main/java
REPOSITORY_DEVSKIM,
REPOSITORY_GITLEAKS,
DOCKERFILE_HADOLINT,
REPOSITORY_TRIVY,
REPOSITORY_CHECKOV,
REPOSITORY_SECRETLINT,
SCALA_SCALAFIX,
SQL_TSQLLINT,
C_CPPLINT, # For pollux/lib/anoncreds/src/main/c
CPP_CPPLINT, # For pollux/lib/anoncreds/src/main/c
JAVA_CHECKSTYLE, # For pollux/lib/anoncreds/src/main/java
]
DISABLE_ERRORS_LINTERS: [
KOTLIN_KTLINT,
PROTOBUF_PROTOLINT,
OPENAPI_SPECTRAL,
MARKDOWN_MARKDOWN_LINK_CHECK,
KOTLIN_KTLINT,
PROTOBUF_PROTOLINT,
OPENAPI_SPECTRAL,
MARKDOWN_MARKDOWN_LINK_CHECK,
REPOSITORY_TRUFFLEHOG,
REPOSITORY_KICS,
]

DISABLE: [COPYPASTE, SPELL, CREDENTIALS]
Expand All @@ -37,13 +39,13 @@ BASH_SHELLCHECK_DISABLE_ERRORS: true
# that could lead to new files in workspace created
# with CLRF instead of CL due docker/python/git chain
PRE_COMMANDS:
- command: git config --global core.autocrlf input
cwd: "workspace"
- command: git config --global core.autocrlf input
cwd: "workspace"

# Linter customisation
MARKDOWN_MARKDOWN_LINK_CHECK_FILTER_REGEX_EXCLUDE: "CHANGELOG.md"
MARKDOWN_MARKDOWNLINT_FILTER_REGEX_EXCLUDE: "CHANGELOG.md"
SQL_SQL_LINT_ARGUMENTS: -d postgres --ignore-errors=postgres-invalid-alter-option
SQL_SQL_LINT_ARGUMENTS: -d postgres --ignore-errors=postgres-invalid-alter-option,postgres-invalid-create-option
YAML_YAMLLINT_FILTER_REGEX_EXCLUDE: "infrastructure/charts/node/*"
YAML_PRETTIER_FILTER_REGEX_EXCLUDE: "infrastructure/charts/node/*"
YAML_V8R_FILTER_REGEX_EXCLUDE: "infrastructure/charts/node/*"
158 changes: 88 additions & 70 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import sbtprotoc.ProtocPlugin.autoImport.PB
inThisBuild(
Seq(
organization := "io.iohk.atala",
scalaVersion := "2.13.7",
scalaVersion := "2.13.13",
fork := true,
run / connectInput := true,
versionScheme := Some("semver-spec"),
Expand Down Expand Up @@ -50,7 +50,8 @@ lazy val versions = new {
val typesafeConfig = "1.4.2"
val fs2 = "3.2.5"
val scalaUri = "4.0.0"
val prismSdk = "v1.4.1-snapshot-1688975371-7541fd2" // deployed to github packages from sdk branch "node-1.4-extension-sdk"
val prismSdk =
"v1.4.1-snapshot-1688975371-7541fd2" // deployed to github packages from sdk branch "node-1.4-extension-sdk"
val vaultSdk = "0.1.0-build-2-96cc137d"
}

Expand Down Expand Up @@ -107,19 +108,10 @@ lazy val Dependencies = new {

// We have to exclude bouncycastle since for some reason bitcoinj depends on bouncycastle jdk15to18
// (i.e. JDK 1.5 to 1.8), but we are using JDK 11
val prismCredentials =
"io.iohk.atala" % "prism-credentials-jvm" % versions.prismSdk excludeAll ExclusionRule(
organization = "org.bouncycastle"
)
val prismProtos =
"io.iohk.atala" % "prism-protos-jvm" % versions.prismSdk % "protobuf-src" intransitive ()
val vaultProtos =
"io.iohk.atala" % "vault-api-jvm" % versions.vaultSdk % "protobuf-src" intransitive ()
// Can be used only in tests!
val prismApi =
"io.iohk.atala" % "prism-api-jvm" % versions.prismSdk % Test excludeAll ExclusionRule(
organization = "org.bouncycastle"
)
val prismCrypto =
"io.iohk.atala" % "prism-crypto-jvm" % versions.prismSdk
val prismIdentity =
"io.iohk.atala" % "prism-identity-jvm" % versions.prismSdk

// Test dependencies
val catsScalatest =
Expand Down Expand Up @@ -162,7 +154,7 @@ lazy val Dependencies = new {
val sttpDependencies = Seq(sttpCore, sttpCE2)
val tofuDependencies = Seq(tofu, tofuLogging, tofuDerevoTagless)
val prismDependencies =
Seq(prismCredentials, prismProtos, prismApi, vaultProtos)
Seq(prismCrypto, prismIdentity)
val scalapbDependencies = Seq(
"com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % "protobuf",
"com.thesamet.scalapb" %% "scalapb-runtime-grpc" % scalapb.compiler.Version.scalapbVersion
Expand Down Expand Up @@ -190,7 +182,7 @@ lazy val commonSettings = Seq(
"-Ywarn-dead-code"
)
)
),
),
scalacOptions += "-Ymacro-annotations",
javacOptions ++= Seq("-source", "1.11", "-target", "1.11"),
githubTokenSource := TokenSource.Environment("GITHUB_TOKEN"),
Expand All @@ -201,7 +193,7 @@ lazy val commonSettings = Seq(
"JetBrains Space Maven Repository" at "https://maven.pkg.jetbrains.space/public/p/kotlinx-coroutines/maven",
libraryDependencies ++= Dependencies.scalatestDependencies,
addCompilerPlugin(
"org.typelevel" % "kind-projector" % "0.13.2" cross CrossVersion.full
"org.typelevel" % "kind-projector" % "0.13.3" cross CrossVersion.full
),
Test / fork := true,
Test / parallelExecution := false,
Expand Down Expand Up @@ -243,43 +235,43 @@ lazy val commonSettings = Seq(
}
)

lazy val common = project
.in(file("common"))
.settings(
commonSettings,
// Make ScalaPB compile protos relative to `protobuf_external_src/protos` directory.
// Otherwise, it will assume that `protobuf_external_src` is the root directory for proto files.
Compile / PB.protoSources := (Compile / PB.protoSources).value.map {
case externalSrc if externalSrc.toPath.endsWith("protobuf_external_src") =>
externalSrc / "proto"
case other => other
},
resolvers += Resolver.mavenLocal,
resolvers += Resolver.jcenterRepo,
resolvers += Resolver.mavenCentral,
libraryDependencies ++=
Dependencies.doobieDependencies ++
Dependencies.dockerDependencies ++
Dependencies.bouncyDependencies ++
Dependencies.grpcDependencies ++
Dependencies.mockitoDependencies ++
Dependencies.kamonDependencies ++
Dependencies.circeDependencies ++
Dependencies.enumeratumDependencies ++
Dependencies.tofuDependencies ++
Seq(
Dependencies.diffx,
Dependencies.flyway,
Dependencies.typesafeConfig,
Dependencies.fs2,
Dependencies.scalaUri
) ++
Dependencies.prismDependencies ++
Dependencies.scalapbDependencies,
Compile / PB.targets := Seq(
scalapb.gen() -> (Compile / sourceManaged).value / "proto"
)
)
//lazy val common = project
// .in(file("common"))
// .settings(
// commonSettings,
// // Make ScalaPB compile protos relative to `protobuf_external_src/protos` directory.
// // Otherwise, it will assume that `protobuf_external_src` is the root directory for proto files.
// Compile / PB.protoSources := (Compile / PB.protoSources).value.map {
// case externalSrc if externalSrc.toPath.endsWith("protobuf_external_src") =>
// externalSrc / "proto"
// case other => other
// },
// resolvers += Resolver.mavenLocal,
// resolvers += Resolver.jcenterRepo,
// resolvers += Resolver.mavenCentral,
// libraryDependencies ++=
// Dependencies.doobieDependencies ++
// Dependencies.dockerDependencies ++
// Dependencies.bouncyDependencies ++
// Dependencies.grpcDependencies ++
// Dependencies.mockitoDependencies ++
// Dependencies.kamonDependencies ++
// Dependencies.circeDependencies ++
// Dependencies.enumeratumDependencies ++
// Dependencies.tofuDependencies ++
// Seq(
// Dependencies.diffx,
// Dependencies.flyway,
// Dependencies.typesafeConfig,
// Dependencies.fs2,
// Dependencies.scalaUri
// ) ++
// Dependencies.prismDependencies ++
// Dependencies.scalapbDependencies,
// Compile / PB.targets := Seq(
// scalapb.gen() -> (Compile / sourceManaged).value / "proto"
// )
// )

lazy val node =
project
Expand All @@ -288,32 +280,58 @@ lazy val node =
commonSettings,
name := "node",
Compile / mainClass := Some("io.iohk.atala.prism.node.NodeApp"),
// Make ScalaPB compile protos relative to `protobuf_external_src/protos` directory.
// Otherwise, it will assume that `protobuf_external_src` is the root directory for proto files.
Compile / PB.protoSources := (Compile / PB.protoSources).value.map {
case externalSrc if externalSrc.toPath.endsWith("protobuf_external_src") =>
externalSrc / "proto"
case other => other
},
Compile / PB.targets := Seq(
scalapb.gen() -> (Compile / sourceManaged).value / "proto"
),
resolvers += Resolver.mavenLocal,
resolvers += Resolver.jcenterRepo,
resolvers += Resolver.mavenCentral,
Docker / maintainer := "atala-coredid@iohk.io",
Docker / dockerUsername := Some("input-output-hk"),
Docker / dockerRepository := Some("ghcr.io"),
Docker / packageName := "prism-node",
dockerExposedPorts := Seq(5432),
dockerBaseImage := "openjdk:11",
libraryDependencies ++= Dependencies.circeDependencies ++ Dependencies.enumeratumDependencies ++ Dependencies.doobieDependencies ++
Dependencies.grpcDependencies ++ Dependencies.logbackDependencies ++
Dependencies.sttpDependencies ++
Dependencies.prismDependencies ++
Dependencies.mockitoDependencies ++
Seq(
Dependencies.chimney,
Dependencies.flyway,
Dependencies.postgresql,
Dependencies.scalapbRuntimeGrpc,
Dependencies.slf4j,
Dependencies.typesafeConfig
)
libraryDependencies
++= Dependencies.circeDependencies
++ Dependencies.tofuDependencies
++ Dependencies.kamonDependencies
++ Dependencies.dockerDependencies
++ Dependencies.bouncyDependencies
++ Dependencies.enumeratumDependencies
++ Dependencies.doobieDependencies
++ Dependencies.grpcDependencies
++ Dependencies.logbackDependencies
++ Dependencies.sttpDependencies
++ Dependencies.prismDependencies
++ Dependencies.mockitoDependencies
++ Dependencies.prismDependencies
++ Dependencies.scalapbDependencies
++ Seq(
Dependencies.chimney,
Dependencies.diffx,
Dependencies.flyway,
Dependencies.typesafeConfig,
Dependencies.postgresql,
Dependencies.scalapbRuntimeGrpc,
Dependencies.slf4j,
Dependencies.typesafeConfig,
Dependencies.fs2,
Dependencies.scalaUri
)
)
.enablePlugins(BuildInfoPlugin, JavaAppPackaging, DockerPlugin)
.dependsOn(common % "compile->compile;test->test")

lazy val root = project
.in(file("."))
.aggregate(common, node)
.aggregate(node)

Global / onChangedBuildSource := ReloadOnSourceChanges

Expand Down
65 changes: 0 additions & 65 deletions common/src/main/protobuf/endorsements_api.proto

This file was deleted.

Loading
Loading