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 contract test #170

Merged
merged 3 commits into from
Nov 30, 2017
Merged

Add contract test #170

merged 3 commits into from
Nov 30, 2017

Conversation

pepicrft
Copy link
Contributor

@pepicrft pepicrft commented Nov 25, 2017

Resolves #111

Short description 📝

Changes in xcproj might break the integration from other projects. The purpose of this PR is to add a test that tests the contract with XcodeGen. This test can be a reference to test contract with other libraries in the future.

Solution 📦

Test the contract between xcproj and xcodegen cc @yonaskolb

Implementation 👩‍💻👨‍💻

  • Add a new integration test case.

GIF

gif


This change is Reviewable

@pepicrft pepicrft self-assigned this Nov 25, 2017
@pepicrft pepicrft requested review from yonaskolb and a team November 25, 2017 22:18
Copy link
Contributor

@toshi0383 toshi0383 left a comment

Choose a reason for hiding this comment

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

ShellOut👍

range: NSRange.init(location: 0, length: content.count)) else {
return content
}
let output = (content as NSString).replacingCharacters(in: match.range,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Info: String.replacingOccurrences has a built in regex option.

let expression = "\\.package\\(url:\\s*\\\".+xcproj.git\\\".+\\)"
let replacement = ".package(url: \"../..\", .revision(\"\(revision)\"))"
return content.replacingOccurrences(of: expression, with: replacement, options: .regularExpression, range: nil)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice! I didn't know this. I'll update it.

atomically: true,
encoding: .utf8)
print("> Building XcodeGen")
try shellOut(to: "cd \(clonePath); swift build")
Copy link
Collaborator

Choose a reason for hiding this comment

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

swift test as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, makes sense 👍

@yonaskolb
Copy link
Collaborator

Nice one!

@pepicrft pepicrft merged commit 39b1810 into master Nov 30, 2017
@pepicrft pepicrft deleted the contract-testing branch November 30, 2017 16:05
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.

None yet

3 participants