Skip to content

Associates or friends leak the internals of their compile classpath #1021

@Bencodes

Description

@Bencodes

The flatten jar macro currently collects the entire compilation classpath of any target passed is as an associate which gives access to all of the Kotlin internal functions of not just the direct associate dependencies, but all of the compile time jars provided by the associate dependencies.

def _flatten_jars(nested_jars_depset):
"""Returns a list of strings containing the compile_jars for depset of targets.
This ends up unwinding the nesting of depsets, since compile_jars contains depsets inside
the nested_jars targets, which themselves are depsets. This function is intended to be called
lazily form within Args.add_all(map_each) as it collapses depsets.
"""
compile_jars_depsets = [
target[JavaInfo].compile_jars
for target in nested_jars_depset.to_list()
if target[JavaInfo].compile_jars
]
return [file.path for file in depset(transitive = compile_jars_depsets).to_list()]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions