Skip to content

Commit e008975

Browse files
authored
Backport add default scaladoc settings to scaladoc artifact publishing (#16776)
2 parents 02717b6 + 033a3b8 commit e008975

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

project/Build.scala

+7-2
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,7 @@ object Build {
843843
"-sourcepath", (Compile / sourceDirectories).value.map(_.getAbsolutePath).distinct.mkString(File.pathSeparator),
844844
"-Yexplicit-nulls",
845845
),
846+
(Compile / doc / scalacOptions) ++= ScaladocConfigs.DefaultGenerationSettings.value.settings
846847
)
847848

848849
lazy val `scala3-library` = project.in(file("library")).asDottyLibrary(NonBootstrapped)
@@ -1892,8 +1893,7 @@ object ScaladocConfigs {
18921893
)
18931894
}
18941895

1895-
lazy val DefaultGenerationConfig = Def.task {
1896-
def distLocation = (dist / pack).value
1896+
lazy val DefaultGenerationSettings = Def.task {
18971897
def projectVersion = version.value
18981898
def socialLinks = SocialLinks(List(
18991899
"github::https://github.com/lampepfl/dotty",
@@ -1934,6 +1934,11 @@ object ScaladocConfigs {
19341934
)
19351935
}
19361936

1937+
lazy val DefaultGenerationConfig = Def.task {
1938+
def distLocation = (dist / pack).value
1939+
DefaultGenerationSettings.value
1940+
}
1941+
19371942
lazy val Scaladoc = Def.task {
19381943
DefaultGenerationConfig.value
19391944
.add(UseJavacp(true))

project/ScaladocGeneration.scala

+4
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ object ScaladocGeneration {
141141
def remove[T <: Arg[_]: ClassTag]: GenerationConfig
142142
def withTargets(targets: Seq[String]): GenerationConfig
143143
def serialize: String
144+
def settings: Seq[String]
144145
}
145146

146147
object GenerationConfig {
@@ -173,6 +174,9 @@ object ScaladocGeneration {
173174
++ targets
174175
).mkString(" ")
175176

177+
override def settings: Seq[String] =
178+
args.map(_.serialize) ++ targets
179+
176180
private def argsWithout[T <: Arg[_]](
177181
implicit tag: ClassTag[T]
178182
): (Option[T], Seq[Arg[_]]) = args.foldLeft[(Option[T], Seq[Arg[_]])]((None, Seq.empty)) {

0 commit comments

Comments
 (0)