Add test target to run all tests in gwt2, including generated dependencies #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch uses the guide at https://docs.bazel.build/versions/master/generate-workspace.html and the linked project there to generate all dependencies required to run tests. The
generate-workspace.bzl
file is left entirely generated (to ease re-generating it later), though is not perfect, so several dependencies had to be listed manually. These fell into three categories: those which the generate-workspace project failed to correctly fetch from maven central due to some error while running, those likechecker-compat-qual
which didn't seem to get noticed at all (compile-time dep that gwt needs to see?), and those with classifiers which were ignored (sources for jsinterop-annotations, and truth's gwt classifier).The build_defs/repo:maven_rules.bzl is used to replace the native.maven_jar in WORKSPACE as the native rule seems to not understand classifiers anyway.
I do have an alternative patch weighing in at just under half the size of this one, but instead of being 95% generated code, that one is entirely handwritten and may require more manual effort to maintain.
It seems likely that the actual test rule (and gwt-user/gwt-dev dependencies) could be factored out into a reusable rule for gwt2 test cases, but I'm not yet aware of any other bazel-based projects using gwt2.