Skip to content

Commit 033a3b8

Browse files
KacperFKorbanszymon-rd
authored andcommitted
Add default scaladoc settings to scaladoc artifact publishing
1 parent a3321cc commit 033a3b8

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

project/Build.scala

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,7 @@ object Build {
839839
"-sourcepath", (Compile / sourceDirectories).value.map(_.getAbsolutePath).distinct.mkString(File.pathSeparator),
840840
"-Yexplicit-nulls",
841841
),
842+
(Compile / doc / scalacOptions) ++= ScaladocConfigs.DefaultGenerationSettings.value.settings
842843
)
843844

844845
lazy val `scala3-library` = project.in(file("library")).asDottyLibrary(NonBootstrapped)
@@ -1877,8 +1878,7 @@ object ScaladocConfigs {
18771878
)
18781879
}
18791880

1880-
lazy val DefaultGenerationConfig = Def.task {
1881-
def distLocation = (dist / pack).value
1881+
lazy val DefaultGenerationSettings = Def.task {
18821882
def projectVersion = version.value
18831883
def socialLinks = SocialLinks(List(
18841884
"github::https://github.com/lampepfl/dotty",
@@ -1919,6 +1919,11 @@ object ScaladocConfigs {
19191919
)
19201920
}
19211921

1922+
lazy val DefaultGenerationConfig = Def.task {
1923+
def distLocation = (dist / pack).value
1924+
DefaultGenerationSettings.value
1925+
}
1926+
19221927
lazy val Scaladoc = Def.task {
19231928
DefaultGenerationConfig.value
19241929
.add(UseJavacp(true))

project/ScaladocGeneration.scala

Lines changed: 4 additions & 0 deletions
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)