Skip to content

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

Closed

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

Activity

  1. inclement commented on Jan 30, 2019

    @inclement
    Member

    Based on the comment, I think this is actually a bug (i.e. originally it was intended to be what the comment says). Thanks for pointing it out.

    dists_parent_dir sounds good for me, or dists_root_dir or anything like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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