@@ -1454,7 +1454,7 @@ object Build {
1454
1454
lazy val `scala3-bootstrapped-new` = project
1455
1455
.aggregate(`scala3-interfaces`, `scala3-library-bootstrapped-new` , `scala-library-bootstrapped`,
1456
1456
`tasty-core-bootstrapped-new`, `scala3-compiler-bootstrapped-new`, `scala3-sbt-bridge-bootstrapped`,
1457
- `scala3-staging-new`, `scala3-tasty-inspector-new`, `scala-library-sjs`, `scala3-library-sjs`)
1457
+ `scala3-staging-new`, `scala3-tasty-inspector-new`, `scala-library-sjs`, `scala3-library-sjs`, `scaladoc-new` )
1458
1458
.settings(
1459
1459
name := " scala3-bootstrapped" ,
1460
1460
moduleName := " scala3-bootstrapped" ,
@@ -2368,6 +2368,86 @@ object Build {
2368
2368
}.taskValue,
2369
2369
)
2370
2370
2371
+ // ==============================================================================================
2372
+ // ========================================== SCALADOC ==========================================
2373
+ // ==============================================================================================
2374
+
2375
+ /* Configuration of the org.scala-lang:scaladoc_3:*.**.**-bootstrapped project */
2376
+ lazy val `scaladoc-new` = project.in(file(" scaladoc" ))
2377
+ .dependsOn(`scala3-compiler-bootstrapped-new`, `scala3-tasty-inspector-new`)
2378
+ .settings(
2379
+ name := " scaladoc" ,
2380
+ moduleName := " scaladoc" ,
2381
+ version := dottyVersion,
2382
+ versionScheme := Some (" semver-spec" ),
2383
+ scalaVersion := referenceVersion, // nonbootstrapped artifacts are compiled with the reference compiler (already officially published)
2384
+ crossPaths := true , // org.scala-lang:scaladoc has a crosspath
2385
+ // sbt shouldn't add stdlib automatically, we depend on `scala3-library-nonbootstrapped`
2386
+ autoScalaLibrary := false ,
2387
+ Compile / unmanagedSourceDirectories := Seq (baseDirectory.value / " src" ),
2388
+ Compile / resourceDirectory := baseDirectory.value / " resources" ,
2389
+ // Add all the necessary resource generators
2390
+ Compile / resourceGenerators ++= Seq (
2391
+ generateStaticAssetsTask.taskValue,
2392
+ bundleCSS.taskValue
2393
+ ),
2394
+ // All the dependencies needed by the doctool
2395
+ libraryDependencies ++= Dependencies .flexmarkDeps ++ Seq (
2396
+ " nl.big-o" % " liqp" % " 0.8.2" ,
2397
+ " org.jsoup" % " jsoup" % " 1.17.2" , // Needed to process .html files for static site
2398
+ Dependencies .`jackson-dataformat-yaml`,
2399
+ " com.github.sbt" % " junit-interface" % " 0.13.3" % Test ,
2400
+ ),
2401
+ // NOTE: The only difference here is that we drop `-Werror` and semanticDB for now
2402
+ Compile / scalacOptions := Seq (" -deprecation" , " -feature" , " -unchecked" , " -encoding" , " UTF8" , " -language:implicitConversions" ),
2403
+ Compile / scalacOptions += " -experimental" ,
2404
+ // TODO: Enable these flags when the new stdlib is explicitelly null checked
2405
+ // Compile / scalacOptions ++= Seq("-Yexplicit-nulls", "-Wsafe-init"),
2406
+ // Make sure that the produced artifacts have the minimum JVM version in the bytecode
2407
+ Compile / javacOptions ++= Seq (" --source" , Versions .minimumJVMVersion, " --target" , Versions .minimumJVMVersion),
2408
+ Compile / scalacOptions ++= Seq (" --java-output-version" , Versions .minimumJVMVersion),
2409
+ // Packaging configuration of the stdlib
2410
+ Compile / packageBin / publishArtifact := true ,
2411
+ Compile / packageDoc / publishArtifact := false ,
2412
+ Compile / packageSrc / publishArtifact := true ,
2413
+ // Only publish compilation artifacts, no test artifacts
2414
+ Test / publishArtifact := false ,
2415
+ // Do not allow to publish this project for now
2416
+ publish / skip := false ,
2417
+ //
2418
+ Compile / mainClass := Some (" dotty.tools.scaladoc.Main" ),
2419
+ Compile / buildInfoKeys := Seq [BuildInfoKey ](version),
2420
+ Compile / buildInfoPackage := " dotty.tools.scaladoc" ,
2421
+ BuildInfoPlugin .buildInfoScopedSettings(Compile ),
2422
+ BuildInfoPlugin .buildInfoDefaultSettings,
2423
+ // Configure to use the non-bootstrapped compiler
2424
+ scalaInstance := {
2425
+ val externalCompilerDeps = (`scala3-compiler-nonbootstrapped` / Compile / externalDependencyClasspath).value.map(_.data).toSet
2426
+
2427
+ // IMPORTANT: We need to use actual jars to form the ScalaInstance and not
2428
+ // just directories containing classfiles because sbt maintains a cache of
2429
+ // compiler instances. This cache is invalidated based on timestamps
2430
+ // however this is only implemented on jars, directories are never
2431
+ // invalidated.
2432
+ val tastyCore = (`tasty-core-nonbootstrapped` / Compile / packageBin).value
2433
+ val scalaLibrary = (`scala-library-nonbootstrapped` / Compile / packageBin).value
2434
+ val scala3Interfaces = (`scala3-interfaces` / Compile / packageBin).value
2435
+ val scala3Compiler = (`scala3-compiler-nonbootstrapped` / Compile / packageBin).value
2436
+
2437
+ Defaults .makeScalaInstance(
2438
+ dottyNonBootstrappedVersion,
2439
+ libraryJars = Array (scalaLibrary),
2440
+ allCompilerJars = Seq (tastyCore, scala3Interfaces, scala3Compiler) ++ externalCompilerDeps,
2441
+ allDocJars = Seq .empty,
2442
+ state.value,
2443
+ scalaInstanceTopLoader.value
2444
+ )
2445
+ },
2446
+ scalaCompilerBridgeBinaryJar := {
2447
+ Some ((`scala3-sbt-bridge-nonbootstrapped` / Compile / packageBin).value)
2448
+ },
2449
+ )
2450
+
2371
2451
def dottyLibrary (implicit mode : Mode ): Project = mode match {
2372
2452
case NonBootstrapped => `scala3-library`
2373
2453
case Bootstrapped => `scala3-library-bootstrapped`
0 commit comments