-
-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathDirectory.Build.targets
20 lines (19 loc) · 1.61 KB
/
Directory.Build.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<Project>
<PropertyGroup>
<DotnetInstallLocation Condition="$(NetCoreRoot) == ''">C:\Program Files\dotnet\</DotnetInstallLocation>
<DotnetInstallLocation Condition="$(NetCoreRoot) != ''">$(NetCoreRoot)</DotnetInstallLocation>
<AccessibilityLocation Condition="$(TargetFramework) == 'net8.0'">$(DotnetInstallLocation)shared\Microsoft.WindowsDesktop.App\8.0.10\Accessibility.dll</AccessibilityLocation>
<AccessibilityLocation Condition="$(TargetFramework) == 'net7.0'">$(DotnetInstallLocation)shared\Microsoft.WindowsDesktop.App\7.0.20\Accessibility.dll</AccessibilityLocation>
<AccessibilityLocation Condition="$(TargetFramework) == 'net6.0'">$(DotnetInstallLocation)shared\Microsoft.WindowsDesktop.App\6.0.35\Accessibility.dll</AccessibilityLocation>
</PropertyGroup>
<ItemGroup>
<Reference Update="Accessibility" Condition="($(TargetFramework) == 'net8.0') or ($(TargetFramework) == 'net7.0') or ($(TargetFramework) == 'net6.0')">
<HintPath>$(AccessibilityLocation)</HintPath>
</Reference>
</ItemGroup>
<Target Name="CustomClean" BeforeTargets="CoreBuild">
<Error Text="Accessibility does not exists in location $(AccessibilityLocation)'" Condition="($(TargetFramework) == 'net8.0') and (!Exists('$(AccessibilityLocation)'))" />
<Error Text="Accessibility does not exists in location $(AccessibilityLocation)'" Condition="($(TargetFramework) == 'net7.0') and (!Exists('$(AccessibilityLocation)'))" />
<Error Text="Accessibility does not exists in location $(AccessibilityLocation)'" Condition="($(TargetFramework) == 'net6.0') and (!Exists('$(AccessibilityLocation)'))" />
</Target>
</Project>