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

No more compile internal #1384

Merged
merged 2 commits into from
Mar 26, 2020
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 10 additions & 26 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,14 @@ lazy val chiselSettings = Seq (
}
)

lazy val coreMacros = (project in file("coreMacros")).
settings(commonSettings: _*).
// Prevent separate JARs from being generated for coreMacros.
settings(skip in publish := true)
lazy val macros = (project in file("macros")).
settings(name := "chisel3-macros").
settings(commonSettings: _*)

lazy val chiselFrontend = (project in file("chiselFrontend")).
lazy val core = (project in file("core")).
settings(commonSettings: _*).
// Prevent separate JARs from being generated for chiselFrontend.
settings(skip in publish := true).
settings(
name := "chisel3-core",
scalacOptions := scalacOptions.value ++ Seq(
"-deprecation",
"-explaintypes",
Expand All @@ -143,7 +141,7 @@ lazy val chiselFrontend = (project in file("chiselFrontend")).
// "-Xlint:missing-interpolator"
)
).
dependsOn(coreMacros)
dependsOn(macros)

// This will always be the root project, even if we are a sub-project.
lazy val root = RootProject(file("."))
Expand All @@ -159,15 +157,9 @@ lazy val chisel = (project in file(".")).
settings(commonSettings: _*).
settings(chiselSettings: _*).
settings(publishSettings: _*).
dependsOn(coreMacros % "compile-internal;test-internal").
dependsOn(chiselFrontend % "compile-internal;test-internal").
// We used to have to disable aggregation in general in order to suppress
// creation of subproject JARs (coreMacros and chiselFrontend) during publishing.
// This had the unfortunate side-effect of suppressing coverage tests and scaladoc generation in subprojects.
// The "skip in publish := true" setting in subproject settings seems to be
// sufficient to suppress subproject JAR creation, so we can restore
// general aggregation, and thus get coverage tests and scaladoc for subprojects.
aggregate(coreMacros, chiselFrontend).
dependsOn(macros).
dependsOn(core).
aggregate(macros, core).
settings(
scalacOptions in Test ++= Seq("-language:reflectiveCalls"),
scalacOptions in Compile in doc ++= Seq(
Expand All @@ -189,13 +181,5 @@ lazy val chisel = (project in file(".")).
}
s"https://github.com/freechipsproject/chisel3/tree/$branch/€{FILE_PATH}.scala"
}
),
// Include macro classes, resources, and sources main JAR since we don't create subproject JARs.
mappings in (Compile, packageBin) ++= (mappings in (coreMacros, Compile, packageBin)).value,
mappings in (Compile, packageSrc) ++= (mappings in (coreMacros, Compile, packageSrc)).value,
mappings in (Compile, packageBin) ++= (mappings in (chiselFrontend, Compile, packageBin)).value,
mappings in (Compile, packageSrc) ++= (mappings in (chiselFrontend, Compile, packageSrc)).value,
// Export the packaged JAR so projects that depend directly on Chisel project (rather than the
// published artifact) also see the stuff in coreMacros and chiselFrontend.
exportJars := true
)
)