Skip to content

Use global code coverage flag in swift package generate-xcodeproj #2919

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

Merged
merged 2 commits into from
Sep 11, 2020

Conversation

natecook1000
Copy link
Member

There's a conflict between '--enable-code-coverage' in the top-level options and the same flag in the Xcode-project generation command. This uses the top-level flag (which is required for the build parameters, even though it's only ever used by swift test) for both purposes.

There's a conflict between '--enable-code-coverage' in the top-level
options and the same flag in the Xcode-project generation command.
This uses the top-level flag (which is required for the build
parameters, even though it's only ever used by `swift test`) for
both purposes.
@natecook1000
Copy link
Member Author

This should unblock moving to ArgumentParser version 0.3.1.

@abertelrud
Copy link
Contributor

abertelrud commented Sep 10, 2020

Thanks for this fix! Do I understand correctly that the inversion: .prefixedEnableDisable part still keeps the enable-code-coverage spelling so that there's no practical change for users? If so, then this seems good to me.

@abertelrud
Copy link
Contributor

@swift-ci please test

@natecook1000
Copy link
Member Author

Right, the only user-facing change is that it adds the --disable-code-coverage flag (which will be a no-op).

@abertelrud
Copy link
Contributor

Right, the only user-facing change is that it adds the --disable-code-coverage flag (which will be a no-op).

That seems fine to me, since enable- and disable- prefixes are a standard and expected idiom, even when just repeating the default.

Thanks!

@abertelrud
Copy link
Contributor

@swift-ci please smoke test

@neonichu
Copy link
Contributor

Could we also change the version requirement in the manifest as part of this PR?

@natecook1000
Copy link
Member Author

Sure! We'll just need to coordinate landing with the other Swift project clients. I'll add a comment about that in the manifest.

@natecook1000
Copy link
Member Author

@swift-ci Please smoke test

@natecook1000
Copy link
Member Author

@swift-ci Please test self hosted

@natecook1000
Copy link
Member Author

@swift-ci Please smoke test self hosted

@natecook1000
Copy link
Member Author

@swift-ci Please smoke test

@@ -263,7 +263,12 @@ if ProcessInfo.processInfo.environment["SWIFTPM_LLBUILD_FWK"] == nil {
if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
package.dependencies += [
.package(url: "https://github.com/apple/swift-tools-support-core.git", .branch("master")),
.package(url: "https://github.com/apple/swift-argument-parser.git", .exact("0.3.0")),
// The 'swift-argument-parser' version declared here must match that
Copy link
Contributor

Choose a reason for hiding this comment

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

Slight nitpick here — it doesn't have to exactly match, but just be compatible. Since the dependency is "up to next minor", it means that all other dependencies have to resolve to a 0.3.x dependency. In general SwiftPM will pick the highest version that satisfies all the constrains, so it's fine for one package to specify "at least 0.3.0" and another to say "at least 0.3.2" and another to say "at least 0.3", as long as the package has a single tag that satisfies all requirements. So I think the working here would be that the version requirements have to be compatible, but they don't need to strictly match. It's only a problem if one of them starts to require "0.4.x", for example.

@neonichu neonichu merged commit b5d188f into master Sep 11, 2020
@neonichu neonichu deleted the nate/code_coverage branch September 11, 2020 21:57
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.

3 participants