[mono] Fix Android and iOS samples (#41870)
authorEgor Bogatov <egorbo@gmail.com>
Fri, 4 Sep 2020 17:12:34 +0000 (20:12 +0300)
committerGitHub <noreply@github.com>
Fri, 4 Sep 2020 17:12:34 +0000 (19:12 +0200)
Fixes broken samples for Android and iOS.
`InvariantGlobalization` fixes the issue described in https://github.com/dotnet/runtime/issues/41866 because otherwise ILLink fails on Interop.Globalization.EnumCalendarInfo (with a function pointer).

src/mono/netcore/sample/Android/Makefile
src/mono/netcore/sample/Android/Program.csproj
src/mono/netcore/sample/iOS/Program.csproj

index 5ce28d9..5ec6660 100644 (file)
@@ -12,7 +12,7 @@ runtimepack:
 
 run: clean appbuilder
        $(DOTNET) publish -c $(MONO_CONFIG) -r android-$(MONO_ARCH) \
-       /p:Platform=$(MONO_ARCH) /p:DeployAndRun=true
+       /p:TargetArchitecture=$(MONO_ARCH) /p:DeployAndRun=true
 
 clean:
        rm -rf bin
index 63f13fd..e627bfe 100644 (file)
@@ -9,6 +9,7 @@
     <EnableTargetingPackDownload>false</EnableTargetingPackDownload>
     <PublishTrimmed>true</PublishTrimmed>
     <_TrimmerDefaultAction>link</_TrimmerDefaultAction>
+    <InvariantGlobalization>true</InvariantGlobalization> <!-- workaround for https://github.com/dotnet/runtime/issues/41866 -->
   </PropertyGroup>
 
   <!-- Redirect 'dotnet publish' to in-tree runtime pack -->
index b7a7fc6..7973414 100644 (file)
     <PublishTrimmed>true</PublishTrimmed>
     <_TrimmerDefaultAction>link</_TrimmerDefaultAction>
     <Optimized Condition="'$(Configuration)' == 'Release'">True</Optimized>
+    <InvariantGlobalization>true</InvariantGlobalization> <!-- workaround for https://github.com/dotnet/runtime/issues/41866 -->
   </PropertyGroup>
 
   <!-- Redirect 'dotnet publish' to in-tree runtime pack -->
   <Target Name="TrickRuntimePackLocation" AfterTargets="ProcessFrameworkReferences">
     <ItemGroup>
       <RuntimePack>
-        <PackageDirectory>$(ArtifactBinDir)microsoft.netcore.app.runtime.ios-$(TargetArchitecture)\$(Configuration)</PackageDirectory>
+        <PackageDirectory>$(ArtifactsBinDir)microsoft.netcore.app.runtime.ios-$(TargetArchitecture)\$(Configuration)</PackageDirectory>
       </RuntimePack>
     </ItemGroup>
     <Message Text="Packaged ID: %(RuntimePack.PackageDirectory)" Importance="high" />