-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #3477: Add custom classpath to dotr script #3493
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, and thank you for opening this PR! 🎉
All contributors have signed the CLA, thank you! ❤️
Have an awesome day! ☀️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks :)
Could you change the commit message to Fix #3477: Add custom classpath to dotr script
to make GitHub link the issue with the PR.
dist/bin/dotr
Outdated
shift | ||
;; | ||
-classpath) | ||
CLASS_PATH+=":$2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably add the user-defined classpaths to the left of the classpath to give them the priority.
dist/bin/dotr
Outdated
shift | ||
;; | ||
-d) | ||
DEBUG="$DEBUG_STR" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this ever reached with the *)
before it?
dist/bin/dotr
Outdated
echo "Starting dotty REPL..." | ||
eval "$PROG_HOME/bin/dotc -repl" | ||
elif [[ ${first_arg:0:1} == "-" ]]; then | ||
eval "$PROG_HOME/bin/dotc -repl $@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should still be able to call the repl with a custom classpath and custom args. You can assume that the -repl
is set in that case and hence run_repl
should be true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok,
what about this behavior:
- If no arguments, start repl
- If additional arguments and the
-repl
flag, run repl with these arguments - Otherwise run it
I pushed this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dotr -repl
with custom classpath
You could also enable the two tests in https://github.com/lampepfl/dotty/blob/master/project/scripts/sbtBootstrappedTests#L29. That way we can avoid some regressions |
Otherwise the script code LGTM |
dist/bin/dotr
Outdated
|
||
if [ $run_repl == true ]; then | ||
echo "Starting dotty REPL" | ||
echo "$PROG_HOME/bin/dotc -classpath $CLASS_PATH -repl ${residual_args[@]}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here the classpath should only contain classpath_args
if it is not empty.
What does it mean exactly classpath_args[@]
? I'm not familiar with the [@]
part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nicolasstucki Afaik, the [*]
or [@]
subscripts differ only within double quotes, with [*]
each element inside the array is seperated by IFS
@nicolasstucki If everything is ok, I would rebase to a single commit. |
dc4d818
to
732e2a8
Compare
I’d like to review this before we merge |
b78111f
to
808dea5
Compare
808dea5
to
f49fbbe
Compare
f49fbbe
to
a477cd5
Compare
@nicolasstucki can you review the last commit |
@nicolasstucki This addresses issue #3477