mirror of https://github.com/sbt/sbt.git
Drop unused Sxr
This commit is contained in:
parent
627a79c254
commit
44e39ec15e
14
build.sbt
14
build.sbt
|
|
@ -1,5 +1,4 @@
|
|||
import Dependencies._
|
||||
import Sxr.sxr
|
||||
import Util._
|
||||
import com.typesafe.tools.mima.core.ProblemFilters._
|
||||
import com.typesafe.tools.mima.core._
|
||||
|
|
@ -169,7 +168,6 @@ val scriptedSbtReduxMimaSettings = Def.settings(mimaPreviousArtifacts := Set())
|
|||
|
||||
lazy val sbtRoot: Project = (project in file("."))
|
||||
.enablePlugins(ScriptedPlugin) // , SiteScaladocPlugin, GhpagesPlugin)
|
||||
.configs(Sxr.SxrConf)
|
||||
.aggregate(nonRoots: _*)
|
||||
.settings(
|
||||
buildLevelSettings,
|
||||
|
|
@ -191,19 +189,11 @@ lazy val sbtRoot: Project = (project in file("."))
|
|||
},
|
||||
Util.baseScalacOptions,
|
||||
Docs.settings,
|
||||
Sxr.settings,
|
||||
scalacOptions += "-Ymacro-expand:none", // for both sxr and doc
|
||||
sources in sxr := {
|
||||
sources in (Compile, doc) := {
|
||||
val allSources = (sources ?? Nil).all(docProjects).value
|
||||
allSources.flatten.distinct
|
||||
}, //sxr
|
||||
sources in (Compile, doc) := (sources in sxr).value, // doc
|
||||
Sxr.sourceDirectories := {
|
||||
val allSourceDirectories = (sourceDirectories ?? Nil).all(docProjects).value
|
||||
allSourceDirectories.flatten
|
||||
},
|
||||
fullClasspath in sxr := (externalDependencyClasspath in Compile in sbtProj).value,
|
||||
dependencyClasspath in (Compile, doc) := (fullClasspath in sxr).value,
|
||||
}, // doc
|
||||
Util.publishPomSettings,
|
||||
otherRootSettings,
|
||||
Transform.conscriptSettings(bundledLauncherProj),
|
||||
|
|
|
|||
|
|
@ -1,48 +0,0 @@
|
|||
import sbt._
|
||||
import Keys._
|
||||
import Scope.ThisScope
|
||||
|
||||
import sbt.internal.inc.RawCompiler
|
||||
|
||||
object Sxr {
|
||||
val SxrConf = config("sxr").hide
|
||||
val sxr = TaskKey[File]("sxr")
|
||||
val sourceDirectories = TaskKey[Seq[File]]("sxr-source-directories")
|
||||
|
||||
lazy val settings: Seq[Setting[_]] = inTask(sxr)(inSxrSettings) ++ baseSettings
|
||||
|
||||
def baseSettings = Seq(
|
||||
libraryDependencies += "org.scala-sbt.sxr" % "sxr_2.10" % "0.3.0" % SxrConf
|
||||
)
|
||||
def inSxrSettings = Seq(
|
||||
managedClasspath := update.value.matching(configurationFilter(SxrConf.name)).classpath,
|
||||
scalacOptions += "-P:sxr:base-directory:" + sourceDirectories.value.absString,
|
||||
scalacOptions += "-Xplugin:" + managedClasspath.value.files
|
||||
.filter(_.getName.contains("sxr"))
|
||||
.absString,
|
||||
scalacOptions += "-Ystop-after:sxr",
|
||||
target := target.in(taskGlobal).value / "browse",
|
||||
sxr in taskGlobal := sxrTask.value
|
||||
)
|
||||
def taskGlobal = ThisScope.copy(task = Zero)
|
||||
def sxrTask = Def task {
|
||||
val out = target.value
|
||||
val outputDir = out.getParentFile / (out.getName + ".sxr")
|
||||
val log = streams.value.log
|
||||
val si = scalaInstance.value
|
||||
val cp = fullClasspath.value
|
||||
val so = scalacOptions.value
|
||||
val co = classpathOptions.value
|
||||
val f = FileFunction.cached(streams.value.cacheDirectory / "sxr", FilesInfo.hash) { in =>
|
||||
log.info("Generating sxr output in " + outputDir.getAbsolutePath + "...")
|
||||
IO.delete(out)
|
||||
IO.createDirectory(out)
|
||||
val comp =
|
||||
new RawCompiler(si, co, log)
|
||||
comp(in.toSeq.sorted, cp.files, out, so)
|
||||
Set(outputDir)
|
||||
}
|
||||
f(sources.value.toSet)
|
||||
outputDir
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue