Skip to content
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

Enable building scala versions in the same bazel invocation #1

Merged
merged 21 commits into from
Jan 25, 2020

Conversation

smparkes
Copy link
Owner

@smparkes smparkes commented Jan 23, 2020

Work in progres on supporting multiple versions of scala within the same bazel command.

It uses toolchains to wrap up all the version-dependent stuff but doesn't use toolchain/platform resolution. I haven't been able to come up with any way of using transitions to get the desired impact.

So I added optional toolchain and provider attributes in a few places. If they aren't used, the normal toolchain resolution is used and the user can select the desired version by registering the desired toolchain.

If you don't want a default version, you just don't register a toolchain and you'll get an error for any scala target that doesn't provide a toolchain.

It feels like this will migrate fairly easily to more advanced toolchain resolution when that surfaces in bazel.

There's a bunch of stuff to be completed/cleaned up/made more general. So at this point, a WIP.

@smparkes
Copy link
Owner Author

Hrm ... still learning. bazel's standard toolchains is what I was looking for. Didn't understand how to use it but have a better idea now.

smparkes and others added 10 commits January 24, 2020 09:24
…ild#949)

* Init

* Pass bazel test //test/... with single _adjust_resources_path

* adjust_resources_path returns string instead of tuple

* remove prefix handling from ScalacProcessor.copyResources

* Remove unused method

* Remove resourceStripPrefix from CompileOptions

* Remove special path handling from ScalacProcessor because it is done in rule_impls.bzl

* Fix macro visibility

* Remove print

* Formatting

* Add comments

* more test cases

* lint

* Rebase on master

* extract resources.bzl
@smparkes smparkes merged commit 7b5b3c1 into master Jan 25, 2020
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.

5 participants