Code Monkey home page Code Monkey logo

msbuild.nugetcontentrestore's People

Contributors

olivierlemasle avatar panchilo avatar terenberger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

msbuild.nugetcontentrestore's Issues

Ignore files patterns not working in some cases

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.

Add project transformation

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.

Content not copying to expected location

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)

*.pp file support

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.

Is your Usage missing a step?

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?

Error in importing task if SolutionDir paramerter not available

NugetContentRestore target uses $(SolutionDir) parameter, but it is unavailable in several specific cases when running msbuild from command line:

  • when building just web project (msbuild SomeWebProj.csproj)
  • when building solution. For web project validation build starts which doesn't reference $(SolutionDir).

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.

Add PowerShell support

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.

files in root of .nupkg content/ are not 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.

Add VerbosityLevel argument to task

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 root C(c)content folder should be handled case insensitive

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"

Cannot use with anything but desktop .NET projects

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.

MSBuild.NugetContentRestore should be marked as a developmentDependency

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.

Not Working

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

image

When I attempt to build, nothing gets copied into the App_Packages folder.

Am I missing something?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.