Skip to content

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

Merged
merged 2 commits into from
Nov 21, 2017

Conversation

rsoeldner
Copy link
Contributor

@nicolasstucki This addresses issue #3477

Copy link
Member

@dottybot dottybot left a 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! ☀️

Copy link
Contributor

@nicolasstucki nicolasstucki left a 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"
Copy link
Contributor

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"
Copy link
Contributor

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 $@"
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

@nicolasstucki nicolasstucki left a 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

@rsoeldner rsoeldner changed the title Add custom classpathto dotr script, #3477 Fix #3477: Add custom classpath to dotr script Nov 17, 2017
@nicolasstucki
Copy link
Contributor

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

@nicolasstucki
Copy link
Contributor

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[@]}"
Copy link
Contributor

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.

Copy link
Contributor Author

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

@rsoeldner
Copy link
Contributor Author

@nicolasstucki If everything is ok, I would rebase to a single commit.

@allanrenucci
Copy link
Contributor

I’d like to review this before we merge

@allanrenucci allanrenucci self-requested a review November 17, 2017 17:59
@allanrenucci allanrenucci force-pushed the dotr-classpath branch 2 times, most recently from b78111f to 808dea5 Compare November 20, 2017 19:08
@allanrenucci
Copy link
Contributor

@nicolasstucki can you review the last commit

@nicolasstucki nicolasstucki merged commit fbed6cc into scala:master Nov 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants