Directory.build.targets 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <Project>
  2. <!-- This has to be set in targets as the default props will overwrite -->
  3. <PropertyGroup>
  4. <DebugType Condition="'$(IsTestProject)' != 'true'">embedded</DebugType>
  5. </PropertyGroup>
  6. <!-- This props all need to be set in targets as they depend on the values set earlier -->
  7. <PropertyGroup Condition="'$(TargetFramework)' == 'netstandard1.0'">
  8. <DefineConstants>$(DefineConstants);NO_ARRAY_EMPTY;NO_CODE_COVERAGE_ATTRIBUTE;CRIPPLED_REFLECTION;PLIB;</DefineConstants>
  9. </PropertyGroup>
  10. <PropertyGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">
  11. <DefineConstants>$(DefineConstants);NO_CODE_COVERAGE_ATTRIBUTE;CRIPPLED_REFLECTION;PLIB;</DefineConstants>
  12. </PropertyGroup>
  13. <PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
  14. <DefineConstants>$(DefineConstants);PLIB;</DefineConstants>
  15. </PropertyGroup>
  16. <PropertyGroup Condition="'$(TargetFramework)' == 'net45'">
  17. <DefineConstants>$(DefineConstants);HAS_APTCA;NO_ARRAY_EMPTY</DefineConstants>
  18. </PropertyGroup>
  19. <PropertyGroup Condition="'$(TargetFramework)' == 'net46'">
  20. <DefineConstants>$(DefineConstants);HAS_APTCA;</DefineConstants>
  21. </PropertyGroup>
  22. <Target Name="GetRefsWithoutLib"
  23. BeforeTargets="_GetPackageFiles"
  24. Condition=" Exists('$(MSBuildThisFileDirectory)refs\$(MSBuildProjectName)\$(MSBuildProjectName).csproj') ">
  25. <MSBuild Projects="$(MSBuildThisFileDirectory)refs\$(MSBuildProjectName)\$(MSBuildProjectName).csproj"
  26. Targets="_GetTargetFrameworksOutput">
  27. <Output TaskParameter="TargetOutputs"
  28. ItemName="_RefTargetFrameworks" />
  29. </MSBuild>
  30. <MSBuild Projects="$(MSBuildThisFileDirectory)refs\$(MSBuildProjectName)\$(MSBuildProjectName).csproj"
  31. Targets="_GetReferenceAssemblies"
  32. Properties="TargetFramework=%(_RefTargetFrameworks.Identity)">
  33. <Output TaskParameter="TargetOutputs"
  34. ItemName="_refAssms" />
  35. </MSBuild>
  36. <ItemGroup>
  37. <None Include="@(_refAssms)" PackagePath="ref/%(_refAssms.TargetFramework)" Pack="true" />
  38. </ItemGroup>
  39. </Target>
  40. </Project>