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

Convert the codebase to Objective-C++ #1206

Merged
merged 13 commits into from
Nov 2, 2018
Merged

Convert the codebase to Objective-C++ #1206

merged 13 commits into from
Nov 2, 2018

Conversation

Adlai-Holler
Copy link
Member

Now that we've turned off ARC exception safety, and now that Xcode's refactoring engine supports Objective-C++, let's stop mixing languages and standardize on Objective-C++ for all source and test files.

We'll still not leak C++ into our public headers. Sample apps should still be written in plain Objective-C.

This sets the stage for a lot more cleanup and optimization in the near future.

- (NSDictionary<NSString *,ASPerformanceTestResult *> *)results {
return _results;
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Note: C++ was complaining that our ivar is NSMutableDictionary, not NSDictionary.

[cv reloadData];
} completion:nil]);
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Note: This test is broken now. It involves intentionally causing UICollectionView to throw an exception, and the view now ends up in such a state that when it deallocates, it still thinks there's an update in progress which isn't allowed.

The test doesn't really do much. It just confirms an edge case in UICollectionView's behavior.

@TextureGroup TextureGroup deleted a comment Nov 1, 2018
@Adlai-Holler
Copy link
Member Author

Hmm the linker is now much stricter! We aren't automagically getting CoreMedia and AVFoundation linked for us (kind of good to have it called out). I added those to the list of optional dependencies alongside MapKit and AssetsLibrary.

@Adlai-Holler
Copy link
Member Author

The build is failing because Weaver explicitly only imports "Texture/Core", not the default subspec. In order to make the linker happy, this diff takes AVFoundation and CoreMedia parts (ASVideoNode) out of Core but leaves them in the default subspec.

Huy is the only one authorized to push new Weaver cocoapods versions. I already cut a release that points Weaver to the full Texture. @nguyenhuy could you pull master on Weaver and run "pod trunk push" please?

@Adlai-Holler
Copy link
Member Author

To get the build working, I've pointed ASDKgram's import of Weaver explicitly to the 0.1.2 branch until the pod is pushed.

@nguyenhuy
Copy link
Member

nguyenhuy commented Nov 2, 2018 via email

@Adlai-Holler
Copy link
Member Author

That was fast! Nice!

@Adlai-Holler
Copy link
Member Author

OK I think the linker change was Xcode 10.1, not the Objective-C++ change. I've reverted those parts for another day. Would love people's thoughts on this – if we all agree, I'd like to get to work on cleaning up some of the detritus caused by interweaving .m and .mm files together.

@nguyenhuy
Copy link
Member

nguyenhuy commented Nov 2, 2018

🎉 Congrats

🚀 Weaver (0.1.2) successfully published
📅 November 1st, 18:04
🌎 https://cocoapods.org/pods/Weaver
👍 Tell @adlai!

@TextureGroup TextureGroup deleted a comment Nov 2, 2018
@Adlai-Holler
Copy link
Member Author

Thanks for doing that so fast. Sorry I wasted your time and reverted – feature detection is really tricky and it got too weird. We'll revisit it in a separate PR.

@TextureGroup TextureGroup deleted a comment Nov 2, 2018
@TextureGroup TextureGroup deleted a comment Nov 2, 2018
@TextureGroup TextureGroup deleted a comment Nov 2, 2018
@TextureGroup TextureGroup deleted a comment Nov 2, 2018
@TextureGroup TextureGroup deleted a comment Nov 2, 2018
@TextureGroup TextureGroup deleted a comment Nov 2, 2018
Copy link
Contributor

@maicki maicki left a comment

Choose a reason for hiding this comment

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

LGTM

Just small nits and one small update I couldn't comment on: Please update Source/Details/NSIndexSet+ASHelpers.mm header.

Source/Details/ASRecursiveUnfairLock.mm Outdated Show resolved Hide resolved
Tests/ASPerformanceTestContext.mm Outdated Show resolved Hide resolved
@ghost
Copy link

ghost commented Nov 2, 2018

1 Warning
⚠️ This is a big PR, please consider splitting it up to ease code review.

Generated by 🚫 Danger

@Adlai-Holler Adlai-Holler merged commit d0ba092 into master Nov 2, 2018
@Adlai-Holler Adlai-Holler deleted the AHAllCxx branch November 2, 2018 19:04
mikezucc pushed a commit to mikezucc/Texture that referenced this pull request Nov 7, 2018
* Convert the codebase to Objective-C++ throughout. One language is better than two.

* Put it back

* Fix linker

* Point explicitly to updated Weaver to unblock build

* Revert "Point explicitly to updated Weaver to unblock build"

This reverts commit fdc2529.

* Revert "Fix linker"

This reverts commit 7be25f9.

* Add in the frameworks

* no message

* Address spec lint warnings

* Fix tvos build

* Put that back

* Address Michael's review

* Add comment to kick CI
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