Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViktor Hofer <viktor.hofer@microsoft.com>2022-05-11 14:37:12 +0300
committerGitHub <noreply@github.com>2022-05-11 14:37:12 +0300
commit5b5bd46c03c86f8545f2c4c8628ac25d875210fe (patch)
treef7e6f7bb945d52a3ac4e1982118597c49cbc1f2d /eng/references.targets
parent9158543338acd47019ffb6ec634a273a9e28cb99 (diff)
Error if a reference assembly is platform specific (#69116)
Fixes https://github.com/dotnet/runtime/issues/29154. I didn't introduce a new target to keep the validation cost as low as possible.
Diffstat (limited to 'eng/references.targets')
-rw-r--r--eng/references.targets15
1 files changed, 8 insertions, 7 deletions
diff --git a/eng/references.targets b/eng/references.targets
index 5b7418b38e6..80eed8f9a38 100644
--- a/eng/references.targets
+++ b/eng/references.targets
@@ -74,12 +74,14 @@
</TargetPathWithTargetPlatformMoniker>
</ItemDefinitionGroup>
- <Target Name="ValidateReferenceAssemblyProjectReferences"
+ <Target Name="ValidateReferenceAssemblyProjectReferencesAndTargetFramework"
AfterTargets="ResolveReferences"
Condition="'$(IsReferenceAssemblyProject)' == 'true' and
'$(SkipValidateReferenceAssemblyProjectReferences)' != 'true'">
- <Error Condition="'%(ReferencePath.ReferenceSourceTarget)' == 'ProjectReference' and '%(ReferencePath.IsReferenceAssemblyProject)' != 'true' and '%(ReferencePath.ReferenceAssembly)' == ''"
- Text="Reference assemblies must only reference other reference assemblies and '%(ReferencePath.ProjectReferenceOriginalItemSpec)' is not a reference assembly project and does not set 'ProduceReferenceAssembly'." />
+ <Error Text="Reference assemblies must only reference other reference assemblies and '%(ReferencePath.ProjectReferenceOriginalItemSpec)' is not a reference assembly project and does not set 'ProduceReferenceAssembly'."
+ Condition="'%(ReferencePath.ReferenceSourceTarget)' == 'ProjectReference' and '%(ReferencePath.IsReferenceAssemblyProject)' != 'true' and '%(ReferencePath.ReferenceAssembly)' == ''" />
+ <Error Text="Reference assemblies must be TargetPlatform agnostic. $(MSBuildProjectName) incorrectly targets $(TargetFramework), platform: $(TargetPlatformIdentifier)."
+ Condition="'$(TargetPlatformIdentifier)' != ''" />
</Target>
<!-- An opt-in target to trim out private assemblies from the ref assembly ReferencePath. -->
@@ -92,13 +94,12 @@
</ItemGroup>
</Target>
- <!-- For experimental ref assemblies (which typically have the same name as a regular ref
+ <!-- For experimental ref assemblies (which typically have the same name as a regular ref
assembly), bump their minor file version by 100 to make it distinguishable from the regular
- ref assembly.
- -->
+ ref assembly. -->
<Target Name="UpdateExperimentalRefAssemblyFileVersion"
AfterTargets="_InitializeAssemblyVersion"
- Condition="'$(IsReferenceAssemblyProject)' == 'true' and '$(IsExperimentalRefAssembly)' == 'true'">
+ Condition="'$(IsReferenceAssemblyProject)' == 'true' and '$(IsExperimentalRefAssembly)' == 'true'">
<PropertyGroup>
<_FileVersionMaj>$(FileVersion.Split('.')[0])</_FileVersionMaj>
<_FileVersionMin>$(FileVersion.Split('.')[1])</_FileVersionMin>