periphery
periphery copied to clipboard
Question: Merging different configuration results
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?
I believe the intention is to use the intersection of results from all runs. Here’s how you could approach it:
-
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) -
Read and convert the results into arrays that are easy to compare in any language you use.
-
Use the intersection of these arrays to find common results across all configurations.