Skip to content

Minor legacy code smell: Context.dist_dir is a quite different place to Bootstrap.dist_dir #1626

Description

I found a minor legacy code smell but it is rather confusing for newcomers and myself alike:

Context.dist_dir is a quite different place to Bootstrap.dist_dir: the former is the entire "dists" directory with all distributions, the latter is actually the specific one for the current build. So to get the distribution folder during the build, ctx.dist_dir is actually wrong, but ctx.bootstrap.dist_dir is correct - at least if I'm not mistaken. The relevant code commend in build.py in the Context class definition is also pretty much wrong, or at best misleading:

# the Android project folder where everything ends up
dist_dir = None

(it's not the Android project folder itself but the parent, since ctx.dist_dir != ctx.bootstrap.dist_dir)

This naming is confusing and IMHO really should be changed. I think Context.dist_dir is a bad name and should be something different, since it's not actually where the final distribution is.

Suggestions? How do you all like ctx.dists_parent_dir instead of ctx.dist_dir? Open for other ideas

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions