-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
47 lines (43 loc) · 2.49 KB
/
Copy pathDirectory.Build.props
File metadata and controls
47 lines (43 loc) · 2.49 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
<Project>
<PropertyGroup>
<MauiVersion>10.0.80</MauiVersion>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
<LangVersion>latest</LangVersion>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<Nullable>enable</Nullable>
</PropertyGroup>
<!--
Workaround: when /Applications/Xcode.app is a symlink (e.g. → Xcode_26.5.app)
the .NET macOS SDK's xcrun fallback shells out via the symlinked path and
intermittently fails with "SDK MacOSX.sdk cannot be located" / install_name_tool
exit 72 during the native link / install_name_tool steps. Setting MD_APPLE_SDK_ROOT
to the resolved Xcode bundle (which Xamarin.MacDev.Tasks uses to populate
DEVELOPER_DIR for child processes) avoids the broken xcrun fallback. This must
happen at MSBuild evaluation time — once Xamarin tasks have loaded, env-var
changes from inside a Target are not picked up.
<Target Name="_GitHubShineSetMacXcodeRoot"
BeforeTargets="GetTargetFrameworks;CollectPackageReferences;Restore;Build;CoreCompile"
Condition="$([MSBuild]::IsOSPlatform('osx'))">
<PropertyGroup>
<_GitHubShineXcodeCandidate Condition="Exists('/Applications/Xcode_26.5.app')">/Applications/Xcode_26.5.app</_GitHubShineXcodeCandidate>
<_GitHubShineXcodeCandidate Condition="'$(_GitHubShineXcodeCandidate)' == '' AND Exists('/Applications/Xcode.app')">/Applications/Xcode.app</_GitHubShineXcodeCandidate>
</PropertyGroup>
<SetEnvironmentVariable Name="MD_APPLE_SDK_ROOT"
Value="$(_GitHubShineXcodeCandidate)"
Condition="'$(_GitHubShineXcodeCandidate)' != '' AND '$(MD_APPLE_SDK_ROOT)' == ''"/>
</Target>
<UsingTask TaskName="SetEnvironmentVariable" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup>
<Name ParameterType="System.String" Required="true"/>
<Value ParameterType="System.String" Required="true"/>
</ParameterGroup>
<Task>
<Code Type="Fragment" Language="cs"><![CDATA[
System.Environment.SetEnvironmentVariable(Name, Value);
Log.LogMessage(Microsoft.Build.Framework.MessageImportance.High, "Set " + Name + "=" + Value);
]]></Code>
</Task>
</UsingTask>
-->
</Project>