erikdoe / ocmock

Mock objects for Objective-C
http://ocmock.org
Apache License 2.0
2.16k stars 606 forks source link

Exclude missing "Carthage" directory from SwiftPM #499

Closed ryanwilson closed 3 years ago

ryanwilson commented 3 years ago

This directory doesn't exist and now shows a warning in Xcode 13 beta 1.

Will be testing this shortly with the Firebase distribution to ensure it works as expected, I'll confirm in a comment when it's good to go and still works within Xcode 12.

ryanwilson commented 3 years ago

Confirmed this is still needed in Xcode 13.0 RC.

twitterkb commented 3 years ago

would love to see this merged so this warning can be silenced in our greater code-base.

jszumski commented 3 years ago

Would also love to see this merged now that Xcode 13 is out.

erikdoe commented 3 years ago

So, after merging this PR I realised that the exclusion of the Carthage folder was there for a reason. The CI target first builds the macOS target, and that does create a Carthage folder inside Source. Then, the CI target builds the SPM target, and SPM somehow discovers the source code in the Carthage folder and tries to build it. That doesn't work and the build fails.

In fact, the build for this PR was broken (https://travis-ci.org/github/erikdoe/ocmock/builds/773930157) but somehow Github didn't show this to me.

In any case, we can't leave this as is. Either I revert this PR or I have to take the SPM build out of CI. Do you have a preference?

ryanwilson commented 3 years ago

@erikdoe shoot, sorry to hear :\ I think reverting for now and working towards a resolution of getting CI working with it makes sense, it'll be easy to make the change again and won't run into any conflicts.

paulb777 commented 3 years ago

Shouldn't this be fixable by running the SwiftPM CI before the Carthage CI?

erikdoe commented 3 years ago

This isn't a "Carthage CI", it's the build of OCMock itself, which uses Carthage for the only dependency: OCHamcrest.

That said, you gave me an idea. It should be possible to include a command in the makefile to remove the Carthage folder before the SPM build. Will look into that.

paulb777 commented 3 years ago

Great, I'll close #509.

erikdoe commented 3 years ago

Removing the directory worked as expected: https://app.travis-ci.com/github/erikdoe/ocmock/builds/239962340

This means we're testing the SwiftPM build in CI and we can still keep the Carthage folder excluded in the package file.