Skip to content

Commit 1925e91

Browse files
committed
Deduplicate setting of metadata to InteractiveResolvedFile.
1 parent 1e01777 commit 1925e91

File tree

1 file changed

+11
-22
lines changed

1 file changed

+11
-22
lines changed

src/FSharp.DependencyManager.Nuget/FSharp.DependencyManager.ProjectFile.fs

+11-22
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,6 @@ $(PACKAGEREFERENCES)
104104
<Target Name="ComputePackageRootsForInteractivePackageManagement"
105105
DependsOnTargets="ResolveReferences;ResolveSdkReferences;ResolveTargetingPackAssets;ResolveSDKReferences;GenerateBuildDependencyFile;RetrieveNuspecMetadatas;RetrieveNuspecIdAndVersion">
106106
<ItemGroup>
107-
<__InteractiveReferencedAssemblies Include = "@(ReferencePath)" />
108-
<__InteractiveReferencedAssembliesCopyLocal Include = "@(RuntimeCopyLocalItems)" Condition="'$(TargetFrameworkIdentifier)'!='.NETFramework'" />
109-
<__InteractiveReferencedAssembliesCopyLocal Include = "@(ReferenceCopyLocalPaths)" Condition="'$(TargetFrameworkIdentifier)'=='.NETFramework'" />
110107
<__ConflictsList Include="%(_ConflictPackageFiles.ConflictItemType)=%(_ConflictPackageFiles.Filename)%(_ConflictPackageFiles.Extension)" />
111108
</ItemGroup>
112109
@@ -115,30 +112,22 @@ $(PACKAGEREFERENCES)
115112
</PropertyGroup>
116113
117114
<ItemGroup>
118-
<InteractiveResolvedFile Include="@(__InteractiveReferencedAssemblies)"
119-
Condition="$([System.String]::new($(__Conflicts)).Contains($([System.String]::new('Reference=%(__InteractiveReferencedAssemblies.Filename)%(__InteractiveReferencedAssemblies.Extension);'))))"
120-
KeepDuplicates="false">
121-
<NormalizedIdentity Condition="'%(Identity)'!=''">$([System.String]::Copy('%(Identity)').Replace('\', '/'))</NormalizedIdentity>
122-
<NormalizedPathInPackage Condition="'%(__InteractiveReferencedAssemblies.PathInPackage)'!=''">$([System.String]::Copy('%(__InteractiveReferencedAssemblies.PathInPackage)').Replace('\', '/'))</NormalizedPathInPackage>
123-
<PositionPathInPackage Condition="'%(InteractiveResolvedFile.NormalizedPathInPackage)'!=''">$([System.String]::Copy('%(InteractiveResolvedFile.NormalizedIdentity)').IndexOf('%(InteractiveResolvedFile.NormalizedPathInPackage)'))</PositionPathInPackage>
124-
<PackageRoot Condition="'%(InteractiveResolvedFile.NormalizedPathInPackage)'!='' and '%(InteractiveResolvedFile.PositionPathInPackage)'!='-1'">$([System.String]::Copy('%(InteractiveResolvedFile.NormalizedIdentity)').Substring(0, %(InteractiveResolvedFile.PositionPathInPackage)).Replace('\', '/'))</PackageRoot>
125-
<IsNotImplementationReference>$([System.String]::Copy('%(__InteractiveReferencedAssemblies.PathInPackage)').StartsWith('ref/'))</IsNotImplementationReference>
126-
<NuGetPackageId>%(__InteractiveReferencedAssemblies.NuGetPackageId)</NuGetPackageId>
127-
<NuGetPackageVersion>%(__InteractiveReferencedAssemblies.NuGetPackageVersion)</NuGetPackageVersion>
128-
</InteractiveResolvedFile>
115+
<InteractiveResolvedFile Include="@(ReferencePath)"
116+
Condition="$([System.String]::new($(__Conflicts)).Contains($([System.String]::new('Reference=%(ReferencePath.Filename)%(ReferencePath.Extension);'))))"
117+
KeepDuplicates="false" />
129118
130-
<InteractiveResolvedFile Include="@(__InteractiveReferencedAssembliesCopyLocal)" KeepDuplicates="false">
119+
<InteractiveResolvedFile Include = "@(RuntimeCopyLocalItems)" Condition="'$(TargetFrameworkIdentifier)'!='.NETFramework'" KeepDuplicates="false" />
120+
<InteractiveResolvedFile Include = "@(ReferenceCopyLocalPaths)" Condition="'$(TargetFrameworkIdentifier)'=='.NETFramework'" KeepDuplicates="false" />
121+
122+
<InteractiveResolvedFile Update="*">
131123
<NormalizedIdentity Condition="'%(Identity)'!=''">$([System.String]::Copy('%(Identity)').Replace('\', '/'))</NormalizedIdentity>
132-
<NormalizedPathInPackage Condition="'%(__InteractiveReferencedAssembliesCopyLocal.PathInPackage)'!=''">$([System.String]::Copy('%(__InteractiveReferencedAssembliesCopyLocal.PathInPackage)').Replace('\', '/'))</NormalizedPathInPackage>
124+
<NormalizedPathInPackage Condition="'%(InteractiveResolvedFile.PathInPackage)'!=''">$([System.String]::Copy('%(InteractiveResolvedFile.PathInPackage)').Replace('\', '/'))</NormalizedPathInPackage>
133125
<PositionPathInPackage Condition="'%(InteractiveResolvedFile.NormalizedPathInPackage)'!=''">$([System.String]::Copy('%(InteractiveResolvedFile.NormalizedIdentity)').IndexOf('%(InteractiveResolvedFile.NormalizedPathInPackage)'))</PositionPathInPackage>
134126
<PackageRoot Condition="'%(InteractiveResolvedFile.NormalizedPathInPackage)'!='' and '%(InteractiveResolvedFile.PositionPathInPackage)'!='-1'">$([System.String]::Copy('%(InteractiveResolvedFile.NormalizedIdentity)').Substring(0, %(InteractiveResolvedFile.PositionPathInPackage)).Replace('\', '/'))</PackageRoot>
135-
<IsNotImplementationReference>$([System.String]::Copy('%(__InteractiveReferencedAssembliesCopyLocal.PathInPackage)').StartsWith('ref/'))</IsNotImplementationReference>
136-
<NuGetPackageId>%(__InteractiveReferencedAssembliesCopyLocal.NuGetPackageId)</NuGetPackageId>
137-
<NuGetPackageVersion>%(__InteractiveReferencedAssembliesCopyLocal.NuGetPackageVersion)</NuGetPackageVersion>
138-
</InteractiveResolvedFile>
139-
140-
<InteractiveResolvedFile Update="*">
141127
<InitializeSourcePath Condition="Exists('%(InteractiveResolvedFile.PackageRoot)content\%(InteractiveResolvedFile.NugetPackageId)$(SCRIPTEXTENSION)')">%(InteractiveResolvedFile.PackageRoot)content\%(InteractiveResolvedFile.NugetPackageId)$(SCRIPTEXTENSION)</InitializeSourcePath>
128+
<IsNotImplementationReference>$([System.String]::Copy('%(InteractiveResolvedFile.PathInPackage)').StartsWith('ref/'))</IsNotImplementationReference>
129+
<NuGetPackageId>%(InteractiveResolvedFile.NuGetPackageId)</NuGetPackageId>
130+
<NuGetPackageVersion>%(InteractiveResolvedFile.NuGetPackageVersion)</NuGetPackageVersion>
142131
</InteractiveResolvedFile>
143132
144133
<NativeIncludeRoots

0 commit comments

Comments
 (0)