Resolve "PBXSourceTree type compilation errors when iOS Build Support module is not installed" #42
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fix compilation error when opening project with iOS build support not installed. This was caused by commented PBXSourceTree enum type.
Details
Uncommenting the type did not fix the issue as type if defined in
UnityEditor.iOS.Xcode.Stickers
while code fromUnityEditor.iOS.Xcode.PBX
uses it.To fix that, move all Xcode manipulation API code into separate namespace
Agens.StickersEditor.UnityEditor.iOS.Xcode
(wasUnityEditor.iOS.Xcode
before). Reason to use separate namespace vsUNITY_IOS
define like in #39 is folowing. If Unity ever changes access level of types fromUnityEditor.iOS.Xcode
namespace, there will be type name conflicts when using this project. To avoid that and avoid populating Unity specific namespace, use separate one instead.Note that now all editor code uses
Agens.StickersEditor
namespace rather thanAgens.Stickers
as before. This way editor code is separated from runtime code explicitely (will can get handy if project will ever be distributed via Unity Package Manager).Also moved all XcodeAPI code into separate folder
Assets/Stickers/Editor/Xcode
to emphasize the code comes from external source (I assume from https://bitbucket.org/Unity-Technologies/xcodeapi/src/stable/How to test
Install Unity with no iOS build support and open the project. Observe no compilation errors and check it builds for PC.
Install iOS build support, reopen the project and switch platform to iOS. Observe no compilation errors and check it builds for iOS exactly as before (should be the same Xcode project as an output).
Closes #41