Skip to content

Commit 0e1b0ca

Browse files
committed
Correction for the support scaladoc
1 parent 8855291 commit 0e1b0ca

File tree

3 files changed

+70
-15
lines changed

3 files changed

+70
-15
lines changed

dist/bin/common

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,34 @@ fi
131131
#/*--------------------------------------------------
132132
# * The code below is for Dotty
133133
# *-------------------------------------------------*/
134+
# Try to autodetect real location of the script
135+
if [ -z "${PROG_HOME-}" ] ; then
136+
## resolve links - $0 may be a link to PROG_HOME
137+
PRG="$0"
138+
139+
# need this for relative symlinks
140+
while [ -h "$PRG" ] ; do
141+
ls=`ls -ld "$PRG"`
142+
link=`expr "$ls" : '.*-> \(.*\)$'`
143+
if expr "$link" : '/.*' > /dev/null; then
144+
PRG="$link"
145+
else
146+
PRG="`dirname "$PRG"`/$link"
147+
fi
148+
done
149+
150+
saveddir=`pwd`
151+
152+
PROG_HOME=`dirname "$PRG"`/..
153+
154+
# make it fully qualified
155+
PROG_HOME=`cd "$PROG_HOME" && pwd`
156+
157+
cd "$saveddir"
158+
fi
134159

135160
find_lib () {
136-
for lib in "$PROG_HOME"/lib/$1 ; do
161+
for lib in $saveddir/dist/target/pack/lib/$1 ; do
137162
if [[ -f "$lib" ]]; then
138163
if [ -n "$CYGPATHCMD" ]; then
139164
"$CYGPATHCMD" -am "$lib"
@@ -220,4 +245,4 @@ addResidual () {
220245
}
221246
addScript () {
222247
script_args+=("'$1'")
223-
}
248+
}

dist/bin/scaladoc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if [ -z "${PROG_HOME-}" ] ; then
2828
cd "$saveddir"
2929
fi
3030

31-
source "$PROG_HOME/bin/common"
31+
source "$saveddir/dist/bin/common"
3232
default_java_opts="-Xmx768m -Xms768m"
3333
withCompiler=true
3434

@@ -129,14 +129,14 @@ echo "----------"
129129
echo $jvm_cp_args | grep tables
130130
echo "----------"
131131

132-
eval "\"$JAVACMD\"" \
133-
${JAVA_OPTS:-$default_java_opts} \
134-
"${java_args[@]}" \
135-
"${jvm_cp_args-}" \
136-
-Dscala.usejavacp=true \
137-
"dotty.tools.scaladoc.Main" \
138-
"${scala_args[@]}" \
139-
"${residual_args[@]}" \
140-
"${scripting_string-}"
141-
scala_exit_status=$?
142-
onExit
132+
# eval "\"$JAVACMD\"" \
133+
# ${JAVA_OPTS:-$default_java_opts} \
134+
# "${java_args[@]}" \
135+
# "${jvm_cp_args-}" \
136+
# -Dscala.usejavacp=true \
137+
# "dotty.tools.scaladoc.Main" \
138+
# "${scala_args[@]}" \
139+
# "${residual_args[@]}" \
140+
# "${scripting_string-}"
141+
# scala_exit_status=$?
142+
# onExit

project/scripts/cmdScaladocTests

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
#!/usr/bin/env bash
22

3+
# Try to autodetect real location of the script
4+
if [ -z "${PROG_HOME-}" ] ; then
5+
## resolve links - $0 may be a link to PROG_HOME
6+
PRG="$0"
7+
8+
# need this for relative symlinks
9+
while [ -h "$PRG" ] ; do
10+
ls=`ls -ld "$PRG"`
11+
link=`expr "$ls" : '.*-> \(.*\)$'`
12+
if expr "$link" : '/.*' > /dev/null; then
13+
PRG="$link"
14+
else
15+
PRG="`dirname "$PRG"`/$link"
16+
fi
17+
done
18+
19+
saveddir=`pwd`
20+
21+
PROG_HOME=`dirname "$PRG"`/..
22+
23+
# make it fully qualified
24+
PROG_HOME=`cd "$PROG_HOME" && pwd`
25+
26+
cd "$saveddir"
27+
fi
28+
329
source $(dirname $0)/cmdTestsCommon.inc.sh
430

531
echo "testing scaladoc script"
@@ -20,8 +46,12 @@ SOURCE_LINKS_REPOSITORY="lampepfl/dotty"
2046
SOURCE_LINKS_VERSION="${GITHUB_SHA:-$DOTTY_BOOTSTRAPPED_VERSION}"
2147

2248
"$SBT" "scaladoc/generateTestcasesDocumentation" > "$tmp" 2>&1 || echo "generated testcases project with sbt"
49+
50+
source "$saveddir/dist/target/pack/bin/scaladoc"
51+
2352
dist/target/pack/bin/scaladoc \
2453
-d "$OUT1" \
54+
$jvm_cp_args \
2555
-project "scaladoc testcases" \
2656
-source-links:out/bootstrap/stdlib-bootstrapped/scala-"${DOTTY_NONBOOTSTRAPPED_VERSION}"/src_managed/main/scala-library-src=github://scala/scala/v"${STDLIB_VERSION}"#src/library \
2757
-source-links:out/bootstrap/stdlib-bootstrapped/scala-"${DOTTY_NONBOOTSTRAPPED_VERSION}"/src_managed/main/dotty-library-src=github://"${SOURCE_LINKS_REPOSITORY}"/"${SOURCE_LINKS_VERSION}"\#library/src \
@@ -42,4 +72,4 @@ dist/target/pack/bin/scaladoc \
4272
-author -groups -revision main -project-version "${DOTTY_BOOTSTRAPPED_VERSION}" \
4373
"-quick-links:Learn::https://docs.scala-lang.org/,Install::https://www.scala-lang.org/download/,Playground::https://scastie.scala-lang.org,Find A Library::https://index.scala-lang.org,Community::https://www.scala-lang.org/community/,Blog::https://www.scala-lang.org/blog/," \
4474
out/bootstrap/scaladoc-testcases/scala-"${DOTTY_NONBOOTSTRAPPED_VERSION}"/classes > "$tmp" 2>&1 || echo "generated testcases project with scripts"
45-
diff -rq "$OUT1" "scaladoc/output/testcases"
75+
diff -rq "$OUT1" "scaladoc/output/testcases"

0 commit comments

Comments
 (0)