@@ -185,7 +185,7 @@ lazy val library = configureAsSubproject(project)
185
185
includeFilter in unmanagedResources in Compile := " *.tmpl" | " *.xml" | " *.js" | " *.css" | " rootdoc.txt" ,
186
186
// Include forkjoin classes in scala-library.jar
187
187
mappings in Compile in packageBin ++=
188
- (mappings in Compile in packageBin in LocalProject ( " forkjoin" ) ).value
188
+ (mappings in Compile in packageBin in forkjoin).value
189
189
)
190
190
.settings(filterDocSources(" *.scala" -- (regexFileFilter(" .*/runtime/.*\\ $\\ .scala" ) ||
191
191
regexFileFilter(" .*/runtime/ScalaRunTime\\ .scala" ) ||
@@ -395,6 +395,52 @@ lazy val test = project.
395
395
)
396
396
)
397
397
398
+ lazy val manual = configureAsSubproject(project)
399
+ .settings(
400
+ libraryDependencies ++= Seq (scalaXmlDep, antDep),
401
+ classDirectory in Compile := (target in Compile ).value / " classes"
402
+ )
403
+ .settings(disableDocsAndPublishingTasks : _* )
404
+ .dependsOn(library)
405
+
406
+ lazy val scalaDist = Project (" scala-dist" , file(" ." ) / " target" / " scala-dist-dist-src-dummy" )
407
+ .settings(commonSettings : _* )
408
+ .settings(
409
+ doc := file(" !!! NO DOCS !!!" ),
410
+ mappings in Compile in packageBin ++= {
411
+ val binBaseDir = buildDirectory.value / " pack"
412
+ val binMappings = (mkBin in dist).value.pair(relativeTo(binBaseDir), errorIfNone = false )
413
+ // With the way the resource files are spread out over the project sources we can't just add
414
+ // an unmanagedResourceDirectory, so we generate the mappings manually:
415
+ val docBaseDir = (baseDirectory in ThisBuild ).value
416
+ val docMappings = (docBaseDir / " doc" ).*** pair relativeTo(docBaseDir)
417
+ val resBaseDir = (baseDirectory in ThisBuild ).value / " src/manual/scala/tools/docutil/resources"
418
+ val resMappings = resBaseDir ** (" *.html" | " *.css" | " *.gif" | " *.png" ) pair (p => relativeTo(resBaseDir)(p).map(" doc/tools/" + _))
419
+ docMappings ++ resMappings ++ binMappings
420
+ },
421
+ resourceGenerators in Compile += Def .task {
422
+ val command = " fsc, scala, scalac, scaladoc, scalap"
423
+ val htmlOut = (resourceManaged in Compile ).value / " doc/tools"
424
+ val manOut = (resourceManaged in Compile ).value / " genman"
425
+ val fixedManOut = (resourceManaged in Compile ).value / " man"
426
+ IO .createDirectory(htmlOut)
427
+ IO .createDirectory(manOut / " man1" )
428
+ toError(runner.value.run(" scala.tools.docutil.ManMaker" ,
429
+ (fullClasspath in Compile in manual).value.files,
430
+ Seq (command, htmlOut.getAbsolutePath, manOut.getAbsolutePath),
431
+ streams.value.log))
432
+ (manOut ** " *.1" pair rebase(manOut, fixedManOut)).foreach { case (in, out) =>
433
+ // Generated manpages should always use LF only. There doesn't seem to be a good reason
434
+ // for generating them with the platform EOL first and then converting them but that's
435
+ // what the ant build does.
436
+ IO .write(out, IO .readBytes(in).filterNot(_ == '\r ' ))
437
+ }
438
+ (htmlOut ** " *.html" ).get ++ (fixedManOut ** " *.1" ).get
439
+ }.taskValue,
440
+ managedResourceDirectories in Compile := Seq ((resourceManaged in Compile ).value),
441
+ packageOptions in Compile in packageBin := Seq .empty
442
+ )
443
+
398
444
lazy val root = (project in file(" ." )).
399
445
aggregate(library, forkjoin, reflect, compiler, interactive, repl, replJline, replJlineEmbedded,
400
446
scaladoc, scalap, actors, partestExtras, junit).settings(
0 commit comments