mirror of https://github.com/sbt/sbt.git
Add scala3doc artifact
This commit is contained in:
parent
d282f3cb1f
commit
51d64c7eef
|
|
@ -48,6 +48,7 @@ object Configurations {
|
||||||
lazy val Pom = Configuration.of("Pom", "pom")
|
lazy val Pom = Configuration.of("Pom", "pom")
|
||||||
|
|
||||||
lazy val ScalaTool = Configuration.of("ScalaTool", "scala-tool").hide
|
lazy val ScalaTool = Configuration.of("ScalaTool", "scala-tool").hide
|
||||||
|
lazy val ScalaDocTool = Configuration.of("ScalaDocTool", "scala-doc-tool").hide
|
||||||
lazy val CompilerPlugin = Configuration.of("CompilerPlugin", "plugin").hide
|
lazy val CompilerPlugin = Configuration.of("CompilerPlugin", "plugin").hide
|
||||||
lazy val Component = Configuration.of("Component", "component").hide
|
lazy val Component = Configuration.of("Component", "component").hide
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,17 +13,20 @@ object ScalaArtifacts {
|
||||||
final val Scala3CompilerID = "scala3-compiler"
|
final val Scala3CompilerID = "scala3-compiler"
|
||||||
final val Scala3InterfacesID = "scala3-interfaces"
|
final val Scala3InterfacesID = "scala3-interfaces"
|
||||||
final val TastyCoreID = "tasty-core"
|
final val TastyCoreID = "tasty-core"
|
||||||
|
final val Scala3DocID = "scala3doc"
|
||||||
|
|
||||||
private[sbt] final val Scala3LibraryPrefix = Scala3LibraryID + "_"
|
private[sbt] final val Scala3LibraryPrefix = Scala3LibraryID + "_"
|
||||||
private[sbt] final val Scala3CompilerPrefix = Scala3CompilerID + "_"
|
private[sbt] final val Scala3CompilerPrefix = Scala3CompilerID + "_"
|
||||||
private[sbt] final val TastyCorePrefix = TastyCoreID + "_"
|
private[sbt] final val TastyCorePrefix = TastyCoreID + "_"
|
||||||
|
private[sbt] final val Scala3DocPrefix = Scala3DocID + "_"
|
||||||
|
|
||||||
def isScala2Artifact(name: String): Boolean = {
|
def isScala2Artifact(name: String): Boolean = {
|
||||||
name == LibraryID || name == CompilerID || name == ReflectID || name == ActorsID || name == ScalapID
|
name == LibraryID || name == CompilerID || name == ReflectID || name == ActorsID || name == ScalapID
|
||||||
}
|
}
|
||||||
def isScala3Artifact(name: String): Boolean = {
|
def isScala3Artifact(name: String): Boolean = {
|
||||||
name.startsWith(Scala3LibraryPrefix) || name.startsWith(Scala3CompilerPrefix) ||
|
name.startsWith(Scala3LibraryPrefix) || name.startsWith(Scala3CompilerPrefix) ||
|
||||||
name.startsWith(TastyCorePrefix) || name == Scala3InterfacesID
|
name.startsWith(TastyCorePrefix) || name == Scala3InterfacesID ||
|
||||||
|
name.startsWith(Scala3DocPrefix)
|
||||||
}
|
}
|
||||||
|
|
||||||
def isScala3(scalaVersion: String): Boolean = scalaVersion.startsWith("3.")
|
def isScala3(scalaVersion: String): Boolean = scalaVersion.startsWith("3.")
|
||||||
|
|
@ -48,6 +51,18 @@ object ScalaArtifacts {
|
||||||
ModuleID(org, LibraryID, version)
|
ModuleID(org, LibraryID, version)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private[sbt] def docToolDependencies(
|
||||||
|
org: String,
|
||||||
|
version: String
|
||||||
|
): Seq[ModuleID] =
|
||||||
|
if (isScala3(version)) {
|
||||||
|
Seq(
|
||||||
|
ModuleID(org, Scala3DocID, version)
|
||||||
|
.withConfigurations(Some(Configurations.ScalaDocTool.name + "->default(compile)"))
|
||||||
|
.withCrossVersion(CrossVersion.binary)
|
||||||
|
)
|
||||||
|
} else Seq.empty
|
||||||
|
|
||||||
private[sbt] def toolDependencies(
|
private[sbt] def toolDependencies(
|
||||||
org: String,
|
org: String,
|
||||||
version: String
|
version: String
|
||||||
|
|
@ -60,11 +75,11 @@ object ScalaArtifacts {
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
Seq(
|
Seq(
|
||||||
scalaToolDependency(org, CompilerID, version),
|
scala2ToolDependency(org, CompilerID, version),
|
||||||
scalaToolDependency(org, LibraryID, version)
|
scala2ToolDependency(org, LibraryID, version)
|
||||||
)
|
)
|
||||||
|
|
||||||
private[this] def scalaToolDependency(org: String, id: String, version: String): ModuleID =
|
private[this] def scala2ToolDependency(org: String, id: String, version: String): ModuleID =
|
||||||
ModuleID(org, id, version).withConfigurations(
|
ModuleID(org, id, version).withConfigurations(
|
||||||
Some(Configurations.ScalaTool.name + "->default,optional(default)")
|
Some(Configurations.ScalaTool.name + "->default,optional(default)")
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue