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

refactor(node): remove legacy BE files #832

Merged
merged 8 commits into from
Apr 12, 2024
Merged
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
  •  
  •  
  •  
141 changes: 84 additions & 57 deletions build.sbt
Original file line number Diff line number Diff line change
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 @@ -108,9 +109,9 @@ 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"
)
"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 =
Expand Down Expand Up @@ -190,7 +191,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 Down Expand Up @@ -243,43 +244,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 +289,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