-
Notifications
You must be signed in to change notification settings - Fork 45
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
Add build phases comparator #38
Add build phases comparator #38
Conversation
Signed-off-by: Marcin Iwanicki <[email protected]>
Signed-off-by: Marcin Iwanicki <[email protected]>
f52bbd0
to
1b5d80b
Compare
Codecov Report
@@ Coverage Diff @@
## master #38 +/- ##
==========================================
+ Coverage 94.82% 95.01% +0.19%
==========================================
Files 39 40 +1
Lines 1663 1787 +124
==========================================
+ Hits 1577 1698 +121
- Misses 86 89 +3
Continue to review full report at Codecov.
|
Signed-off-by: Marcin Iwanicki <[email protected]>
Signed-off-by: Marcin Iwanicki <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
As a suggestion, to help identify missing build phases we could still offer displaying "only in first" and "only in second"
via:
return result(context: context,
first: Set(firstDescriptors.map { $0.description }),
second: Set(secondDescriptors.map { $0.description }),
differentValues: differentValues)
This would produce:
$ cd Fixtures
$ xcdiff -g build_phases -v
❌ BUILD_PHASES > "MismatchingLibrary" target
⚠️ Only in first (1):
• name = CopyFiles, type = copyFiles, runOnlyForDeploymentPostprocessing = false
⚠️ Only in second (2):
• name = Headers, type = headers, runOnlyForDeploymentPostprocessing = false
• name = Resources, type = resources, runOnlyForDeploymentPostprocessing = false
⚠️ Value mismatch (4):
• Build Phase 1
◦ name = Sources, type = sources, runOnlyForDeploymentPostprocessing = false
◦ name = Headers, type = headers, runOnlyForDeploymentPostprocessing = false
• Build Phase 2
◦ name = Frameworks, type = frameworks, runOnlyForDeploymentPostprocessing = false
◦ name = Sources, type = sources, runOnlyForDeploymentPostprocessing = false
• Build Phase 3
◦ name = CopyFiles, type = copyFiles, runOnlyForDeploymentPostprocessing = false
◦ name = Frameworks, type = frameworks, runOnlyForDeploymentPostprocessing = false
• Build Phase 4
◦ nil
◦ name = Resources, type = resources, runOnlyForDeploymentPostprocessing = false
✅ BUILD_PHASES > "Project" target
✅ BUILD_PHASES > "ProjectFramework" target
✅ BUILD_PHASES > "ProjectTests" target
✅ BUILD_PHASES > "ProjectUITests" target
If we go for the onlyInFirst / onlyInSecond maybe we could summarise the value differences?
⚠️ Value mismatch (1):
• Build Phase Order
◦ Sources, Frameworks, CopyFiles
◦ Headers, Sources, Frameworks, Resources
Guess there will always be some duplication, what you have is a good start either way to allow us to test this out further.
4203515
to
54357f4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Nice work
@@ -0,0 +1,176 @@ | |||
// | |||
// Copyright 2019 Bloomberg Finance L.P. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: the copyright year is now 2020 :p
]) | ||
} | ||
|
||
func testCompare_whenTwoBuildPhasesOfSameTypeOnlyInFirstSameOrder() throws { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
cf81ebe
to
fad7650
Compare
Signed-off-by: Marcin Iwanicki <[email protected]>
2eaa6c7
to
21bc496
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can add specific copy phase / script phase comparators as follow ups
Partially resolves: #17
Describe your changes
Added a new comparator to compare lists of build phases from two projects. The comparison is slightly more complicated to give clear output for most common cases i.e. missing a single build phase in one of the projects, the same build phases but in different order, or different properties in one of the projects.
Testing performed
xcdiff -p1 <original> -p2 <copy> -g build_phases -v
, make sure all the differences are listed.