Skip to content

Commit 364e1ad

Browse files
committed
#375: add workaround to set project reference package version ranges
1 parent 1e5fec1 commit 364e1ad

File tree

3 files changed

+46
-7
lines changed

3 files changed

+46
-7
lines changed

Diff for: src/Plotly.NET.CSharp/Plotly.NET.CSharp.csproj

+15-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,21 @@
3737

3838
<ItemGroup>
3939
<None Include="..\..\docs\img\logo.png" Pack="true" PackagePath="\" />
40-
<!--<ProjectReference Include="..\Plotly.NET\Plotly.NET.fsproj"/>-->
41-
<PackageReference Include="Plotly.NET" Version="4.*" />
40+
<ProjectReference Include="..\Plotly.NET\Plotly.NET.fsproj" PackageVersion="[4.0.0]" />
4241
</ItemGroup>
42+
<Target Name="UseExplicitPackageVersions" BeforeTargets="GenerateNuspec">
43+
<ItemGroup>
44+
<_ProjectReferenceWithExplicitPackageVersion Include="@(ProjectReference->'%(FullPath)')" Condition="'%(ProjectReference.PackageVersion)' != ''" />
45+
<_ProjectReferenceWithExactPackageVersion Include="@(ProjectReference->'%(FullPath)')" Condition="'%(ProjectReference.ExactVersion)' == 'true'" />
46+
<_ProjectReferenceWithReassignedVersion Include="@(_ProjectReferencesWithVersions)" Condition="'%(Identity)' != '' And '@(_ProjectReferenceWithExplicitPackageVersion)' == '@(_ProjectReferencesWithVersions)'">
47+
<ProjectVersion>@(_ProjectReferenceWithExplicitPackageVersion->'%(PackageVersion)')</ProjectVersion>
48+
</_ProjectReferenceWithReassignedVersion>
49+
<_ProjectReferenceWithReassignedVersion Include="@(_ProjectReferencesWithVersions)" Condition="'%(Identity)' != '' And '@(_ProjectReferenceWithExactPackageVersion)' == '@(_ProjectReferencesWithVersions)'">
50+
<ProjectVersion>[@(_ProjectReferencesWithVersions->'%(ProjectVersion)')]</ProjectVersion>
51+
</_ProjectReferenceWithReassignedVersion>
52+
<_ProjectReferencesWithVersions Remove="@(_ProjectReferenceWithReassignedVersion)" />
53+
<_ProjectReferencesWithVersions Include="@(_ProjectReferenceWithReassignedVersion)" />
54+
</ItemGroup>
55+
</Target>
4356

4457
</Project>

Diff for: src/Plotly.NET.ImageExport/Plotly.NET.ImageExport.fsproj

+15-3
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,22 @@
3535
</ItemGroup>
3636

3737
<ItemGroup>
38-
<!--<ProjectReference Include="..\Plotly.NET\Plotly.NET.fsproj"/>-->
39-
<PackageReference Include="Plotly.NET" Version="4.*" />
38+
<ProjectReference Include="..\Plotly.NET\Plotly.NET.fsproj" PackageVersion="[4.0.0]" />
4039
<PackageReference Include="DynamicObj" Version="2.0.0" />
4140
<PackageReference Include="PuppeteerSharp" Version="9.0.2" />
4241
</ItemGroup>
43-
42+
<Target Name="UseExplicitPackageVersions" BeforeTargets="GenerateNuspec">
43+
<ItemGroup>
44+
<_ProjectReferenceWithExplicitPackageVersion Include="@(ProjectReference->'%(FullPath)')" Condition="'%(ProjectReference.PackageVersion)' != ''" />
45+
<_ProjectReferenceWithExactPackageVersion Include="@(ProjectReference->'%(FullPath)')" Condition="'%(ProjectReference.ExactVersion)' == 'true'" />
46+
<_ProjectReferenceWithReassignedVersion Include="@(_ProjectReferencesWithVersions)" Condition="'%(Identity)' != '' And '@(_ProjectReferenceWithExplicitPackageVersion)' == '@(_ProjectReferencesWithVersions)'">
47+
<ProjectVersion>@(_ProjectReferenceWithExplicitPackageVersion->'%(PackageVersion)')</ProjectVersion>
48+
</_ProjectReferenceWithReassignedVersion>
49+
<_ProjectReferenceWithReassignedVersion Include="@(_ProjectReferencesWithVersions)" Condition="'%(Identity)' != '' And '@(_ProjectReferenceWithExactPackageVersion)' == '@(_ProjectReferencesWithVersions)'">
50+
<ProjectVersion>[@(_ProjectReferencesWithVersions->'%(ProjectVersion)')]</ProjectVersion>
51+
</_ProjectReferenceWithReassignedVersion>
52+
<_ProjectReferencesWithVersions Remove="@(_ProjectReferenceWithReassignedVersion)" />
53+
<_ProjectReferencesWithVersions Include="@(_ProjectReferenceWithReassignedVersion)" />
54+
</ItemGroup>
55+
</Target>
4456
</Project>

Diff for: src/Plotly.NET.Interactive/Plotly.NET.Interactive.fsproj

+16-2
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,24 @@
4949
</ItemGroup>
5050

5151
<ItemGroup>
52-
<!--<ProjectReference Include="..\Plotly.NET\Plotly.NET.fsproj"/>-->
53-
<PackageReference Include="Plotly.NET" Version="4.*" />
52+
<ProjectReference Include="..\Plotly.NET\Plotly.NET.fsproj" PackageVersion="[4.0.0]" />
5453
<PackageReference Include="Microsoft.DotNet.Interactive" Version="1.0.0-beta.23102.2" />
5554
<PackageReference Include="Microsoft.DotNet.Interactive.Formatting" Version="1.0.0-beta.23102.2" />
5655
</ItemGroup>
5756

57+
<Target Name="UseExplicitPackageVersions" BeforeTargets="GenerateNuspec">
58+
<ItemGroup>
59+
<_ProjectReferenceWithExplicitPackageVersion Include="@(ProjectReference->'%(FullPath)')" Condition="'%(ProjectReference.PackageVersion)' != ''" />
60+
<_ProjectReferenceWithExactPackageVersion Include="@(ProjectReference->'%(FullPath)')" Condition="'%(ProjectReference.ExactVersion)' == 'true'" />
61+
<_ProjectReferenceWithReassignedVersion Include="@(_ProjectReferencesWithVersions)" Condition="'%(Identity)' != '' And '@(_ProjectReferenceWithExplicitPackageVersion)' == '@(_ProjectReferencesWithVersions)'">
62+
<ProjectVersion>@(_ProjectReferenceWithExplicitPackageVersion->'%(PackageVersion)')</ProjectVersion>
63+
</_ProjectReferenceWithReassignedVersion>
64+
<_ProjectReferenceWithReassignedVersion Include="@(_ProjectReferencesWithVersions)" Condition="'%(Identity)' != '' And '@(_ProjectReferenceWithExactPackageVersion)' == '@(_ProjectReferencesWithVersions)'">
65+
<ProjectVersion>[@(_ProjectReferencesWithVersions->'%(ProjectVersion)')]</ProjectVersion>
66+
</_ProjectReferenceWithReassignedVersion>
67+
<_ProjectReferencesWithVersions Remove="@(_ProjectReferenceWithReassignedVersion)" />
68+
<_ProjectReferencesWithVersions Include="@(_ProjectReferenceWithReassignedVersion)" />
69+
</ItemGroup>
70+
</Target>
71+
5872
</Project>

0 commit comments

Comments
 (0)