Skip to content

Conversation

@jnm2
Copy link
Contributor

@jnm2 jnm2 commented Apr 3, 2018

Closes #451

The first commit does the minimum necessary to use PackageReference instead of packages.config.
The other does extra cleanup to make the project file smaller.

@jnm2 jnm2 requested a review from OsirisTerje April 3, 2018 16:21
@jnm2 jnm2 changed the title Use PackageReference instead of packages.config in VSIX project [wip] Use PackageReference instead of packages.config in VSIX project Apr 3, 2018
@jnm2 jnm2 changed the title [wip] Use PackageReference instead of packages.config in VSIX project Use PackageReference instead of packages.config in VSIX project Apr 3, 2018
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.props" Condition="Exists('..\..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.props')" />
<Project ToolsVersion="15.0">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since we've already decided to support only VS2017

<RootNamespace>NUnit3TestAdapter</RootNamespace>
<AssemblyName>NUnit3TestAdapter</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetName>NUnit3TestAdapter</TargetName>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

NuGet restore gets confused when two projects have the same AssemblyName. Setting the TargetName to control the output .vsix name is more clear anyway since we're not even compiling an assembly in the VSIX project.

@@ -27,27 +19,11 @@
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
<DeployExtension>False</DeployExtension>
<IsProductComponent>false</IsProductComponent>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems like the eight lines above could be reduced, but I don't know enough about VSIX projects to want to try yet.

<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DeployExtension Condition="'$(AppVeyor)' != ''">False</DeployExtension>
</PropertyGroup>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since we aren't compiling an assembly...

<DeployExtension Condition="'$(AppVeyor)' != ''">False</DeployExtension>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is still necessary so that VS can detect which configurations and platforms to show in Configuration Manager. If these conditions are removed, VS changes the solution file to list this project as x86.

// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since we're not compiling an assembly in this project

</dependentAssembly>
</assemblyBinding>
</runtime>
<startup/></configuration>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since we're not compiling an assembly in this project, nor are we dealing with versions of the engine < 3.0.5797.

Configuration = configuration,
Verbosity = Verbosity.Minimal,
ToolVersion = MSBuildToolVersion.VS2017
}.WithTarget("Restore"));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Neither DotNetCoreRestore nor NuGetRestore are happy about the VSIX project, but MSBuild has become my default ever since NuGet was integrated into the MSBuild SDK.

Copy link
Member

@rprouse rprouse left a comment

Choose a reason for hiding this comment

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

LGTM

@jnm2
Copy link
Contributor Author

jnm2 commented Apr 28, 2018

/cc @OsirisTerje (you had asked that we not merge unless you had reviewed).

@OsirisTerje
Copy link
Member

@jnm2 Merge it :-)

@jnm2 jnm2 merged commit 3f6fb26 into master Apr 28, 2018
@jnm2 jnm2 deleted the jnm2/nuget_v4 branch April 28, 2018 20:25
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.

4 participants