-
Notifications
You must be signed in to change notification settings - Fork 823
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 deployment target #205
Conversation
Is |
I think
|
8854ea2
to
4472ff3
Compare
@allu22 Yeah fair enough. Another possible name would be Also the properties on |
55763fb
to
1379733
Compare
@@ -51,7 +52,7 @@ public struct ProjectSpec { | |||
} | |||
} | |||
|
|||
public init(carthageBuildPath: String? = nil, createIntermediateGroups: Bool = false, bundleIdPrefix: String? = nil, settingPresets: SettingPresets = .all, developmentLanguage: String? = nil, indentWidth: Int? = nil, tabWidth: Int? = nil, usesTabs: Bool? = nil, xcodeVersion: String? = nil) { | |||
public init(carthageBuildPath: String? = nil, createIntermediateGroups: Bool = false, bundleIdPrefix: String? = nil, settingPresets: SettingPresets = .all, developmentLanguage: String? = nil, indentWidth: Int? = nil, tabWidth: Int? = nil, usesTabs: Bool? = nil, xcodeVersion: String? = nil, platformVersions: PlatformVersions = .init()) { |
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.
I think you should consider adding more new-lines.
It's hard for reviewers to scroll horizontally to see what has changed.
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.
+1, is there a swift format setting to do this automatically?
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.
Will do 👍
@@ -953,6 +948,7 @@ | |||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; | |||
SWIFT_VERSION = 4.0; | |||
VALIDATE_PRODUCT = YES; | |||
WATCHOS_DEPLOYMENT_TARGET = 2.0; |
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.
Is this on purpose?
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.
Yeah, the TestProject spec adds this
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.
LGTM👌
return lhs.iOS == rhs.iOS && | ||
lhs.tvOS == rhs.tvOS && | ||
lhs.watchOS == rhs.watchOS && | ||
lhs.macOS == rhs.macOS |
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.
This will probably be fine but will fail for instances where you might compare "11" and "11.0" since we are dealing with string equality vs a structured representation of a semantic version
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.
That's true. We could potentially implement a proper Version type (or use a dependency, like Swift PM), but at the moment it's probably fine
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.
I think you could copy this implementation that I made for Sake https://github.com/xcodeswift/sake/blob/master/Sources/SakefileUtils/Version.swift that has the equatable defined. That'd solve this issue easily.
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.
Done. One change I had to make was have a getter on that version type that returns an Apple deployment version, as they use 9.0
not 9.0.0
public init(jsonDictionary: JSONDictionary) throws { | ||
|
||
func parseVersion(_ platform: String) -> String? { | ||
if let string: String = jsonDictionary.json(atKeyPath: .key(platform)) { |
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.
Should we just have the version input type as String
for simplicity?
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.
I just wanted to support the easy format of just iOS: 11.1
without wrapping it in a string
"bundleIdPrefix": "com.test", | ||
"createIntermediateGroups": true, | ||
"developmentLanguage": "ja", | ||
"platformVersions": ["iOS": 11.1, "tvOS": 10.0, "watchOS": "3.0", "macOS": "10.12" ] |
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.
Might be good for the test to have the case where we have 3 components to the version ("10.12.1" for example)
I think I will change this to |
|
||
extension Platform { | ||
|
||
public var versionBuildSetting: String { |
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.
I think it'd be great to unit test that this map is properly done.
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.
Just a minor comment. Nice addition @yonaskolb
406be17
to
cd6d179
Compare
This changes how platform versions are applied.
options.platformVersions
to set project level versionstarget.platformVersion
to set application specific versionThese new options just apply default build settings, any any custom settings will still override this.
This is technically a breaking change, as those projects relying on the old default versions set in the setting presets will now have the latest platform version, which for example upgrade iOS 10 to iOS 11.1 (depending on Xcode version)
EDIT: renamed to
deploymentTarget