BundlerMinifier
BundlerMinifier copied to clipboard
.NET Core 2.1 global tool
Would it be possible to allow installation of the this as a global tool? It currently only allows local tool installation, and it would useful if you could install it once using the new global tool system in .NET Core 2.1.
I'll update BundlerMinifier to .NET Core 2.1 shortly, along with NuGet packages. Expect it soon. CC @madskristensen
Is there has new tool now?
@seanmars two thing - for direct porting -> I've looked into moving it to .NET Core 2.1; the problem is that people stuck on .NET Core 2.0 would not be able to use it. We don't get anything special.
For global tool - I wanted to explore how to add support for this... @Gorea235 do you have suggestion on the whole flow? If you do make pull request and add feature - I'll review, merge and push it promptly - just let me know.
From what I've seen and read, all that's needed is to add the new target
<TargetFrameworks>netcoreapp1.0;net452;netcoreapp2.0;netstandard2.0;netcoreapp2.1</TargetFrameworks>
and then to add the following block to the csproj
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">
<!-- enable .NET Core 2.1 features -->
<IsPackable>true</IsPackable>
<PackAsTool>true</PackAsTool>
<!-- the following is entirely optional, but it is a .NET Core 2.1 feature only, which is why it is here -->
<TieredCompilation>true</TieredCompilation>
</PropertyGroup>
I can have a look at adding it myself, but I haven't set up this repo on my machine so far, and I haven't worked out how to test global tools properly, so it might take some time to get it to a workable state. I don't think there would be any further problems with it, since nuget allows multiple targets, and all the code is .NET Standard compatible (which applies to .NET Core 2.1 as well).
@Gorea235 - yeah, that additional target was something I looked at... it does make sense in this scenario... a lot of sense.
I gave it a try with changes you've proposed and while making Nuget package works quite well, it seems to run into problem of resolving netcoreapp2.1 tool from all the versions packaged in there. I get:
error NU1212: Invalid project-package combination for BundlerMinifier.Core 3.0.0. DotnetToolReference project style can only contain references of the DotnetTool type
So, let's wait until you can setup your environment and try creating package on your machine. Plus that way you can maybe create a test that ensure we won't break anything in future. As soon as Nuget is ready, it'll be easy to push few commits and get it to https://www.nuget.org/
And yeah, before I forget - one problem is that global tool is now named BundlerMinifier.Core (NuGet package name). Would be good if we find a way to make that just bundlerminifier instead of forcing people to always type bundlerminifier.core
Wouldn't this work?
"BundlerMinifier.Core": {
"version": "3.2.449",
"commands": [
"bundle"
]
}
Sadly enough it gives me the same error:
PM> dotnet tool restore
error NU1212: Invalid project-package combination for BundlerMinifier.Core 3.2.449. DotnetToolReference project style can only contain references of the DotnetTool type