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

Update iOS native packaging #3044

Merged
merged 9 commits into from
Nov 14, 2021
Merged
7 changes: 0 additions & 7 deletions osu.Framework.iOS.props
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,6 @@
<Reference Include="Xamarin.iOS" />
<Reference Include="System.Net.Http" />
</ItemGroup>
<ItemGroup>
<NativeReference Include="..\osu.Framework.iOS\*.a">
<Kind>Static</Kind>
<SmartLink>False</SmartLink>
<ForceLoad>True</ForceLoad>
</NativeReference>
</ItemGroup>
<ItemGroup Label="Package References">
<PackageReference Include="Markdig" Version="0.26.0" />
<PackageReference Include="FFmpeg.AutoGen" Version="4.3.0.1" />
Expand Down
11 changes: 11 additions & 0 deletions osu.Framework.iOS/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,21 @@
// See the LICENCE file in the repository root for full licence text.

using System.Runtime.CompilerServices;
using ObjCRuntime;

// We publish our internal attributes to other sub-projects of the framework.
// Note, that we omit visual tests as they are meant to test the framework
// behavior "in the wild".

[assembly: InternalsVisibleTo("osu.Framework.Tests")]
[assembly: InternalsVisibleTo("osu.Framework.Tests.Dynamic")]

[assembly: LinkWith("libavcodec.a", SmartLink = false, ForceLoad = true)]
[assembly: LinkWith("libavdevice.a", SmartLink = false, ForceLoad = true)]
[assembly: LinkWith("libavfilter.a", SmartLink = false, ForceLoad = true)]
[assembly: LinkWith("libavformat.a", SmartLink = false, ForceLoad = true)]
[assembly: LinkWith("libavutil.a", SmartLink = false, ForceLoad = true)]
[assembly: LinkWith("libbass.a", SmartLink = false, ForceLoad = true)]
[assembly: LinkWith("libbass_fx.a", SmartLink = false, ForceLoad = true)]
[assembly: LinkWith("libswresample.a", SmartLink = false, ForceLoad = true)]
[assembly: LinkWith("libswscale.a", SmartLink = false, ForceLoad = true)]
10 changes: 4 additions & 6 deletions osu.Framework.iOS/osu.Framework.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.4" />
</ItemGroup>
<ItemGroup>
<NativeLibs Include="$(MSBuildThisFileDirectory)\*.a" />
<None Include="@(NativeLibs)">
<Pack>true</Pack>
<PackageCopyToOutput>true</PackageCopyToOutput>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<!-- Don't forget to update the linker attributes in AssemblyInfo.cs if you are modifying native libraries. -->
<EmbeddedResource Include="$(MSBuildThisFileDirectory)*.a">
<WithCulture>false</WithCulture>
</EmbeddedResource>
Copy link
Member

@frenzibyte frenzibyte Nov 11, 2021

Choose a reason for hiding this comment

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

As-is, this caused the native libraries to be included as osu.Framework.iOS.libXYZ.a

CleanShot 2021-11-11 at 15 09 05@2x

While I was looking over why EmbeddedResource was used rather than ManifestResourceWithNoCulture (as in the SQlite project you linked) and that it's because the latter is deprecated, I've noticed that this is actually missing the LogicalName metadata (which is the cause of the issue above), and also the Type metadata to correctly replace the deprecated ManifestResourceWithNoCulture.

See xamarin/xamarin-macios#9525.


Resolved myself at f2706f7.

</ItemGroup>
<ItemGroup>
<Content Include="app.config" CopyToOutputDirectory="Always" />
Expand Down