Skip to content

Commit

Permalink
Removing utils-core/, deps/others and using SBT module patcher (#505)
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelbranco80 authored Sep 11, 2024
1 parent 454051b commit 1c17d7c
Show file tree
Hide file tree
Showing 29 changed files with 54 additions and 1,533 deletions.
56 changes: 25 additions & 31 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ThisBuild / credentials += Credentials(
"raw-labs",
sys.env.getOrElse("GITHUB_TOKEN", "")
)
ThisBuild / resolvers += "Github RAW main repo" at "https://maven.pkg.github.com/raw-labs/raw"
ThisBuild / resolvers += "Github RAW main repo" at "https://maven.pkg.github.com/raw-labs/snapi"

ThisBuild / javaHome := {
val javaHomePath = sys.env.getOrElse("JAVA_HOME", sys.props("java.home"))
Expand All @@ -35,10 +35,10 @@ writeVersionToFile := {
}

lazy val root = (project in file("."))
.doPatchDependencies()
.aggregate(
protocolRaw,
protocolCompiler,
utilsCore,
utilsSources,
compiler,
snapiParser,
Expand All @@ -58,35 +58,14 @@ lazy val root = (project in file("."))
publishLocal / skip := true
)

lazy val utilsCore = (project in file("utils-core"))
.settings(
commonSettings,
scalaCompileSettings,
testSettings,
libraryDependencies ++= Seq(
scalaLogging,
logbackClassic,
guava,
scalaJava8Compat,
typesafeConfig,
loki4jAppender,
commonsIO,
commonsText,
scalatest % Test
) ++
slf4j ++
jacksonDeps
)

lazy val utilsSources = (project in file("utils-sources"))
.dependsOn(
utilsCore % "compile->compile;test->test"
)
.doPatchDependencies()
.settings(
commonSettings,
nonStrictScalaCompileSettings,
testSettings,
libraryDependencies ++= Seq(
utilsCore % "compile->compile;test->test",
apacheHttpClient,
jwtApi,
jwtImpl,
Expand All @@ -104,6 +83,7 @@ lazy val utilsSources = (project in file("utils-sources"))
)

lazy val protocolRaw = (project in file("protocol-raw"))
.doPatchDependencies()
.enablePlugins(ProtobufPlugin)
.settings(
commonSettings,
Expand All @@ -119,6 +99,7 @@ lazy val protocolRaw = (project in file("protocol-raw"))
)

lazy val protocolCompiler = (project in file("protocol-compiler"))
.doPatchDependencies()
.dependsOn(
protocolRaw % "compile->compile;test->test;protobuf->protobuf"
)
Expand All @@ -139,18 +120,24 @@ lazy val protocolCompiler = (project in file("protocol-compiler"))
)

lazy val compiler = (project in file("compiler"))
.doPatchDependencies()
.dependsOn(
utilsCore % "compile->compile;test->test",
protocolCompiler % "compile->compile;test->test"
)
.settings(
commonSettings,
scalaCompileSettings,
// Ignore deprecation warnings in the compiler. Needed for a Jackson feature we require.
// TODO (msb): When in Scala 2.13, use @nowarn annotation instead in the exact code location.
nonStrictScalaCompileSettings,
testSettings,
libraryDependencies += trufflePolyglot
libraryDependencies ++= Seq(
utilsCore % "compile->compile;test->test",
trufflePolyglot
) ++ jacksonDeps
)

lazy val snapiParser = (project in file("snapi-parser"))
.doPatchDependencies()
.enablePlugins(GenParserPlugin)
.settings(
commonSettings,
Expand All @@ -168,8 +155,8 @@ lazy val snapiParser = (project in file("snapi-parser"))
)

lazy val snapiFrontend = (project in file("snapi-frontend"))
.doPatchDependencies()
.dependsOn(
utilsCore % "compile->compile;test->test",
compiler % "compile->compile;test->test",
utilsSources % "compile->compile;test->test",
snapiParser % "compile->compile;test->test"
Expand All @@ -179,6 +166,7 @@ lazy val snapiFrontend = (project in file("snapi-frontend"))
nonStrictScalaCompileSettings,
testSettings,
libraryDependencies ++= Seq(
utilsCore % "compile->compile;test->test",
commonsLang,
commonsText,
icuDeps,
Expand All @@ -204,16 +192,18 @@ val annotationProcessors = Seq(
).mkString(",")

lazy val snapiTruffle = (project in file("snapi-truffle"))
.doPatchDependencies()
.dependsOn(
utilsCore % "compile->compile;test->test",
snapiFrontend % "compile->compile;test->test"
)
.enablePlugins(JavaAnnotationProcessorPlugin)
.settings(
commonSettings,
snapiTruffleCompileSettings,
testSettings,
libraryDependencies ++= truffleCompiler,
libraryDependencies ++= truffleCompiler ++ Seq(
utilsCore % "compile->compile;test->test"
),
calculateClasspath := {
val dependencyFiles = (Compile / dependencyClasspath).value.files
val unmanagedFiles = (Compile / unmanagedClasspath).value.files
Expand Down Expand Up @@ -267,6 +257,7 @@ lazy val snapiTruffle = (project in file("snapi-truffle"))
)

lazy val snapiCompiler = (project in file("snapi-compiler"))
.doPatchDependencies()
.dependsOn(
compiler % "compile->compile;test->test",
snapiFrontend % "compile->compile;test->test",
Expand All @@ -279,6 +270,7 @@ lazy val snapiCompiler = (project in file("snapi-compiler"))
)

lazy val sqlParser = (project in file("sql-parser"))
.doPatchDependencies()
.enablePlugins(GenParserPlugin)
.settings(
commonSettings,
Expand All @@ -296,6 +288,7 @@ lazy val sqlParser = (project in file("sql-parser"))
)

lazy val sqlCompiler = (project in file("sql-compiler"))
.doPatchDependencies()
.dependsOn(
compiler % "compile->compile;test->test",
sqlParser % "compile->compile;test->test"
Expand All @@ -314,6 +307,7 @@ lazy val sqlCompiler = (project in file("sql-compiler"))
)

lazy val pythonCompiler = (project in file("python-compiler"))
.doPatchDependencies()
.dependsOn(
compiler % "compile->compile;test->test"
)
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
requires com.fasterxml.jackson.core;
requires com.fasterxml.jackson.databind;
requires com.fasterxml.jackson.dataformat.csv;
requires com.fasterxml.jackson.scala;
requires jackson.module.scala;
requires com.fasterxml.jackson.datatype.jsr310;
requires com.fasterxml.jackson.datatype.jdk8;
requires raw.utils.core;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import com.fasterxml.jackson.databind.{
DeserializationContext,
JsonDeserializer,
JsonSerializer,
MapperFeature,
ObjectMapper,
SerializerProvider
}
Expand All @@ -44,6 +45,7 @@ object ProgramEnvironment {
registerModule(DefaultScalaModule)
registerModule(new JavaTimeModule())
registerModule(new Jdk8Module())
configure(MapperFeature.CAN_OVERRIDE_ACCESS_MODIFIERS, false)

// Register custom serializer and deserializer for LocationConfig
val customModule = new SimpleModule()
Expand Down
3 changes: 0 additions & 3 deletions deps/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@ DEPS_HOME="$(cd "$(dirname "$0")"; pwd)"

cd "$DEPS_HOME"/kiama
./build.sh

cd "$DEPS_HOME"/others
./build.sh
3 changes: 0 additions & 3 deletions deps/others/.gitignore

This file was deleted.

Loading

0 comments on commit 1c17d7c

Please sign in to comment.