Skip to content

Commit 42fde4c

Browse files
committed
Enhance iOS build configuration with native references and error handling for Facebook SDK integration
1 parent 16b88e0 commit 42fde4c

1 file changed

Lines changed: 50 additions & 4 deletions

File tree

src/Kapusch.FacebookApisForiOSComponents/buildTransitive/Kapusch.Facebook.iOS.targets

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,57 @@
22
<PropertyGroup>
33
<_KapuschFacebookInteropPackageRoot>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..'))</_KapuschFacebookInteropPackageRoot>
44
</PropertyGroup>
5-
<ItemGroup
6-
Condition="'$(DisableKapuschFacebookInteropNativeAssets)' == 'true' or '$(UseKapuschFacebookInteropFromSource)' == 'true'"
5+
<PropertyGroup Condition="'$(UseKapuschFacebookInteropFromSource)' == 'true'">
6+
<_KapuschFacebookInteropSourceRoot>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)../Native/iOS/build'))</_KapuschFacebookInteropSourceRoot>
7+
</PropertyGroup>
8+
<Target
9+
Name="KapuschFacebookInterop_InjectIosNativeReferences_Source"
10+
BeforeTargets="CoreCompile"
11+
Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' and '$(DisableKapuschFacebookInteropNativeAssets)' != 'true' and '$(UseKapuschFacebookInteropFromSource)' == 'true'"
712
>
8-
<!-- Short-circuit: kill-switch or debug-from-source mode. -->
9-
</ItemGroup>
13+
<PropertyGroup>
14+
<_KapuschFacebookInteropIosWrapper>$([System.IO.Path]::Combine('$(_KapuschFacebookInteropSourceRoot)', 'kfb.xcframework'))</_KapuschFacebookInteropIosWrapper>
15+
<_KapuschFacebookInteropFbDir>$([System.IO.Path]::Combine('$(_KapuschFacebookInteropSourceRoot)', 'fb'))</_KapuschFacebookInteropFbDir>
16+
</PropertyGroup>
17+
<Error
18+
Condition="!Exists('$(_KapuschFacebookInteropIosWrapper)')"
19+
Text="Kapusch.Facebook.iOS source-mode: missing wrapper xcframework at '$(_KapuschFacebookInteropIosWrapper)'. Build it first via src/Kapusch.FacebookApisForiOSComponents/Native/iOS/build.sh."
20+
/>
21+
<Error
22+
Condition="!Exists('$(_KapuschFacebookInteropFbDir)')"
23+
Text="Kapusch.Facebook.iOS source-mode: missing Facebook xcframeworks dir at '$(_KapuschFacebookInteropFbDir)'. Run src/Kapusch.FacebookApisForiOSComponents/Native/iOS/collect-facebook-xcframeworks.sh."
24+
/>
25+
<ItemGroup>
26+
<NativeReference Include="$(_KapuschFacebookInteropIosWrapper)">
27+
<Kind>Static</Kind>
28+
<ForceLoad>true</ForceLoad>
29+
</NativeReference>
30+
<NativeReference Include="$(_KapuschFacebookInteropFbDir)/FBAEMKit.xcframework">
31+
<Kind>Framework</Kind>
32+
<ForceLoad>true</ForceLoad>
33+
</NativeReference>
34+
<NativeReference Include="$(_KapuschFacebookInteropFbDir)/FBSDKCoreKit.xcframework">
35+
<Kind>Framework</Kind>
36+
<ForceLoad>true</ForceLoad>
37+
</NativeReference>
38+
<NativeReference Include="$(_KapuschFacebookInteropFbDir)/FBSDKCoreKit_Basics.xcframework">
39+
<Kind>Framework</Kind>
40+
<ForceLoad>true</ForceLoad>
41+
</NativeReference>
42+
<NativeReference Include="$(_KapuschFacebookInteropFbDir)/FBSDKGamingServicesKit.xcframework">
43+
<Kind>Framework</Kind>
44+
<ForceLoad>true</ForceLoad>
45+
</NativeReference>
46+
<NativeReference Include="$(_KapuschFacebookInteropFbDir)/FBSDKLoginKit.xcframework">
47+
<Kind>Framework</Kind>
48+
<ForceLoad>true</ForceLoad>
49+
</NativeReference>
50+
<NativeReference Include="$(_KapuschFacebookInteropFbDir)/FBSDKShareKit.xcframework">
51+
<Kind>Framework</Kind>
52+
<ForceLoad>true</ForceLoad>
53+
</NativeReference>
54+
</ItemGroup>
55+
</Target>
1056
<Target
1157
Name="KapuschFacebookInterop_InjectIosNativeReferences"
1258
BeforeTargets="CoreCompile"

0 commit comments

Comments
 (0)