Skip to content
9 changes: 2 additions & 7 deletions tests/BundledResources/ResourcesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,12 @@ public void Bundled ()
var isSimulator = Runtime.Arch != Arch.DEVICE;
#endif

#if HOTRELOAD_COMPATIBLE_BUILD
// In a hot-reload-compatible build, resource stripping is skipped for reloadable
// (non-linked) user assemblies, because stripping would re-serialize the assembly and
// break Hot Reload. So the bundled resources remain embedded unless this assembly was
// linked (in which case it's re-saved regardless, and stripping still applies).
var hasResources = isSimulator || !TestRuntime.IsLinkAll;
#else
// Without Hot Reload the resources are always stripped, except on the simulator (where
// stripping is skipped to keep simulator builds fast).
var hasResources = isSimulator;
#endif
AppContext.TryGetSwitch ("ObjCRuntime.Runtime.HotReloadCompatible", out var hotReloadCompatible);
var hasResources = isSimulator || (hotReloadCompatible && !TestRuntime.IsLinkAll);
if (!hasResources) {
Assert.That (resources.Length, Is.EqualTo (0), "No resources");
} else {
Expand Down
24 changes: 0 additions & 24 deletions tests/common/shared-dotnet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -127,30 +127,6 @@
<DefineConstants Condition="'$(ExcludeTouchUnitReference)' == 'true'">$(DefineConstants);EXCLUDE_TOUCH_UNIT_REFERENCE</DefineConstants>
</PropertyGroup>

<!--
Define HOTRELOAD_COMPATIBLE_BUILD when building a hot-reload-compatible build. This has to
happen in a target (and not in a plain PropertyGroup), because $(HotReloadCompatibleBuild)
is computed in the platform SDK targets, which are imported after this file.
-->
<Target Name="_AddHotReloadCompatibleBuildDefine" BeforeTargets="CoreCompile" DependsOnTargets="_ComputeHotReloadCompatibleBuild" Condition="$([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '11.0'))">
<PropertyGroup Condition="'$(HotReloadCompatibleBuild)' == 'true'">
<DefineConstants>$(DefineConstants);HOTRELOAD_COMPATIBLE_BUILD</DefineConstants>
</PropertyGroup>
</Target>

<!--
Whether the build is hot-reload-compatible is an app-level decision (it depends on the
registrar, which is only selected for projects that produce an app bundle), but it affects
the library projects the app references as well (their assemblies are the ones that must be
left unmodified). So pass the app's value on to every referenced project, to make sure they
all agree (in particular when defining HOTRELOAD_COMPATIBLE_BUILD above).
-->
<Target Name="_PassHotReloadCompatibleBuildToProjectReferences" BeforeTargets="AssignProjectConfiguration" DependsOnTargets="_ComputeHotReloadCompatibleBuild" Condition="'$(_CanOutputAppBundle)' == 'true' And $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '11.0'))">
<ItemGroup>
<ProjectReference Update="@(ProjectReference)" AdditionalProperties="%(ProjectReference.AdditionalProperties);HotReloadCompatibleBuild=$(HotReloadCompatibleBuild)" />
</ItemGroup>
</Target>

<!--
Define PREPARE_ASSEMBLIES when the assembly-preparer is used. Just like
$(HotReloadCompatibleBuild), $(PrepareAssemblies) may be computed in the platform SDK
Expand Down
Loading