-
Notifications
You must be signed in to change notification settings - Fork 507
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
Add support for arbitrary extensions to be bundled in XI/XM apps #9048
Conversation
…tion bundle - This commit adds a hook, "AdditionalAppExtensions", to the msbuild to allow extensions written in other languages, such as Swift, to be embedded and signed in an Xamarin App bundle easily. - Example: <AdditionalAppExtensions Include="$(MSBuildProjectDirectory)/../../native"> <Name>NativeTodayExtension</Name> <BuildOutput Condition="'$(Platform)' == 'iPhone'">build/Debug-iphoneos</BuildOutput> <BuildOutput Condition="'$(Platform)' == 'iPhoneSimulator'">build/Debug-iphonesimulator</BuildOutput> </AdditionalAppExtensions> - Tests added in next commit for easier review
- Outside of the .gitignore, and making all the projects have the same bundle ID, not much to see here
- Not much to see here either, just lining up the bundle ID
msbuild/tests/Xamarin.iOS.Tasks.Tests/ProjectsTests/EmbeddedExtension.cs
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
_ResolveAppExtensionReferences; | ||
_ExtendAppExtensionReferences; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could probably remove _ResolveAppExtensionReferences
here, since _ExtendAppExtensionReferences
depends on _ResolveAppExtensionReferences
. Optional, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonathanpeppers would that still run _ResolveAppExtensionReferences
even if _ExtendAppExtensionReferences
's Condition was false?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it will , the condition only applies to the current target, not its dependency chain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to test this!
It seems the dependency chain is not executed: https://gist.github.com/rolfbjarne/86fa3d32923fe7198549534ca00a850d
And the MSBuild documentation says: "If the condition evaluates to false, the target will not execute the body of the target or any targets that are set in the DependsOnTargets attribute." (https://docs.microsoft.com/en-us/visualstudio/msbuild/target-element-msbuild?view=vs-2019)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I must have been thinking about Inputs/Outputs then.
Build failure Test results2 tests failed, 157 tests passed.Failed tests
|
// NativeContainer | ||
// | ||
// Created by Chris Hamons on 7/7/20. | ||
// Copyright © 2020 Chris Hamons. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe remove this?
_ResolveAppExtensionReferences; | ||
_ExtendAppExtensionReferences; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonathanpeppers would that still run _ResolveAppExtensionReferences
even if _ExtendAppExtensionReferences
's Condition was false?
Build failure Test results2 tests failed, 157 tests passed.Failed tests
|
@chamons looks like the xcode projects are failing code signing in xcodebuild:
Maybe it would be possible to disable signing completely for the native extensions? |
I'm having trouble convincing Xcode to not sign the extension :( |
Build failure Test results3 tests failed, 156 tests passed.Failed tests
|
Looking into failures now. This is legit:
|
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Build failure ✅ Provisioning succeeded |
Build failure Test results2 tests failed, 158 tests passed.Failed tests
|
Build failure Test results1 tests failed, 159 tests passed.Failed tests
|
This is the build error:
😞 |
Build failure Test results1 tests failed, 159 tests passed.Failed tests
|
Still looking at this:
I can reproduce it locally now. |
Build failure Test results3 tests failed, 157 tests passed.Failed tests
|
Failures: 3rd one is super strange, rekicking |
build |
Build failure Test results1 tests failed, 159 tests passed.Failed tests
|
The failing test is a known issue: https://github.com/xamarin/maccore/issues/2267 |
…arin#9048) - This commit adds a hook, "AdditionalAppExtensions", to the msbuild to allow extensions written in other languages, such as Swift, to be embedded and signed in an Xamarin App bundle easily. - Example: <AdditionalAppExtensions Include="$(MSBuildProjectDirectory)/../../native"> <Name>NativeTodayExtension</Name> <BuildOutput Condition="'$(Platform)' == 'iPhone'">build/Debug-iphoneos</BuildOutput> <BuildOutput Condition="'$(Platform)' == 'iPhoneSimulator'">build/Debug-iphonesimulator</BuildOutput> </AdditionalAppExtensions>
…) (#9107) - This commit adds a hook, "AdditionalAppExtensions", to the msbuild to allow extensions written in other languages, such as Swift, to be embedded and signed in an Xamarin App bundle easily. - Example: <AdditionalAppExtensions Include="$(MSBuildProjectDirectory)/../../native"> <Name>NativeTodayExtension</Name> <BuildOutput Condition="'$(Platform)' == 'iPhone'">build/Debug-iphoneos</BuildOutput> <BuildOutput Condition="'$(Platform)' == 'iPhoneSimulator'">build/Debug-iphonesimulator</BuildOutput> </AdditionalAppExtensions>
I almost got this working with a Sharing Extension, but when trying to build, the signing keeps failing.
In my Xamarin.iOS project, the signing is set to Both the Provisioning Profiles and the Signing Certificates are OK, as when I run it directly from Xcode, there are no issues. If however I set the signing to my actual account in the Xamarin.iOS project, it seems to work fine, but that then becomes a potential problem if other people work on the same project and have different Signing Identities Any ideas? |
extensions written in other languages, such as Swift, to be embedded and signed in an
Xamarin iOS/Mac App bundle easily.
Consider reviewing commit by commit, as last two are "stock" test projects and noisy.