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

Question: Merging different configuration results #755

Open
Lommelun opened this issue Jun 13, 2024 · 1 comment
Open

Question: Merging different configuration results #755

Lommelun opened this issue Jun 13, 2024 · 1 comment

Comments

@Lommelun
Copy link

I read this line in the readme

Run Periphery once for each build configuration and merge the results. You can pass arguments to the underlying build by specifying them after --, e.g periphery scan ... -- -configuration release.

And I'm not sure what is meant by merging the results? My understanding of this means that I get the results, then merge the results–meaning that the same individual results will be the same, while new individual results will be added together; thus in this example both will be unused?

periphery scan ... -- -configuration debug
struct BuildInfo {
    let debugName = "debug"
    let releaseName = "release" // 'releaseName' is unused

    var name: String {
        #if DEBUG
        debugName
        #else
        releaseName
        #endif
    }
}
periphery scan ... -- -configuration release
struct BuildInfo {
    let debugName = "debug" // 'debugName' is unused
    let releaseName = "release"

    var name: String {
        #if DEBUG
        debugName
        #else
        releaseName
        #endif
    }
}
... merge results ...
struct BuildInfo {
    let debugName = "debug" // 'debugName' is unused
    let releaseName = "release"  // 'releaseName' is unused

    var name: String {
        #if DEBUG
        debugName
        #else
        releaseName
        #endif
    }
}

Or am I misunderstanding how and what you mean by merging the results?

@kattouf
Copy link

kattouf commented Sep 5, 2024

I believe the intention is to use the intersection of results from all runs. Here’s how you could approach it:

  1. Run Periphery for each configuration and export the results in a machine-readable format:

    --format <format>       Output format (allowed: xcode, csv, json, checkstyle, codeclimate, github-actions) 
                            (default: xcode)
  2. Read and convert the results into arrays that are easy to compare in any language you use.

  3. Use the intersection of these arrays to find common results across all configurations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants