Skip to content

Commit 60c8ed1

Browse files
committed
Add sbt build mode disabling generation of scaladoc to speedup bisection. Enabled with BISECTBUILD env variable allows to reduce publish times by 50%
1 parent e97fea5 commit 60c8ed1

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

project/Build.scala

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ object Build {
133133

134134

135135
val isRelease = sys.env.get("RELEASEBUILD") == Some("yes")
136+
val isBisect = sys.env.get("BISECTBUILD") == Some("yes")
136137

137138
val dottyVersion = {
138139
def isNightly = sys.env.get("NIGHTLYBUILD") == Some("yes")
@@ -445,7 +446,13 @@ object Build {
445446
assert(docScalaInstance.loaderCompilerOnly == base.loaderCompilerOnly)
446447
docScalaInstance
447448
},
448-
Compile / doc / scalacOptions ++= scalacOptionsDocSettings()
449+
Compile / doc / scalacOptions ++= scalacOptionsDocSettings(),
450+
// doc/skip might be ignored and still lead to compilation of doc sources
451+
Compile / doc / skip := isBisect,
452+
Compile/ doc / sources := {
453+
if(isBisect) Nil
454+
else (Compile/doc/sources).value
455+
}
449456
)
450457

451458
lazy val commonBenchmarkSettings = Seq(
@@ -1527,10 +1534,13 @@ object Build {
15271534
SourceLinksIntegrationTest / test:= ((SourceLinksIntegrationTest / test) dependsOn generateScalaDocumentation.toTask("")).value,
15281535
).
15291536
settings(
1530-
Compile / resourceGenerators ++= Seq(
1531-
generateStaticAssetsTask.taskValue,
1532-
bundleCSS.taskValue
1533-
),
1537+
Compile / resourceGenerators ++= {
1538+
if(isBisect) Nil
1539+
else Seq(
1540+
generateStaticAssetsTask.taskValue,
1541+
bundleCSS.taskValue
1542+
)
1543+
},
15341544
libraryDependencies ++= Dependencies.flexmarkDeps ++ Seq(
15351545
"nl.big-o" % "liqp" % "0.8.2",
15361546
"org.jsoup" % "jsoup" % "1.14.3", // Needed to process .html files for static site

project/scripts/bisect.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ class CommitBisect(validationScript: File, shouldFail: Boolean, bootstrapped: Bo
238238
val bisectRunScript = s"""
239239
|scalaVersion=$$(sbt "print ${scala3CompilerProject}/version" | tail -n1)
240240
|rm -r out
241+
|export BISECTBUILD=yes
241242
|sbt "clean; ${scala3Project}/publishLocal"
242243
|${validationCommandStatusModifier}${validationScript.getAbsolutePath} "$$scalaVersion"
243244
""".stripMargin

0 commit comments

Comments
 (0)