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

Fix bug: if RemoteRunnable doesn't contains BuildableReference XcodeProj removes xcscheme file #627

Conversation

subdan
Copy link
Contributor

@subdan subdan commented Jul 29, 2021

Resolves #626

Short description 📝

I have fixed 2 bugs:

  1. if RemoteRunnable tag doesn't contains BuildableReference tag XcodeProj removes xcscheme file.
  2. Xcode 12 generates askForAppToLaunch = "Yes". XcodeProj doesn't parse this argument because value is not YES.

Solution 📦

Inside XCScheme+Runnable.swift made buildableReference property optional.

public var buildableReference: BuildableReference?

Also replaced the following line:

element.addChild(buildableReference.xmlElement())

with the next one:

if let buildableReference = buildableReference {
    element.addChild(buildableReference.xmlElement())
}

To fix the second bug I add $0 == "Yes" next after $0 == "YES"

askForAppToLaunch = element.attributes["askForAppToLaunch"].map { $0 == "YES" || $0 == "Yes" }

Implementation 👩‍💻👨‍💻

Detail in a checklist the steps that you took to implement the PR.

  • Write unit tests
  • Fixed an issue where xcscheme file was deleted
  • Fixed another issue where askForAppToLaunch = "Yes" was not able to decode.

@subdan subdan changed the title Fix bug: if RemoteRunnable doesn't contains BuildableReference Xc…odeProj removes xcscheme file Fix bug: if RemoteRunnable doesn't contains BuildableReference XcodeProj removes xcscheme file Jul 29, 2021
@pepicrft
Copy link
Contributor

@all-contributors add @subdan for code

@allcontributors
Copy link
Contributor

@pepibumur

I've put up a pull request to add @subdan! 🎉

@pepicrft
Copy link
Contributor

Thanks a lot @subdan for this contribution.

@pepicrft pepicrft merged commit 41eb630 into tuist:main Sep 13, 2021
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.

If RemoteRunnable doesn't contains BuildableReference XcodeProj removes xcscheme file
2 participants