Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved layer grouping #1326

Merged
merged 2 commits into from
Apr 27, 2020
Merged

Improved layer grouping #1326

merged 2 commits into from
Apr 27, 2020

Commits on Apr 6, 2020

  1. Improved layer grouping

    The main purpose of this change is to make layer grouping more robust.
    Instead of using a heuristic based on whether a library is in the same
    `organization` as the build (which is not always what you want, some
    builds may have sub projects with different organizations, and some
    builds may depend on external dependencies from the same organization),
    it checks whether the library in question is present in
    `projectDependencyArtifacts` (ie, whether its a dependency built by
    this build), if it is, then it goes in a higher layer.
    
    Doing this change however required changing `dockerLayerGrouping` to be
    a `TaskKey` instead of a `SettingKey`, which is a non binary compatible
    change. So, `dockerLayerGrouping` has been deprecated, and a new
    `TaskKey`, `dockerGroupLayers` has been introduced.
    
    Since a new task has been introduced, I also took advantage of that to
    improve the types, instead of just passing the destination path, which
    requires you to know how destination paths are built to check if a
    particular file should be in there, it passes the whole mapping, ie, the
    source file and the destination path, which means that you can match
    against the source file (which is what `projectDependencyArtifacts`
    gives you) as well. Also, I changed the type from a function that
    returns an `Option` to a `PartialFunction`, this makes composing it, to
    introduce new mappings, far simpler, as `PartialFunction[_, _]` composes
    trivially compared to `Function[_, Option[_]]`.
    jroper committed Apr 6, 2020
    Configuration menu
    Copy the full SHA
    d47d4fb View commit details
    Browse the repository at this point in the history

Commits on Apr 27, 2020

  1. Configuration menu
    Copy the full SHA
    0ff6cb5 View commit details
    Browse the repository at this point in the history