Skip to content

Allowing override LastUpgradeCheck and LastUpgradeVersion#1013

Merged
yonaskolb merged 5 commits intoyonaskolb:masterfrom
Andre113:last-upgrade-override
Apr 8, 2021
Merged

Allowing override LastUpgradeCheck and LastUpgradeVersion#1013
yonaskolb merged 5 commits intoyonaskolb:masterfrom
Andre113:last-upgrade-override

Conversation

@Andre113
Copy link
Copy Markdown
Contributor

@Andre113 Andre113 commented Feb 1, 2021

Xcode will check for the value of LastUpgradeCheck and LastUpgradeVersion to display some warnings related to a recommended iOS deployment target. Just like this:

In some cases, it is not possible to change the deployment target because we still have to support some old iOS versions, and then the warnings stays there forever. This is really bad when we have a large number of targets.

With these changes, we can specify a different value for LastUpgradeCheck in project.yml . Like this:

name: MyApp

atributes:
  LastUpgradeCheck: '8.3'

configs:
  Debug: debug
  Homolog: debug
  Release: release
configFiles:
  Debug: Configs/DebugBase.xcconfig
  Homolog: Configs/HomologBase.xcconfig
  Release: Configs/ProdBase.xcconfig

This way, the warnings should be gone.

if !projectAttributes.contains(where: { (key, value) -> Bool in
key == lastUpgradeKey && value is String
}) {
projectAttributes[lastUpgradeKey] = project.xcodeVersion
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is the same as before, but it only replaces the key if it's a string, correct? Were you running into cases where devs were putting numbers in the project attributes?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost. It will replace the key if the user did not specify a value for LastUpgradeCheck or if this value is not a string. In this case, it will keep the same behavior as today, using the project.xcodeVersion value.
I just felt it would be safer to validade if the value we're inserting is a String to avoid any strange values.

@yonaskolb
Copy link
Copy Markdown
Owner

Thanks @Andre113. Could you add a changelog entry as well

@Andre113
Copy link
Copy Markdown
Contributor Author

Thanks @Andre113. Could you add a changelog entry as well

Sure! Just updated it. I also modified the readme to update the information regard the LastUpgradeCheck property.

@yonaskolb
Copy link
Copy Markdown
Owner

Thanks @Andre113. We’ve had a release since you added your change log entry so could you move it up into the Next Version section

@Andre113
Copy link
Copy Markdown
Contributor Author

Thanks @Andre113. We’ve had a release since you added your change log entry so could you move it up into the Next Version section

Oops.
Done, just updated it.

@Andre113 Andre113 requested a review from yonaskolb February 25, 2021 18:33
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

Successfully merging this pull request may close these issues.

2 participants