Skip to content

Commit

Permalink
internal: Move airframe src to airframe-di (#1689)
Browse files Browse the repository at this point in the history
* internal: Move airframe src to airframe-di

* Fix airspec source dep
  • Loading branch information
xerial committed May 22, 2021
1 parent e6a1e55 commit 41b796d
Show file tree
Hide file tree
Showing 98 changed files with 23 additions and 24 deletions.
File renamed without changes.
47 changes: 23 additions & 24 deletions build.sbt
Expand Up @@ -161,8 +161,8 @@ lazy val root =

// JVM projects for scala-community build. This should have no tricky setup and should support Scala 2.12.
lazy val communityBuildProjects: Seq[ProjectReference] = Seq(
airframeMacrosJVM,
airframeJVM,
diMacrosJVM,
diJVM,
surfaceJVM,
logJVM,
canvas,
Expand Down Expand Up @@ -201,8 +201,8 @@ lazy val jvmProjects: Seq[ProjectReference] = communityBuildProjects ++ Seq[Proj
lazy val jsProjects: Seq[ProjectReference] = Seq(
logJS,
surfaceJS,
airframeMacrosJS,
airframeJS,
diMacrosJS,
diJS,
metricsJS,
controlJS,
ulidJS,
Expand Down Expand Up @@ -250,8 +250,8 @@ lazy val projectDotty =
crossScalaVersions := Seq(SCALA_3_0)
)
.aggregate(
airframeMacrosJVM,
airframeJVM,
diMacrosJVM,
diJVM,
airspecJVM,
logJVM,
surfaceJVM,
Expand Down Expand Up @@ -327,10 +327,10 @@ def airframeDIDependencies = Seq(
"javax.annotation" % "javax.annotation-api" % JAVAX_ANNOTATION_API_VERSION
)

lazy val airframe =
lazy val di =
crossProject(JVMPlatform, JSPlatform)
.crossType(CrossType.Pure)
.in(file("airframe"))
.in(file("airframe-di"))
.settings(buildSettings)
.settings(dottyCrossBuildSettings)
.settings(
Expand All @@ -349,11 +349,11 @@ lazy val airframe =
)
.dependsOn(
surface,
airframeMacros
diMacros
)

lazy val airframeJVM = airframe.jvm
lazy val airframeJS = airframe.js
lazy val diJVM = di.jvm
lazy val diJS = di.js

def crossBuildSources(scalaBinaryVersion: String, baseDir: String, srcType: String = "main"): Seq[sbt.File] = {
val scalaMajorVersion = scalaBinaryVersion.split("\\.").head
Expand Down Expand Up @@ -390,7 +390,7 @@ def dottyCrossBuildSettings: Seq[Setting[_]] = {

// Airframe DI needs to call macro methods, so we needed to split the project into DI and DI macros.
// This project sources and classes will be embedded to airframe.jar, so we don't publish airframe-di-macros
lazy val airframeMacros =
lazy val diMacros =
crossProject(JVMPlatform, JSPlatform)
.crossType(CrossType.Pure)
.in(file("airframe-di-macros"))
Expand All @@ -403,8 +403,8 @@ lazy val airframeMacros =
.jsSettings(jsBuildSettings)
.dependsOn(log, surface)

lazy val airframeMacrosJVM = airframeMacros.jvm
lazy val airframeMacrosJS = airframeMacros.js
lazy val diMacrosJVM = diMacros.jvm
lazy val diMacrosJS = diMacros.js

// // To use airframe in other airframe modules, we need to reference airframeMacros project
// lazy val airframeMacrosJVMRef = airframeMacrosJVM % Optional
Expand Down Expand Up @@ -463,7 +463,7 @@ lazy val config =
"org.yaml" % "snakeyaml" % "1.28"
)
)
.dependsOn(airframeJVM, codecJVM)
.dependsOn(diJVM, codecJVM)

lazy val control =
crossProject(JVMPlatform, JSPlatform)
Expand Down Expand Up @@ -553,7 +553,6 @@ lazy val log: sbtcrossproject.CrossProject =
if (DOTTY) Seq("-source:3.0-migration")
else Nil
},
crossScalaVersions := withDotty,
libraryDependencies ++= logDependencies(scalaVersion.value)
)
.jvmSettings(
Expand Down Expand Up @@ -646,7 +645,7 @@ lazy val jdbc =
"org.slf4j" % "slf4j-jdk14" % SLF4J_VERSION
)
)
.dependsOn(airframeJVM, controlJVM, config)
.dependsOn(diJVM, controlJVM, config)

lazy val rx =
crossProject(JVMPlatform, JSPlatform)
Expand Down Expand Up @@ -714,7 +713,7 @@ lazy val httpRouter =
name := "airframe-http-router",
description := "Request routing library"
)
.dependsOn(airframeJVM, httpJVM)
.dependsOn(diJVM, httpJVM)

lazy val httpCodeGen =
project
Expand Down Expand Up @@ -879,7 +878,7 @@ lazy val fluentd =
"org.slf4j" % "slf4j-jdk14" % SLF4J_VERSION
)
)
.dependsOn(codecJVM, airframeJVM)
.dependsOn(codecJVM, diJVM)

def sqlRefLib = { scalaVersion: String =>
if (scalaVersion.startsWith("2.12")) {
Expand Down Expand Up @@ -986,8 +985,8 @@ lazy val examples =
.dependsOn(
codecJVM,
config,
airframeJVM,
airframeMacrosJVM,
diJVM,
diMacrosJVM,
launcher,
jmx,
jdbc,
Expand All @@ -1008,7 +1007,7 @@ lazy val dottyTest =
else targetScalaVersions
}
)
.dependsOn(logJVM, surfaceJVM, airframeJVM, codecJVM)
.dependsOn(logJVM, surfaceJVM, diJVM, codecJVM)

/**
* AirSpec build definitions.
Expand All @@ -1027,7 +1026,7 @@ lazy val dottyTest =
*/
val airspecLogDependencies = Seq("airframe-log")
val airspecCoreDependencies = Seq("airframe-di-macros", "airframe-surface")
val airspecDependencies = Seq("airframe", "airframe-metrics")
val airspecDependencies = Seq("airframe-di", "airframe-metrics")

// Setting keys for AirSpec
val airspecDependsOn =
Expand Down Expand Up @@ -1227,4 +1226,4 @@ lazy val airspecLight =
"org.scalacheck" %%% "scalacheck" % SCALACHECK_VERSION % Provided
)
)
.dependsOn(airframeJVM, metricsJVM)
.dependsOn(diJVM, metricsJVM)

0 comments on commit 41b796d

Please sign in to comment.