panchilo / msbuild.nugetcontentrestore Goto Github PK
View Code? Open in Web Editor NEWMSBuild task to restore Nuget content files to project folder
License: MIT License
MSBuild task to restore Nuget content files to project folder
License: MIT License
If custom packages repository path is used, nothing is restored. I see you have a PR for this issue since Nov 2016 (!?). It would be nice if can merge it ;)
The Wildcard Class that I used to transform a file wildcard pattern (*.pp, readme.???, etc.) to a Regex doesn't work very well with some patterns. For example, having a pattern like *.pp with match files like "ISomeInterface.cs.pp" but it will also match file names like "SomeClass.pp.cs". This is not a big issue because I can't think of a good example where someone would like to use ".pp" and then continuing the file name with something else, specially in the html front-end world. But it's definitely something to fix.
The only thing left to do after installing the package with NuGet is to call it in your BeforeBuild target. This is a very simple task to do, but it would be great to have the package installation take care of this automatically.
For some reason the when the NugetContentRestore task executes, the content is not being copied to the expected location. When the nuget package is installed it is copied to D:\repo\solution\project\content\myCoolNugetPackage but when NugetContentRestore is run it attempts to copy to D:\repo\solution\packages\myCoolNugetPackage.
Below is some of the output from the build log:
3> NugetContentRestore :: myCoolNugetPackage :: FullPath='D:\repo\solution\packages\myCoolNugetPackage' (TaskId:86)
3> NugetContentRestore :: myCoolNugetPackage :: ContentsFullPath='D:\repo\solution\packages\myCoolNugetPackage\Content' (TaskId:86)
Is there any plan to support *.pp file processing? It looks like it's also not being processed during standard NuGet Restore and this otherwise perfect MSBuild task doesn't handle *.pp files at all.
Here is my expectation based on your README.
I am already using some NuGet packages (that include binaries that I don't want to check into source control). I would like a restore to copy content to my project folders. So I add your package as explained and then magically whenever a restore of one of my packages is done, the content is copied to the project directory.
But, I am not seeing any copy performed. Is there some other step I need to perform to hook up your package?
NugetContentRestore target uses $(SolutionDir) parameter, but it is unavailable in several specific cases when running msbuild from command line:
The problem is fixed by changing in file NugetContentRestore.targets UsingTask to this:
(No need to full path to assembly, it is relative to targets file)
Please, verify this and make a fix.
The latest release does not support EnableSmartRestore
- can you please update nuget.org with latest?
I attempted to run this in a solution with multiple projects, and the install.ps1 was only run for one project. Wondering if it's related to it being deprecated in 2017:
It would be nice to have a registered PowerShell Command Line (e.g. Nuget-RestoreContent) that one can invoke from the Package Manager Console so avoid having to build the project to get the content files copied.
There's no way to copy files in the Content/ folder itself without potentially copying subfolders you don't want. This means that nuget packages must be crafted to put 'root content' in the Content/content/ folder.
Hey,
Get-Project is returning random project. Change it to be $project instead
Currently, the task writes with a high priority to the Output. It is giving details at the folder level, so if the package, say bootstrap, has a Scripts, a content and a fonts folder, you will see three lines in your output, one per folder.
I believe it'd be interesting to have three levels: Package, Folder, File. I'd have Folder to be the default and let the users change it.
the copying does not work on Linux some the packages where content root folder is specified in a different case than "Content"
for instance:
this one works fine:
packages\jQuery.UI.1.12.1.1\Content..
but this one does not work
packages\jsTree.3.1.1.2\content..
it happens because of different naming in "Content" and "content"
I just tried to install MSBuild.NugetContentRestore 0.1.6 into my Xamarin.Android project, and got the following error message:
Could not install package 'MSBuild.NugetContentRestore 0.1.6'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v5.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
NuGet doesn't know that NugetContentRestore's net40/ DLL is just used for building, and not for linking. I imagine that it's just as impossible to install NugetContentRestore into any non-desktop project, including PCL projects, Windows Store, .NET Core, etc.
I think the fix is as simple as putting MSBuild.NugetContentRestore.dll and MSBuild.NugetContentRestore.targets directly in the build/ folder, instead of in the build/net40/ folder.
In other words, projects that use NugetContentRestore should not demand that their dependencies install NugetContentRestore as well.
MSBuild.NugetContentRestore should have <developmentDependency>true</developmentDependency>
in the <metadata>
section of its nuspec file, which would ensure that the developmentDependency="true" attribute is included in the line in packages.config.
As NuGet's documentation explains:
It allows package authors to declare dependencies that were only used at development time and don't require package dependencies. By adding a developmentDependency="true" attribute to a package in packages.config, nuget.exe pack will no longer include that package as a dependency.
I may not be understanding this, but I installed this via Nuget and assumed it would fire an event during the build that would find content files in any nuget packages, and put them in their appropriate locations within the project folder... This is not happening
I have this NuGet package installed: DLaB.Common.Sources
When I attempt to build, nothing gets copied into the App_Packages folder.
Am I missing something?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.