-
Notifications
You must be signed in to change notification settings - Fork 27
/
DllExport.props
49 lines (44 loc) · 2.51 KB
/
DllExport.props
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
<Project>
<!-- We need to disable signing because of the bug -->
<PropertyGroup>
<SignAssembly>false</SignAssembly>
</PropertyGroup>
<!-- Nuget reference -->
<ItemGroup>
<PackageReference Include="DllExport" Version="1.5.2" />
</ItemGroup>
<!-- This is needed until bug is fixed/propagated to msbuild ==> We cannot use $(TargetPath) - it is empty -->
<PropertyGroup>
<DllExportInputFileName>$(OutputPath)\$(DefaultNetFramework)\$(AssemblyName).dll</DllExportInputFileName>
</PropertyGroup>
<!-- Until DllExports bug is fixed, we need to define missing target -->
<Target Name="GetFrameworkPaths" />
<!-- With new Microsoft.NET.Sdk projects, we need to add this step manually -->
<PropertyGroup>
<NugetPackagesFolder>$(EnlistmentRoot)\packages</NugetPackagesFolder>
<DllExportTargets>$(NugetPackagesFolder)\DllExport\1.5.2\tools\net.r_eg.DllExport.targets</DllExportTargets>
</PropertyGroup>
<PropertyGroup Condition="!Exists('$(DllExportTargets)')">
<NugetPackagesFolder>$(NugetPackageFolders)</NugetPackagesFolder>
<DllExportTargets>$(NugetPackagesFolder)\DllExport\1.5.2\tools\net.r_eg.DllExport.targets</DllExportTargets>
</PropertyGroup>
<PropertyGroup Condition="!Exists('$(DllExportTargets)')">
<NugetPackagesFolder>$(NuGetPackageRoot)</NugetPackagesFolder>
<DllExportTargets>$(NugetPackagesFolder)\DllExport\1.5.2\tools\net.r_eg.DllExport.targets</DllExportTargets>
</PropertyGroup>
<PropertyGroup Condition="!Exists('$(DllExportTargets)')">
<NugetPackagesFolder>$(UserProfile)\.nuget\packages</NugetPackagesFolder>
<DllExportTargets>$(NugetPackagesFolder)\DllExport\1.5.2\tools\net.r_eg.DllExport.targets</DllExportTargets>
</PropertyGroup>
<!-- Since dotnet build command is not supported, we won't import DllExport.targets for it and we will name project differently -->
<Import Project="$(DllExportTargets)" Condition="Exists('$(DllExportTargets)') AND '$(MSBuildRuntimeType)' != 'Core'" />
<PropertyGroup Condition="'$(MSBuildRuntimeType)' != 'Core'">
<DefineConstants>HAS_DLL_EXPORT</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(MSBuildRuntimeType)' == 'Core'">
<AssemblyName>$(AssemblyName).CLR</AssemblyName>
</PropertyGroup>
<Target Name="DllExportWarningOnCore" BeforeTargets="Build">
<Warning Text="DllExport not applied for project '$(ProjectName)' on 'dotnet build'. Generated DLL cannot be loaded as WinDbg extension." Condition="'$(MSBuildRuntimeType)' == 'Core' AND '$(ProjectName)' != ''" />
</Target>
</Project>