mono / mono-addins

Mono.Addins is a generic framework for creating extensible applications, and for creating add-ins which extend those applications.
MIT License
163 stars 94 forks source link

Add support for file-glob for file-based Import #79

Open garuma opened 7 years ago

garuma commented 7 years ago

This uses NuGet file globbing library so should support the same set of feature as .nuspec parsing.

mhutch commented 7 years ago

Why not just use MonoDevelop.Addins? That way you can use the full richness of MSBuild, and we don't need to add this to Mono.Addins. You can do this today in your addin csproj:

    <AddinFile Import="Foo/*" />

And the files will be copied to the output directory and added to the manifest.

mhutch commented 7 years ago

Also, if this were the approach we were taking, IMO the pack phase should update the manifest to use the expanded glob, so that that basic addin integrity checks still work.

mhutch commented 7 years ago

@Therzok what nuspec? :)

slluis commented 7 years ago

I'm not opposed to having this feature, in addition to MonoDevelop.Addins. It may be useful for other apps that can't use the extension.

30 new files to just implement a globbing algorithm is overkill. We can just use msbuild-like globbing, which is probably less complete but good enough. We have an implementation here: https://github.com/mono/monodevelop/blob/5893e486d074ecd8f40bcebe65cd6fe112248245/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/DefaultMSBuildEngine.cs#L823.

Also, if this were the approach we were taking, IMO the pack phase should update the manifest to > use the expanded glob, so that that basic addin integrity checks still work.

That would be nice, although it is not a critical issue. The problem is that files may be imported using attributes or in embedded manifests which we can't easily update when packing.