add scala_platform to export output for metals!#8370
Merged
cosmicexplorer merged 2 commits intopantsbuild:masterfrom Oct 2, 2019
Merged
add scala_platform to export output for metals!#8370cosmicexplorer merged 2 commits intopantsbuild:masterfrom
cosmicexplorer merged 2 commits intopantsbuild:masterfrom
Conversation
stuhood
approved these changes
Oct 1, 2019
olafurpg
approved these changes
Oct 1, 2019
Contributor
olafurpg
left a comment
There was a problem hiding this comment.
This is great! Thank you. I’ll update the Metals PR to use the new Scala platform key if it exists with a fallback to the current workaround.
Contributor
|
Thanks, @cosmicexplorer ! looks good. One thing we need to bump the export version from |
Contributor
Contributor
Author
|
@wisechengyi bumped the export format version and added docs, and also added testing! It required adding a lot of new targets in order to allow the export task to pull the scala platform jars, which will always be injected in a normal pants build, but not in v1 task tests such as this. |
wisechengyi
approved these changes
Oct 2, 2019
cosmicexplorer
added a commit
to cosmicexplorer/pants
that referenced
this pull request
Oct 2, 2019
)" This commit failed to pass CI. This reverts commit b6981e5.
cosmicexplorer
added a commit
that referenced
this pull request
Oct 2, 2019
#8370 was broken, and I failed to ensure it passed CI before merging it. See e.g. the failure [here](https://travis-ci.org/pantsbuild/pants/jobs/592373373).
cosmicexplorer
added a commit
to cosmicexplorer/pants
that referenced
this pull request
Oct 2, 2019
…sbuild#8370)" (pantsbuild#8379)" This reverts commit f673fd2.
illicitonion
pushed a commit
that referenced
this pull request
Oct 3, 2019
This reverts commit ccf3a2a, as the export integration test is also still failing on master (and has been since #8370, see https://travis-ci.org/pantsbuild/pants/jobs/592397888).
cosmicexplorer
added a commit
to cosmicexplorer/pants
that referenced
this pull request
Oct 4, 2019
…antsbuild#8380)" (pantsbuild#8386)" This reverts commit d2bf825.
cosmicexplorer
added a commit
that referenced
this pull request
Oct 4, 2019
…8389) ### Problem See #8370. This PR fixes an integration test failure which required reverting in #8379, then we attempted to unrevert in #8380, then was reverted again in #8386. ### Solution - Remove the `--ivy-cache-dir` arguments from the export task invocation in the export integration test. ### Result The test passes!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
We would like to support the Metals VSCode plugin -- see associated PR at scalameta/metals#935. Pants currently does not have any fields which specifically provide the scala version and the compiler jars, so that PR currently iterates over the
librarieskeys, which doesn't provide all the scala compiler jars.Solution
Add a
scala_platformkey to the./pants exportoutput containing thescala_versionandcompiler_classpath:{ ..., "scala_platform": { "scala_version": "2.12", "compiler_classpath": [ "/path/to/scala-compiler-2.12.8.jar", "/path/to/scala-library-2.12.8.jar", ... ] }Result
Using the branch at https://github.com/cosmicexplorer/language-server/tree/sohamr/add-pants-build-tool (which is based off of scalameta/metals#935), I have been able to show that metals can extract the
scala_platformfrom the json!