Skip to content

Commit

Permalink
### Problem
Browse files Browse the repository at this point in the history
J2Objc pruner would crash when encountering a target without an explicit target such as "//some/path/to/target" instead of "//some/path/to/target:target"

### Solution
Added support for importing dependencies that are the same name as the directory.

PiperOrigin-RevId: 521881825
Change-Id: I4384a2468b92c5964dc8665f49b28a5c816f6bda
  • Loading branch information
Googler authored and copybara-github committed Apr 4, 2023
1 parent 08a8f6a commit 177f0d4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tools/objc/j2objc_dead_code_pruner_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,14 @@ def BuildArtifactSourceTree(files, file_open=open):
for filename in files.split(','):
with file_open(filename, 'r') as f:
for line in f:
entry = line.strip().split(':')[0]
dep = line.strip().split(':')[1]
split = line.strip().split(':')
entry = split[0]
if len(split) == 1:
# The build system allows for adding just the entry if the dependency
# is the same name
dep = split[0]
else:
dep = split[1]
if entry in tree:
tree[entry].append(dep)
else:
Expand Down

0 comments on commit 177f0d4

Please sign in to comment.