|
4 | 4 | <OutputPath>bin</OutputPath> |
5 | 5 | <IntermediateOutputPath>$(MSBuildThisFileDirectory)/obj/</IntermediateOutputPath> |
6 | 6 | <TargetFramework>$(NetCoreAppCurrent)</TargetFramework> |
7 | | - <TargetOS Condition="'$(TargetOS)' == ''">ios</TargetOS> |
8 | | - <TargetOS Condition="'$(TargetsiOSSimulator)' == 'true'">iossimulator</TargetOS> |
| 7 | + <TargetOS Condition="'$(TargetOS)' == ''">iossimulator</TargetOS> |
9 | 8 | <DeployAndRun Condition="'$(DeployAndRun)' == ''">true</DeployAndRun> |
10 | 9 | <RuntimeIdentifier>$(TargetOS)-$(TargetArchitecture)</RuntimeIdentifier> |
11 | 10 | <AppName>HelloiOS</AppName> |
12 | | - <StripDebugSymbols Condition="'$(StripDebugSymbols)' == ''">false</StripDebugSymbols> |
13 | | - <!-- NativeAOT-specific props --> |
14 | | - <NativeLib>static</NativeLib> |
15 | | - <CustomNativeMain>true</CustomNativeMain> |
16 | 11 | <UseNativeAOTRuntime Condition="'$(UseNativeAOTRuntime)' == ''">true</UseNativeAOTRuntime> |
17 | | - <!-- FIXME: Once we support building System.Globalization.Native and icu, should be removed --> |
18 | | - <InvariantGlobalization>true</InvariantGlobalization> |
19 | | - <!-- FIXME: We do not use publish targets yet, but we need to create a publish directory --> |
20 | 12 | <PublishDir Condition="'$(PublishDir)' == ''">$(OutputPath)/publish</PublishDir> |
| 13 | + <NativeLib>static</NativeLib> |
| 14 | + <CustomNativeMain>true</CustomNativeMain> |
| 15 | + <!-- Escape NativeAOT bundling targets --> |
| 16 | + <NativeCompilationDuringPublish>false</NativeCompilationDuringPublish> |
| 17 | + <IlcCompileDependsOn>Compile;ComputeIlcCompileInputs;SetupOSSpecificProps;PrepareForILLink</IlcCompileDependsOn> |
| 18 | + </PropertyGroup> |
| 19 | + |
| 20 | + <PropertyGroup Condition="'$(PublishAotUsingRuntimePack)' == 'true'"> |
| 21 | + <PublishAot>true</PublishAot> |
| 22 | + <MSBuildWarningsAsErrors>$(MSBuildWarningsAsErrors);NU1603</MSBuildWarningsAsErrors> |
| 23 | + <UseLocalTargetingRuntimePack>false</UseLocalTargetingRuntimePack> |
| 24 | + <RestoreAdditionalProjectSources>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'artifacts', 'packages', '$(CoreCLRConfiguration)', 'Shipping'))</RestoreAdditionalProjectSources> |
21 | 25 | </PropertyGroup> |
22 | 26 |
|
23 | 27 | <ItemGroup> |
24 | 28 | <Compile Include="..\iOS\Program.cs" Link="Program.cs" /> |
25 | 29 | <DirectPInvoke Include="__Internal" /> |
26 | 30 | </ItemGroup> |
27 | 31 |
|
28 | | - <PropertyGroup Condition="'$(TargetOS)' == 'maccatalyst'"> |
29 | | - <DevTeamProvisioning Condition="'$(DevTeamProvisioning)' == ''">adhoc</DevTeamProvisioning> |
30 | | - <EnableAppSandbox Condition="'$(EnableAppSandbox)' == ''">false</EnableAppSandbox> |
31 | | - </PropertyGroup> |
32 | | - <!-- Fix temporary regression, will be fixed on the main in a separate PR: https://github.com/dotnet/runtime/issues/80911 --> |
33 | | - <Import Project="$(CoreClrProjectRoot)nativeaot\BuildIntegration\Microsoft.DotNet.ILCompiler.SingleEntry.targets" /> |
| 32 | + <Import Condition="'$(PublishAotUsingRuntimePack)' != 'true'" Project="$(CoreClrProjectRoot)nativeaot\BuildIntegration\Microsoft.DotNet.ILCompiler.SingleEntry.targets" /> |
34 | 33 | <UsingTask TaskName="AppleAppBuilderTask" |
35 | 34 | AssemblyFile="$(AppleAppBuilderTasksAssemblyPath)" /> |
36 | 35 |
|
37 | | - <!-- FIXME: Once we set up builing appropriate runtime package for iOS-like platforms the following properties should be removed --> |
38 | | - <Target Name="ConfigureIlcPathsForiOSCrossCompilation"> |
| 36 | + <!-- Use locally built runtime and ilcompiler packages --> |
| 37 | + <Target Name="UpdateRuntimePackVersion" Condition="'$(PublishAotUsingRuntimePack)' == 'true'" BeforeTargets="ProcessFrameworkReferences"> |
| 38 | + <ItemGroup> |
| 39 | + <KnownRuntimePack Condition="%(RuntimePackLabels) == 'NativeAOT'" LatestRuntimeFrameworkVersion="8.0.0-dev" /> |
| 40 | + <KnownILCompilerPack Update="Microsoft.DotNet.ILCompiler"> |
| 41 | + <ILCompilerPackVersion>8.0.0-dev</ILCompilerPackVersion> |
| 42 | + </KnownILCompilerPack> |
| 43 | + </ItemGroup> |
| 44 | + </Target> |
| 45 | + |
| 46 | + <!-- Run before ILC setup --> |
| 47 | + <Target Name="ConfigureIlcPathsForiOSCrossCompilation" Condition="'$(PublishAotUsingRuntimePack)' != 'true'" |
| 48 | + BeforeTargets="SetupProperties"> |
39 | 49 | <PropertyGroup> |
40 | 50 | <IlcPath>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'artifacts', 'bin', 'coreclr', '$(HostOS).$(BuildArchitecture).$(CoreCLRConfiguration)', 'ilc'))</IlcPath> |
41 | 51 | <IlcToolsPath>$(IlcPath)</IlcToolsPath> |
|
47 | 57 |
|
48 | 58 | <Target Name="BuildAppBundle" |
49 | 59 | AfterTargets="Build" |
50 | | - DependsOnTargets="ConfigureIlcPathsForiOSCrossCompilation;SetupProperties;ComputeIlcCompileInputs;IlcCompile"> |
| 60 | + DependsOnTargets="IlcCompile;CopyFilesToPublishDirectory"> |
51 | 61 |
|
52 | 62 | <PropertyGroup> |
53 | 63 | <AppDir>$(MSBuildThisFileDirectory)$(PublishDir)\app</AppDir> |
54 | | - <IosSimulator Condition="'$(TargetsiOSSimulator)' == 'true'">iPhone 11</IosSimulator> |
55 | 64 | <Optimized Condition="'$(Configuration)' == 'Release'">True</Optimized> |
| 65 | + <StripDebugSymbols Condition="'$(StripDebugSymbols)' == ''">false</StripDebugSymbols> |
| 66 | + <DevTeamProvisioning Condition="'$(TargetOS)' == 'maccatalyst' and '$(DevTeamProvisioning)' == ''">adhoc</DevTeamProvisioning> |
| 67 | + <EnableAppSandbox Condition="'$(TargetOS)' == 'maccatalyst' and '$(EnableAppSandbox)' == ''">false</EnableAppSandbox> |
56 | 68 | </PropertyGroup> |
57 | 69 |
|
58 | 70 | <ItemGroup> |
59 | | - <NativeLibrary Include="%(ManagedBinary.IlcOutputFile)" /> |
| 71 | + <_LinkerFlagsToDrop Include="@(NativeFramework->'-framework %(Identity)')" /> |
| 72 | + <_LinkerFlagsToDrop Include="@(LinkerArg)" Condition="$([System.String]::new('%(Identity)').Contains('swift'))" /> |
| 73 | + <LinkerArg Remove="@(_LinkerFlagsToDrop)" /> |
| 74 | + <ExtraLinkerArguments Include="@(LinkerArg)" /> |
| 75 | + <_NativeDependencies Include="%(ManagedBinary.IlcOutputFile)" /> |
60 | 76 | </ItemGroup> |
61 | 77 |
|
62 | 78 | <RemoveDir Directories="$(AppDir)" /> |
63 | 79 |
|
64 | 80 | <AppleAppBuilderTask |
65 | 81 | UseNativeAOTRuntime="$(UseNativeAOTRuntime)" |
66 | | - NativeDependencies="@(NativeLibrary)" |
| 82 | + NativeDependencies="@(_NativeDependencies)" |
67 | 83 | TargetOS="$(TargetOS)" |
68 | 84 | Arch="$(TargetArchitecture)" |
69 | 85 | ProjectName="$(AppName)" |
|
74 | 90 | OutputDirectory="$(AppDir)" |
75 | 91 | Optimized="$(Optimized)" |
76 | 92 | InvariantGlobalization="$(InvariantGlobalization)" |
| 93 | + EnableAppSandbox="$(EnableAppSandbox)" |
77 | 94 | StripSymbolTable="$(StripDebugSymbols)" |
78 | | - AppDir="$(MSBuildThisFileDirectory)$(PublishDir)" > |
| 95 | + AppDir="$(MSBuildThisFileDirectory)$(PublishDir)" |
| 96 | + ExtraLinkerArguments="@(ExtraLinkerArguments)" > |
79 | 97 | <Output TaskParameter="AppBundlePath" PropertyName="AppBundlePath" /> |
80 | 98 | <Output TaskParameter="XcodeProjectPath" PropertyName="XcodeProjectPath" /> |
81 | 99 | </AppleAppBuilderTask> |
|
0 commit comments