-
Notifications
You must be signed in to change notification settings - Fork 144
Expand file tree
/
Copy pathCommon.targets
More file actions
52 lines (47 loc) · 2.84 KB
/
Common.targets
File metadata and controls
52 lines (47 loc) · 2.84 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
<?xml version="1.0" encoding="utf-8"?>
<Project>
<!-- This file is included in all projects inside src and tests directories. -->
<Import Project="$(MSBuildThisFileDirectory)\CodeAnalysis.targets" />
<PropertyGroup>
<LangVersion>latest</LangVersion>
<RunAnalyzersDuringBuild>false</RunAnalyzersDuringBuild>
<!--
SCAN4NET-968 Cross-framework references are confusing dotnet restore. This should be solved once we remove SonarScanner.MSBuild.TFS.Classic.
It needs to be in Common.targets to prevent packages.lock.json form being created by VS.
It needs to be in SonarScanner.MSBuild.TFS.Test.csproj for the actual builds.
-->
<RestorePackagesWithLockFile Condition="'$(ProjectName)' != 'SonarScanner.MSBuild.TFS.Test'">true</RestorePackagesWithLockFile>
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
<AutomaticallyUseReferenceAssemblyPackages>false</AutomaticallyUseReferenceAssemblyPackages>
<!-- Disable package pruning to ensure lock files are consistent across platforms (Linux/Windows).
Without this, .NET 10 SDK prunes platform-specific dependencies, causing NU1004 errors when
lock files generated on Linux are restored on Windows. See sonar-dotnet-enterprise#1677. -->
<RestoreEnablePackagePruning>false</RestoreEnablePackagePruning>
<!-- Disable automatic RuntimeIdentifier inference to ensure lock files are consistent across platforms.
Without this, the SDK infers platform-specific RIDs (e.g., win-x86) on Windows but not on Linux,
causing NU1004 errors when lock files generated on Linux are restored on Windows.
See: https://github.com/NuGet/Home/issues/12711 -->
<UseCurrentRuntimeIdentifier>false</UseCurrentRuntimeIdentifier>
<RuntimeIdentifier></RuntimeIdentifier>
<RuntimeIdentifiers></RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup Condition="'$(ProjectName)' != 'LogArgs'">
<Using Include="System" />
<Using Include="System.Collections.Generic" />
<Using Include="System.Diagnostics" />
<Using Include="System.IO" />
<Using Include="System.Linq" />
<Using Include="System.Reflection" />
<Using Include="System.Text" />
</ItemGroup>
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<Deterministic>true</Deterministic>
</PropertyGroup>
<!-- Explicit reference to ensure consistent lock files across platforms (Linux/Windows).
On Linux, this package is implicitly added for .NET Framework targets, but not on Windows.
See: https://github.com/NuGet/Home/issues/9195 and sonar-dotnet-enterprise#1676. -->
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" />
</ItemGroup>
</Project>