@@ -1256,16 +1256,31 @@ object Build {
12561256 lazy val `scaladoc-testcases` = project.in(file(" scaladoc-testcases" )).
12571257 dependsOn(`scala3-compiler-bootstrapped`).
12581258 settings(commonBootstrappedSettings)
1259- lazy val `scaladoc-js` = project.in(file(" scaladoc-js" )).
1259+
1260+ lazy val `scaladoc-js-common` = project.in(file(" scaladoc-js/common" )).
12601261 enablePlugins(DottyJSPlugin ).
12611262 dependsOn(`scala3-library-bootstrappedJS`).
12621263 settings(
1263- Compile / scalaJSMainModuleInitializer := (sys.env.get(" scaladoc.projectFormat" ) match {
1264- case Some (" md" ) => Some (ModuleInitializer .mainMethod(" dotty.tools.scaladoc.Main" , " markdownMain" ))
1265- case _ => Some (ModuleInitializer .mainMethod(" dotty.tools.scaladoc.Main" , " main" ))
1266- }),
12671264 Test / fork := false ,
1268- Compile / scalaJSUseMainModuleInitializer := true ,
1265+ libraryDependencies += (" org.scala-js" %%% " scalajs-dom" % " 1.1.0" ).cross(CrossVersion .for3Use2_13)
1266+ )
1267+
1268+ lazy val `scaladoc-js-main` = project.in(file(" scaladoc-js/main" )).
1269+ enablePlugins(DottyJSPlugin ).
1270+ dependsOn(`scaladoc-js-common`).
1271+ settings(scalaJSUseMainModuleInitializer := true )
1272+
1273+ lazy val `scaladoc-js-markdown` = project.in(file(" scaladoc-js/markdown" )).
1274+ enablePlugins(DottyJSPlugin ).
1275+ dependsOn(`scaladoc-js-common`).
1276+ settings(scalaJSUseMainModuleInitializer := true )
1277+
1278+ lazy val `scaladoc-js-contributors` = project.in(file(" scaladoc-js/contributors" )).
1279+ enablePlugins(DottyJSPlugin ).
1280+ dependsOn(`scala3-library-bootstrappedJS`).
1281+ settings(
1282+ Test / fork := false ,
1283+ scalaJSUseMainModuleInitializer := true ,
12691284 libraryDependencies += (" org.scala-js" %%% " scalajs-dom" % " 1.1.0" ).cross(CrossVersion .for3Use2_13)
12701285 )
12711286
@@ -1320,14 +1335,30 @@ object Build {
13201335 ).
13211336 settings(
13221337 Compile / resourceGenerators += Def .task {
1323- val jsDestinationFile = (Compile / resourceManaged).value / " dotty_res" / " scripts" / " scaladoc-scalajs.js"
1324- sbt.IO .copyFile((`scaladoc-js` / Compile / fullOptJS).value.data, jsDestinationFile)
1325- Seq (jsDestinationFile)
1338+ val contributorsFile = (`scaladoc-js-contributors` / Compile / fullOptJS).value.data
1339+ val contributorsDestinationFile = Paths .get(" docs-for-dotty-page" , " js" , " contributors.js" ).toFile
1340+ sbt.IO .copyFile(contributorsFile, contributorsDestinationFile)
1341+
1342+ val mainFile = (`scaladoc-js-main` / Compile / fullOptJS).value.data
1343+ val mainDestinationFile = (Compile / resourceManaged).value / " dotty_res" / " scripts" / " scaladoc-scalajs.js"
1344+ sbt.IO .copyFile(mainFile, mainDestinationFile)
1345+
1346+ Seq (mainDestinationFile, contributorsDestinationFile)
13261347 }.taskValue,
13271348 Compile / resourceGenerators += Def .task {
1328- Seq (" code-snippets.css" , " searchbar.css" , " content-contributors.css" , " social-links.css" , " ux.css" , " versions-dropdown.css" ).map { file =>
1349+ {
1350+ val cssDesitnationFile = (Compile / resourceManaged).value / " dotty_res" / " styles" / " code-snippets.css"
1351+ val cssSourceFile = (`scaladoc-js-common` / Compile / resourceDirectory).value / " code-snippets.css"
1352+ sbt.IO .copyFile(cssSourceFile, cssDesitnationFile)
1353+ Seq (cssDesitnationFile)
1354+ } ++ {
1355+ val cssDesitnationFile = Paths .get(" docs-for-dotty-page" , " css" , " content-contributors.css" ).toFile
1356+ val cssSourceFile = (`scaladoc-js-contributors` / Compile / resourceDirectory).value / " content-contributors.css"
1357+ sbt.IO .copyFile(cssSourceFile, cssDesitnationFile)
1358+ Seq (cssDesitnationFile)
1359+ } ++ Seq (" searchbar.css" , " social-links.css" , " ux.css" , " versions-dropdown.css" ).map { file =>
13291360 val cssDesitnationFile = (Compile / resourceManaged).value / " dotty_res" / " styles" / file
1330- val cssSourceFile = (`scaladoc-js` / Compile / resourceDirectory).value / file
1361+ val cssSourceFile = (`scaladoc-js-main ` / Compile / resourceDirectory).value / file
13311362 sbt.IO .copyFile(cssSourceFile, cssDesitnationFile)
13321363 cssDesitnationFile
13331364 }
@@ -1458,10 +1489,10 @@ object Build {
14581489 case _ => throw new IllegalArgumentException (" No js destination provided" )
14591490 }
14601491 val jsDestinationFile : File = Paths .get(destJS).toFile
1461- sbt.IO .copyFile((`scaladoc-js` / Compile / fullOptJS).value.data, jsDestinationFile)
1492+ sbt.IO .copyFile((`scaladoc-js-markdown ` / Compile / fullOptJS).value.data, jsDestinationFile)
14621493 csses.map { file =>
14631494 val cssDesitnationFile = Paths .get(destCSS).toFile / file
1464- val cssSourceFile = (`scaladoc-js` / Compile / resourceDirectory).value / file
1495+ val cssSourceFile = (`scaladoc-js-markdown ` / Compile / resourceDirectory).value / file
14651496 sbt.IO .copyFile(cssSourceFile, cssDesitnationFile)
14661497 cssDesitnationFile
14671498 }
0 commit comments