Skip to content

Add autodetection of PackageDownload version#73

Merged
sharwell merged 1 commit into
tunnelvisionlabs:masterfrom
jnm2:autodetect_package_download
Jan 2, 2020
Merged

Add autodetection of PackageDownload version#73
sharwell merged 1 commit into
tunnelvisionlabs:masterfrom
jnm2:autodetect_package_download

Conversation

@jnm2

@jnm2 jnm2 commented Jan 1, 2020

Copy link
Copy Markdown
Contributor

Next best while sticking with PackageDownload as the means of obtaining the package, since #70 is not technically feasible.

@jnm2
jnm2 force-pushed the autodetect_package_download branch from 756d843 to b7c41bb Compare January 1, 2020 22:23
<Target Name="ResolveAnnotatedReferenceAssemblies">
<Target Name="DetermineAnnotationPackageDownloadVersion">
<ItemGroup>
<_CandidatePackageDownloadVersion Include="@(PackageDownload->'%(Version)'->Distinct())" Condition="'%(PackageDownload.Identity)' == 'Microsoft.NETCore.App.Ref'" />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💭 Does this work with just %(Identity)?

Suggested change
<_CandidatePackageDownloadVersion Include="@(PackageDownload->'%(Version)'->Distinct())" Condition="'%(PackageDownload.Identity)' == 'Microsoft.NETCore.App.Ref'" />
<_CandidatePackageDownloadVersion Include="@(PackageDownload->'%(Version)'->Distinct())" Condition="'%(Identity)' == 'Microsoft.NETCore.App.Ref'" />

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot to try this.

@sharwell
sharwell merged commit 01b2c5f into tunnelvisionlabs:master Jan 2, 2020
@jnm2
jnm2 deleted the autodetect_package_download branch January 2, 2020 14:43
Comment thread README.md
Comment on lines 46 to 61
<ItemGroup>
<PackageReference Include="TunnelVisionLabs.ReferenceAssemblyAnnotator" Version="$(TunnelVisionLabsReferenceAssemblyAnnotatorVersion)" PrivateAssets="all" />
<PackageDownload Include="Microsoft.NETCore.App.Ref" Version="[$(AnnotatedReferenceAssemblyVersion)]" />
<PackageReference Include="TunnelVisionLabs.ReferenceAssemblyAnnotator" Version="1.0.0-alpha.138" PrivateAssets="all" />

<!-- Specifies the version of Microsoft.NETCore.App.Ref to obtain nullability information from. -->
<PackageDownload Include="Microsoft.NETCore.App.Ref" Version="[3.1.0]" />
</ItemGroup>
```

Minimal:

```xml
<PropertyGroup>
<AnnotatedReferenceAssemblyVersion>3.1.0</AnnotatedReferenceAssemblyVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="TunnelVisionLabs.ReferenceAssemblyAnnotator" Version="1.0.0-alpha.138" PrivateAssets="all" />
<PackageDownload Include="Microsoft.NETCore.App.Ref" Version="[$(AnnotatedReferenceAssemblyVersion)]" />
<PackageDownload Include="Microsoft.NETCore.App.Ref" Version="[3.1.0]" />
</ItemGroup>
```

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sharwell Ugh, readme fail. These snippets don't work against 1.0.0-alpha.138.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants