Skip to content

Fix scaladoc cmd test #13023

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions project/scripts/cmdTests
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ dist/target/pack/bin/scaladoc \
"-skip-by-regex:.+\.impl($|\..+)" \
-project-logo docs/logo.svg \
-social-links:github::https://github.com/lampepfl/dotty,gitter::https://gitter.im/scala/scala,twitter::https://twitter.com/scala_lang \
-Ygenerate-inkuire \
"-skip-by-id:scala.runtime.stdLibPatches" \
"-skip-by-id:scala.runtime.MatchCase" \
-project-footer "Copyright (c) 2002-2021, LAMP/EPFL" \
Expand Down
8 changes: 8 additions & 0 deletions scaladoc/src/dotty/tools/scaladoc/Inkuire.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ object Inkuire {

var db = InkuireDb(Seq.empty, Map.empty, Seq.empty)

def beforeSave(): Unit = {
db = db.copy(
functions = db.functions.sortBy(_.hashCode),
types = db.types.toSeq.sortBy(_._1.uuid).toMap,
implicitConversions = db.implicitConversions.sortBy(_._1.uuid)
)
}

def generateInkuireConfig(externalMappings: Seq[String]): String = {
val paths = ("../inkuire-db.json" +: externalMappings.map(_ + "../inkuire-db.json")).map(jsonString)
jsonObject(("inkuirePaths", jsonList(paths))).toString
Expand Down
1 change: 1 addition & 0 deletions scaladoc/src/dotty/tools/scaladoc/Scaladoc.scala
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ object Scaladoc:
val dbFile = dbPath.toFile()
dbFile.createNewFile()
val dbWriter = new FileWriter(dbFile, false)
Inkuire.beforeSave()
dbWriter.write(s"${EngineModelSerializers.serialize(Inkuire.db)}")
dbWriter.close()

Expand Down