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

Add minimumXcodeGenVersion option #349

Merged
merged 6 commits into from
Aug 2, 2018
Merged

Conversation

brentleyjones
Copy link
Collaborator

If XcodeGen's version is less than this version validation will fail.

@@ -41,7 +41,7 @@ func generate(spec: String, project: String, isQuiet: Bool, justVersion: Bool) {
do {
logger.info("⚙️ Generating project...")
let projectGenerator = ProjectGenerator(project: project)
let xcodeProject = try projectGenerator.generateXcodeProject()
let xcodeProject = try projectGenerator.generateXcodeProject(xcodeGenVersion: version)
Copy link
Owner

Choose a reason for hiding this comment

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

I agree this can be a useful feature, but at the moment I feel its affects are a bit too pervasive in the codebase. I'd be happy to have an extension Project.meetsMinimumVersion(_ version: Version) -> Bool that gets checked for in this file and throws an error.

XcodeGenKit is also a library that gets used by other packages as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure. I’ll adjust.

@brentleyjones brentleyjones force-pushed the minimunXcodeGenVersion branch from a69cae6 to 67c87d7 Compare July 30, 2018 18:21
@brentleyjones
Copy link
Collaborator Author

@yonaskolb I made it less pervasive. Let me know if there is anything else needed 😄.

@@ -74,6 +74,17 @@ class ProjectSpecTests: XCTestCase {
configSettings: ["invalidConfig": [:]],
groups: ["invalidSettingGroup"]
)

$0.it("fails with invalid XcodeGen version") {
let minimumVersion = try! Version("1.11.1")
Copy link
Owner

Choose a reason for hiding this comment

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

No biggie, but these tests are allowed to throw so no need for the exclamation marks

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ahh, true. I'll adjust it.

@@ -205,3 +216,9 @@ fileprivate func expectValidationError(_ project: Project, _ expectedError: Spec
}
throw failure("Supposed to fail with \"\(expectedError)\"", file: file, line: line)
}

fileprivate func expectMinimumXcodeGenVersionError(_ project: Project, minimumVersion: Version, xcodeGenVersion: Version, file: String = #file, line: Int = #line) throws {
Copy link
Owner

Choose a reason for hiding this comment

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

Can this just go inside the it closure, as it's only used there

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sounds good.

@brentleyjones brentleyjones force-pushed the minimunXcodeGenVersion branch from 67c87d7 to 57966c4 Compare August 2, 2018 12:21
@brentleyjones
Copy link
Collaborator Author

@yonaskolb Good to go!

@yonaskolb yonaskolb merged commit efab837 into master Aug 2, 2018
@yonaskolb yonaskolb deleted the minimunXcodeGenVersion branch August 2, 2018 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants