|
102 | 102 | </ItemGroup>
|
103 | 103 | </Target>
|
104 | 104 |
|
105 |
| - <!-- Remove the analyzer if packages.config is used --> |
| 105 | + <!-- |
| 106 | + Inform the user if packages.config is used (as the analyzers and the source generators |
| 107 | + won't work at all). Since packages.config can only be used with legacy-style projects, |
| 108 | + the entire package can be skipped if an SDK-style project is used. |
| 109 | + --> |
106 | 110 | <Target Name="MVVMToolkitWarnForPackagesConfigUse"
|
107 | 111 | AfterTargets="ResolvePackageDependenciesForBuild;ResolveNuGetPackageAssets"
|
108 |
| - DependsOnTargets="MVVMToolkitGatherAnalyzers"> |
| 112 | + Condition="'$(UsingMicrosoftNetSDK)' != 'true'"> |
109 | 113 |
|
110 | 114 | <!--
|
111 | 115 | Check whether packages are being restored via packages.config, by reading the associated MSBuild property.
|
112 | 116 | This happens when either the project style is using packages.config, or when explicitly requested.
|
113 |
| - See https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#restoring-packagereference-and-packagesconfig-projects-with-msbuild. |
| 117 | + See https://learn.microsoft.com/nuget/reference/msbuild-targets#restoring-packagereference-and-packagesconfig-projects-with-msbuild. |
114 | 118 | -->
|
115 | 119 | <PropertyGroup>
|
116 | 120 | <MVVMToolkitIsTargetProjectUsingPackagesConfig Condition ="'$(RestorePackagesConfig)' == 'true' OR '$(RestoreProjectStyle)' == 'PackagesConfig'">true</MVVMToolkitIsTargetProjectUsingPackagesConfig>
|
|
120 | 124 | If no packages.config properties are set, also try to manually find the packages.config file.
|
121 | 125 | This will be in the @(None) elements, if present. Doing so makes sure this works in builds as
|
122 | 126 | well, since the implicit targets populating the properties above only run when restoring.
|
| 127 | + Since the packages.config file will always be in the root of the project, if present, we will |
| 128 | + match with the full item spec (see https://learn.microsoft.com/nuget/reference/packages-config). |
123 | 129 | -->
|
124 | 130 | <FindInList ItemSpecToFind="packages.config"
|
125 | 131 | List="@(None)"
|
|
0 commit comments