-
-
Notifications
You must be signed in to change notification settings - Fork 644
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IntelliJ] Export only modulizable targets when in
export-dep-as-jar
(
#8812) ### Problem As an optimization for exporting source dependencies as jars, we want to export `target` entries only for targets that are either: - Target Roots, or - Between target roots (e.g. if A -> B -> C and we `./pants export-dep-as-jar :A :C`, we want `:B` to also be in the output). ### Solution Split the function `generate_targets_map` into three parts: 1.- We iterate over all targets to create the resource map. This is `O(|all_targets|)` 2.- We iterate over all targets to fill up the `graph_info['libraries']` section. This is also `O(|all_targets|)`. 3.- We calculate the modulizable targets (that fulfil the constraints above), and populate `targets_map` with entries for those. Figuring out the modulizable targets boils down to a call to `BuildGraph.transitive_dependees_of_addresses`, which is a DFS graph traversal. Populating `targets_map` can be quadratic, because for each modulizable target we must walk its transitive dependency graph to include all of those dependencies as libraries.
- Loading branch information
1 parent
ca9ed54
commit d33e078
Showing
4 changed files
with
237 additions
and
94 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.