-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSampleApp.csproj
More file actions
118 lines (104 loc) · 6.72 KB
/
Copy pathSampleApp.csproj
File metadata and controls
118 lines (104 loc) · 6.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net10.0-android</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('OSX'))">$(TargetFrameworks);net10.0-ios;net10.0-macos;net10.0-tvos</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows'))">$(TargetFrameworks);net10.0-windows10.0.19041.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>latest</LangVersion>
<RootNamespace>SampleApp</RootNamespace>
<ApplicationTitle>SwiftDotNet</ApplicationTitle>
<ApplicationId>com.swiftdotnet.sample</ApplicationId>
<ApplicationVersion>1</ApplicationVersion>
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.EndsWith('-ios'))">
<SupportedOSPlatformVersion>17.0</SupportedOSPlatformVersion>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.EndsWith('-tvos'))">
<SupportedOSPlatformVersion>17.0</SupportedOSPlatformVersion>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.EndsWith('-macos'))">
<SupportedOSPlatformVersion>14.0</SupportedOSPlatformVersion>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.EndsWith('-android'))">
<SupportedOSPlatformVersion>24</SupportedOSPlatformVersion>
</PropertyGroup>
<!-- Hot reload on Apple platforms requires the Mono interpreter — the iOS/tvOS SDK hard-errors with
"Can't use Hot Reload or 'dotnet watch' unless the interpreter is enabled" otherwise.
Opt-in rather than always-on for Debug: the interpreter changes how every Debug build runs, so
ordinary debug deploys shouldn't pay for it. Build with -p:SwiftDotNetHotReload=true when you
want it. See docs/hot-reload.md. -->
<PropertyGroup Condition="'$(SwiftDotNetHotReload)' == 'true' And ($(TargetFramework.EndsWith('-ios')) Or $(TargetFramework.EndsWith('-tvos')))">
<UseInterpreter>true</UseInterpreter>
</PropertyGroup>
<!-- …and it requires this reference, which is what actually makes `dotnet watch` work on a simulator.
`dotnet watch` delivers deltas by injecting DOTNET_STARTUP_HOOKS pointing at the SDK's
Microsoft.Extensions.DotNetDeltaApplier.dll. On iOS the Xamarin registrar will only load an
assembly it knows about at build time, so a hook assembly that lives outside the app aborts
startup in mono_runtime_run_startup_hooks → xamarin_register_assembly → abort. Copying the file
into the .app is *not* enough — it has to be a referenced assembly of the app.
With this reference, an edit to a Body applied to a running simulator app in 407 ms. Without it,
the app aborts the moment `dotnet watch` launches it. The "Socket error while connecting to IDE
on 127.0.0.1:10000" logged either way is a red herring: it is non-fatal, and the app runs fine
with nothing listening on that port. -->
<ItemGroup Condition="'$(SwiftDotNetHotReload)' == 'true' And ($(TargetFramework.EndsWith('-ios')) Or $(TargetFramework.EndsWith('-tvos')))">
<_SwiftDotNetDeltaApplier Include="$(NetCoreRoot)sdk/$(NETCoreSdkVersion)/DotnetTools/dotnet-watch/$(NETCoreSdkVersion)/tools/net10.0/any/hotreload/net10.0/Microsoft.Extensions.DotNetDeltaApplier.dll" />
<Reference Include="Microsoft.Extensions.DotNetDeltaApplier"
HintPath="@(_SwiftDotNetDeltaApplier)"
Condition="Exists('@(_SwiftDotNetDeltaApplier)')" />
</ItemGroup>
<PropertyGroup Condition="$(TargetFramework.Contains('-windows'))">
<OutputType>WinExe</OutputType>
<SupportedOSPlatformVersion>10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<UseWinUI>true</UseWinUI>
<StartupObject>SampleApp.Program</StartupObject>
<ApplicationManifest>Platforms/Windows/app.manifest</ApplicationManifest>
<!-- Runs with NO prerequisites: unpackaged + self-contained .NET + self-contained Windows App SDK. -->
<WindowsPackageType>None</WindowsPackageType>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
</PropertyGroup>
<!-- Shared references (the multi-target library + the shared demo UI). -->
<ItemGroup>
<ProjectReference Include="..\..\src\SwiftDotNet\SwiftDotNet.csproj"/>
<ProjectReference Include="..\SharedUI\SharedUI.csproj"/>
</ItemGroup>
<!-- Only the matching platform's entry point compiles; AppRoot.cs (the single registration) is shared. -->
<ItemGroup>
<Compile Remove="Platforms/**/*.cs"/>
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'ios'">
<Compile Include="Platforms/iOS/**/*.cs"/>
<None Include="Platforms/iOS/Info.plist" Link="Info.plist"/>
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'tvos'">
<Compile Include="Platforms/tvOS/**/*.cs"/>
<None Include="Platforms/tvOS/Info.plist" Link="Info.plist"/>
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'macos'">
<Compile Include="Platforms/macOS/**/*.cs"/>
<None Include="Platforms/macOS/Info.plist" Link="Info.plist"/>
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'android'">
<Compile Include="Platforms/Android/**/*.cs"/>
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'windows'">
<Compile Include="Platforms/Windows/**/*.cs"/>
</ItemGroup>
<!-- Apple (iOS/macOS/tvOS): link the Swift bridge (NativeReference doesn't flow transitively). -->
<Import Project="..\..\src\SwiftDotNet\SwiftDotNetBridge.targets"/>
<!-- Apple (iOS/macOS): opt into the native MapKit renderer for the Map control (keeps MapKit out of
the core bridge). Reference the companion + import its NativeReference; call AppleMaps.Register(). -->
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'ios' or '$(TargetPlatformIdentifier)' == 'macos'">
<ProjectReference Include="..\..\src\SwiftDotNet.Maps.Apple\SwiftDotNet.Maps.Apple.csproj"/>
</ItemGroup>
<Import Project="..\..\src\SwiftDotNet.Maps.Apple\SwiftDotNetMaps.targets"/>
<!-- Windows: reference the SDK directly so the bootstrap + self-contained runtime apply at the exe. -->
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'windows'">
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.7.*"/>
</ItemGroup>
</Project>