Skip to content

Commit

Permalink
[release/8.0.1xx-xcode15.1] [dotnet-linker] Add ProcessExportedFields…
Browse files Browse the repository at this point in the history
… to the list of steps we execute. Fixes #20061. (#20307)

Fixes #20061.

Backport of #20066
  • Loading branch information
vs-mobiletools-engineering-service2 committed Mar 15, 2024
1 parent 8094fb0 commit b0bfbc2
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions dotnet/targets/Xamarin.Shared.Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,7 @@
<!-- This would not be needed if LinkContext.GetAssemblies () was exposed to us. -->
<_TrimmerCustomSteps Include="$(_AdditionalTaskAssembly)" BeforeStep="MarkStep" Type="Xamarin.Linker.CollectAssembliesStep" />
<_TrimmerCustomSteps Include="$(_AdditionalTaskAssembly)" BeforeStep="MarkStep" Type="MonoTouch.Tuner.CoreTypeMapStep" />
<_TrimmerCustomSteps Include="$(_AdditionalTaskAssembly)" BeforeStep="MarkStep" Type="MonoTouch.Tuner.ProcessExportedFields" />
<!-- The final decision to remove/keep the dynamic registrar must be done before the linking step -->
<_TrimmerCustomSteps Include="$(_AdditionalTaskAssembly)" BeforeStep="MarkStep" Type="MonoTouch.Tuner.RegistrarRemovalTrackingStep" />
<!-- TODO: these steps should probably run after mark. -->
Expand Down
6 changes: 6 additions & 0 deletions tests/bindings-test/ApiDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ public interface FrameworkTest
}
#endif

[Static]
interface Globals {
[Field ("x_GlobalString", "__Internal")]
NSString GlobalString { get; }
}

[BaseType (typeof (NSObject))]
public interface UltimateMachine {
[Export ("getAnswer")]
Expand Down
6 changes: 6 additions & 0 deletions tests/bindings-test/RuntimeTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ namespace Xamarin.Tests {
[TestFixture]
[Preserve (AllMembers = true)]
public class RuntimeTest {
[Test]
public void GlobalStringTest ()
{
Assert.AreEqual ("There's nothing cruvus here!", (string) Globals.GlobalString, "Global string");
}

[Test]
public void WrapperTypeLookupTest ()
{
Expand Down
2 changes: 2 additions & 0 deletions tests/test-libraries/libtest.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include <zlib.h>
#include "libtest.h"

NSString *x_GlobalString = @"There's nothing cruvus here!";

int
theUltimateAnswer ()
{
Expand Down
2 changes: 2 additions & 0 deletions tests/test-libraries/rename.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
#define x_SCNMatrix4MakeTranslation object_x_SCNMatrix4MakeTranslation
#define x_SCNMatrix4MakeScale object_x_SCNMatrix4MakeScale
#define x_SCNMatrix4Translate object_x_SCNMatrix4Translate
#define x_GlobalString object_x_GlobalString
#elif PREFIX == 2
#define theUltimateAnswer ar_theUltimateAnswer
#define useZLib ar_useZLib
Expand Down Expand Up @@ -145,6 +146,7 @@
#define x_SCNMatrix4MakeTranslation ar_x_SCNMatrix4MakeTranslation
#define x_SCNMatrix4MakeScale ar_x_SCNMatrix4MakeScale
#define x_SCNMatrix4Translate ar_x_SCNMatrix4Translate
#define x_GlobalString ar_x_GlobalString
#else
// keep original names
#endif
3 changes: 3 additions & 0 deletions tools/dotnet-linker/dotnet-linker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@
<Compile Include="..\linker\MonoTouch.Tuner\PreserveSmartEnumConversions.cs">
<Link>external\tools\linker\MonoTouch.Tuner\PreserveSmartEnumConversions.cs</Link>
</Compile>
<Compile Include="..\linker\MonoTouch.Tuner\ProcessExportedFields.cs">
<Link>external\tools\linker\MonoTouch.Tuner\ProcessExportedFields.cs</Link>
</Compile>
<Compile Include="..\linker\MobileExtensions.cs">
<Link>external\tools\linker\MobileExtensions.cs</Link>
</Compile>
Expand Down

6 comments on commit b0bfbc2

@vs-mobiletools-engineering-service2
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

💻 [CI Build] Tests on macOS M1 - Mac Ventura (13.0) passed 💻

All tests on macOS M1 - Mac Ventura (13.0) passed.

Pipeline on Agent
Hash: [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

💻 [CI Build] Windows Integration Tests passed 💻

All Windows Integration Tests passed.

Pipeline on Agent
Hash: b0bfbc2ea3d4865a85d095a76a6558acc7ca14e8 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

💻 [CI Build] Tests on macOS M1 - Mac Big Sur (11.5) passed 💻

All tests on macOS M1 - Mac Big Sur (11.5) passed.

Pipeline on Agent
Hash: [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

📚 [CI Build] Artifacts 📚

Packages generated

View packages

Pipeline on Agent
Hash: [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

✅ API diff for current PR / commit

NET (empty diffs)
  • iOS: (empty diff detected)
  • tvOS: (empty diff detected)
  • MacCatalyst: (empty diff detected)
  • macOS: (empty diff detected)

✅ API diff vs stable

.NET (No breaking changes)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: b0bfbc2ea3d4865a85d095a76a6558acc7ca14e8 [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🚀 [CI Build] Test results 🚀

Test results

✅ All tests passed on VSTS: simulator tests.

🎉 All 95 tests passed 🎉

Tests counts

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests: All 1 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ framework: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 1 tests passed. Html Report (VSDrops) Download
✅ interdependent_binding_projects: All 4 tests passed. Html Report (VSDrops) Download
⚠️ install_source: No tests selected. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker: All 40 tests passed. Html Report (VSDrops) Download
⚠️ mac_binding_project: No tests selected. Html Report (VSDrops) Download
⚠️ mmp: No tests selected. Html Report (VSDrops) Download
⚠️ mononative: No tests selected. Html Report (VSDrops) Download
✅ monotouch: All 29 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
⚠️ mtouch: No tests selected. Html Report (VSDrops) Download
⚠️ xammac: No tests selected. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: b0bfbc2ea3d4865a85d095a76a6558acc7ca14e8 [CI build]

Please sign in to comment.