Skip to content

Commit

Permalink
Merge pull request scala#13360 from lampepfl/backport-scaladoc-test-f…
Browse files Browse the repository at this point in the history
…ixes

Backport scaladoc test fixes
  • Loading branch information
Kordyjan authored Aug 23, 2021
2 parents b90fad7 + 6ad7540 commit b8b980d
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 25 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/scaladoc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ jobs:
run: ./project/scripts/sbt scaladoc-js/test

- name: Compile and test
run: ./project/scripts/sbt scaladoc/test
run: |
./project/scripts/sbt scaladoc/test
./project/scripts/cmdScaladocTests
- name: Locally publish self
run: ./project/scripts/sbt scaladoc/publishLocal
Expand Down
2 changes: 1 addition & 1 deletion project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@ object Build {
val distLocation = (dist / pack).value
val projectVersion = version.value
IO.createDirectory(file(outDir))
val stdLibVersion = stdlibVersion(Bootstrapped)
val stdLibVersion = stdlibVersion(NonBootstrapped)
val scalaLib = findArtifactPath(externalCompilerClasspathTask.value, "scala-library")
val dottyLib = (`scala3-library` / Compile / classDirectory).value
// TODO add versions etc.
Expand Down
37 changes: 37 additions & 0 deletions project/scripts/cmdScaladocTests
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash

source $(dirname $0)/cmdTestsCommon.inc.sh

echo "testing scaladoc script"
clear_out "$OUT"
clear_out "$OUT1"


STDLIB_COMMAND="$SBT \"eval println(Build.stdlibVersion(Modes.NonBootstrapped))\""
STDLIB_VERSION=$(eval $STDLIB_COMMAND | tail -n 2 | head -n 1)

DOTTY_NONBOOTSTRAPPED_VERSION_COMMAND="$SBT \"eval println(Build.dottyNonBootstrappedVersion)\""
DOTTY_NONBOOTSTRAPPED_VERSION=$(eval $DOTTY_NONBOOTSTRAPPED_VERSION_COMMAND | tail -n 2 | head -n 1)

DOTTY_BOOTSTRAPPED_VERSION_COMMAND="$SBT \"eval println(Build.dottyVersion)\""
DOTTY_BOOTSTRAPPED_VERSION=$(eval $DOTTY_BOOTSTRAPPED_VERSION_COMMAND | tail -n 2 | head -n 1)

"$SBT" "scaladoc/generateTestcasesDocumentation" > "$tmp" 2>&1 || echo "generated testcases project with sbt"
dist/target/pack/bin/scaladoc \
-d "$OUT1" \
-project "scaladoc testcases" \
-source-links:out/bootstrap/stdlib-bootstrapped/scala-"${DOTTY_NONBOOTSTRAPPED_VERSION}"/src_managed/main/scala-library-src=github://scala/scala/v"${STDLIB_VERSION}"#src/library \
-source-links:out/bootstrap/stdlib-bootstrapped/scala-"${DOTTY_NONBOOTSTRAPPED_VERSION}"/src_managed/main/dotty-library-src=github://"${GITHUB_REPOSITORY}"/"${GITHUB_SHA}"\#library/src \
-source-links:github://"${GITHUB_REPOSITORY}"/"${GITHUB_SHA}" \
"-external-mappings:.*scala.*::scaladoc3::https://dotty.epfl.ch/api/,.*java.*::javadoc::https://docs.oracle.com/javase/8/docs/api/" \
"-skip-by-regex:.+\.internal($|\..+)" \
"-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" \
-author -groups -revision master -project-version "${DOTTY_BOOTSTRAPPED_VERSION}" \
out/bootstrap/scaladoc-testcases/scala-"${DOTTY_NONBOOTSTRAPPED_VERSION}"/classes > "$tmp" 2>&1 || echo "generated testcases project with scripts"
diff -rq "$OUT1" "scaladoc/output/testcases"
23 changes: 0 additions & 23 deletions project/scripts/cmdTests
Original file line number Diff line number Diff line change
Expand Up @@ -61,29 +61,6 @@ echo "testing -Ythrough-tasty"
clear_out "$OUT"
"$SBT" ";scalac -Ythrough-tasty $SOURCE"

echo "testing scaladoc script"
clear_out "$OUT"
clear_out "$OUT1"
"$SBT" "scaladoc/generateTestcasesDocumentation" > "$tmp" 2>&1 || echo "generated testcases project with sbt"
dist/target/pack/bin/scaladoc \
-d "$OUT1" \
-project "scaladoc testcases" \
-source-links:out/bootstrap/stdlib-bootstrapped/scala-3.0.2-RC1-bin-SNAPSHOT-nonbootstrapped/src_managed/main/scala-library-src=github://scala/scala/v2.13.6#src/library \
-source-links:out/bootstrap/stdlib-bootstrapped/scala-3.0.2-RC1-bin-SNAPSHOT-nonbootstrapped/src_managed/main/dotty-library-src=github://"${GITHUB_REPOSITORY}"/"${GITHUB_SHA}"\#library/src \
-source-links:github://"${GITHUB_REPOSITORY}"/"${GITHUB_SHA}" \
"-external-mappings:.*scala.*::scaladoc3::https://dotty.epfl.ch/api/,.*java.*::javadoc::https://docs.oracle.com/javase/8/docs/api/" \
"-skip-by-regex:.+\.internal($|\..+)" \
"-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" \
-author -groups -revision master -project-version 3.0.2-RC1-bin-SNAPSHOT \
out/bootstrap/scaladoc-testcases/scala-3.0.2-RC1-bin-SNAPSHOT-nonbootstrapped/classes > "$tmp" 2>&1 || echo "generated testcases project with scripts"
diff -rq "$OUT1" "scaladoc/output/testcases"

## Disabled because of flakeyness, should be changed to not depend on sbt
# echo "running Vulpix meta test"
# tmp=$(mktemp)
Expand Down

0 comments on commit b8b980d

Please sign in to comment.