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

Create libraries for non python target when import dep as jar #465

Merged

Conversation

blorente
Copy link
Contributor

@blorente blorente commented Dec 17, 2019

The follow-up change to pantsbuild/pants#8812.

Problem

Since we will now be relying on libraries as a mechanism to express dependencies between targets, we need to process the libraries field for jvm executables as well.

Solution

Relax the filter in PantsLibrariesExtension to process any scala target (not just JarLibraries).

Result:

In combination with the pants PR above, the following UX is achieved:
pantsbuild/pants#8812 (comment)

Borja Lorente and others added 9 commits December 19, 2019 16:42
Before this commit, the list of the targets were stored in
`PantsProjectSettings::myTargetSpecs` field. Unfortunately, this list was based on the
contents of `myTargetSpecsBox` widget, which was cleared each time
when the "Pants->Settings" window was opened. As a result, the list
of targets was cleared each time during settings save.

The fix to this is just not to clean the list of targets in the
window.

But this led to a new issue. When the list of targets is presented
to the user, it's also possible for him to deselect target. During
save, the `myTargetSpecs` variable was based on the list of selected
targets, so after deselection and save, it was not possible to select
it again.

In order to overcome this, I put two lists to `PantsProjectSettings`
instead of `myTargetSpecs`:

 1. `allAvailableTargetSpecs` - used to build `myTargetSpecsBox` widget
 2. `selectedTargetSpecs` - to inform `pants` which targets it should
operate on

fixes pantsbuild#457
@wisechengyi wisechengyi changed the title Also create libraries for binary modules Create libraries for non python target under import dep as jar Dec 21, 2019
@wisechengyi wisechengyi changed the title Create libraries for non python target under import dep as jar Create libraries for non python target when import dep as jar Dec 21, 2019
Copy link
Collaborator

@wisechengyi wisechengyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @blorente !

@wisechengyi wisechengyi merged commit c832d9d into pantsbuild:master Jan 2, 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.

2 participants