Skip to content
This repository has been archived by the owner on Dec 12, 2020. It is now read-only.

Use McMaster.NETCore.Plugins for assembly loading #156

Merged
merged 16 commits into from
Jan 5, 2020
Merged

Conversation

amis92
Copy link
Collaborator

@amis92 amis92 commented Jul 30, 2019

  • Engine uses McMaster.NETCore.Plugins package to resolve assemblies and dependencies, enabling generators to reference additional dependencies! 🎉
  • Tasks deprecate GeneratorAssemblySearchPaths usage
  • Tasks use CodeGenerationRoslynPlugin ItemGroup instead, which contains
    concrete assembly paths (instead of containing folder paths, as was previously)
  • Engine targets netcoreapp2.0 to reference McMaster package
  • Tests use Amadevus.RecordGenerator NuGet generator for
    back-compat checks
  • Tests.Generators use Bogus NuGet for NuGet dependency resolution check
  • CodeGeneration.Roslyn.Plugin.Sdk MSBuild project Sdk created, to help build and package plugins correctly.
  • Migrate to use VS2019/.NET Core SDK v3.1
  • Rewritten Readme with a simpler demo and more advanced scenarios

Added https://github.com/AArnott/CodeGeneration.Roslyn/wiki/Migrations#v07 to help with migrations.

closes #114

CC @Pzixel

TODO:

  • Update documentation, README etc.

@amis92 amis92 added this to the 0.7 milestone Jul 30, 2019
@amis92 amis92 requested a review from AArnott July 30, 2019 11:44
@Pzixel
Copy link
Contributor

Pzixel commented Jul 30, 2019

Cool. The only bad thing about that is that I probably changing my job so I won't need a codegen soon. Waited for too long 😄

Awesome work guys, anyway. Gonna update my library if it fits. I will check this when it gets into the nuget.

@amis92 amis92 mentioned this pull request Aug 14, 2019
Copy link
Owner

@AArnott AArnott left a comment

Choose a reason for hiding this comment

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

Looks awesome. I definitely need to learn more about this McMaster.NETCore.Plugins too, since I will soon be building a .NET Core app that is extensible.

@AArnott
Copy link
Owner

AArnott commented Aug 24, 2019

Please do update the README as you say though.

@tedvanderveen
Copy link

Great work guys, this should fix the issue I'm facing right now!

@Pzixel
Copy link
Contributor

Pzixel commented Oct 14, 2019

And it still open. Guys, that issue blocks a lot of good stuff. Consider revisiting it soon? CC @amis92

@Pzixel
Copy link
Contributor

Pzixel commented Nov 28, 2019

I wonder if this is going to merge before 2020

* Tasks deprecate `GeneratorAssemblySearchPaths` usage
* Tasks use `CodeGenerationRoslynPlugin` Item instead, which contains
  concrete assembly paths
* Engine targets `netcoreapp2.0` to reference McMaster package
* Tests use Amadevus.RecordGenerator NuGet generator for
  back-compat checks
* Tests.Generators use Bogus NuGet for NuGet dependency resolution check
@amis92
Copy link
Collaborator Author

amis92 commented Dec 9, 2019

I'd like to announce I'm back, working on it. I have to admit, the "your code from 3 months ago could be written by someone else" saying is so true.

If someone wants to help, don't hesitate. I'll probably run some tests, try to touch up documentation to the best of my abilities, and push a beta release since I really need some external input and testing.

@Pzixel
Copy link
Contributor

Pzixel commented Dec 9, 2019

I'd like to help but I won't be able to if there won't be a nuget package with it.

My primary OS is windows so I only can build in docker. And the only sane way of running it in docker is pull items from nuget. Packing nuget locally and copying it via Dockerfile doesn't seem to be an easy task.

@amis92
Copy link
Collaborator Author

amis92 commented Dec 10, 2019

📝 I'm using MSBuildWarningsAsMessages feature of v15.0 (dotnet/msbuild#1928).

Now the list of plugin assemblies is always read
from response file (plugin list),
the last modified time is calculated using those assemblies,
and the .AssemblyList.txt file is not created.

Also separated reading the results into another target,
and set Inputs and Outputs so that the MSBuild can fully skip
executing the target that invokes CLI tool.
_CodeGenToolVersionExitCode was compared to zero
via != instead of ==
@amis92
Copy link
Collaborator Author

amis92 commented Dec 13, 2019

I've added a Plugin.Sdk (first idea #113) to the mix, and I think quite extensive documentation in the readme.

@AArnott want to play with it, or merge and push out as a beta to let the people play?

@AArnott
Copy link
Owner

AArnott commented Dec 20, 2019

@amis92 Thanks again for putting this together. I'm not sure when I'll have time to play with it. Maybe next week. If I don't get back to you early next week feel free to complete anyway.

@AArnott AArnott self-assigned this Dec 20, 2019
@amis92 amis92 merged commit dadd639 into master Jan 5, 2020
@amis92
Copy link
Collaborator Author

amis92 commented Jan 5, 2020

it's done - Frodo under mt doom - GIF

@amis92 amis92 deleted the feature/plugins branch January 5, 2020 21:14
@amis92
Copy link
Collaborator Author

amis92 commented Jan 5, 2020

@Pzixel

v0.7.5-alpha

@Pzixel
Copy link
Contributor

Pzixel commented Jan 5, 2020

I wonder if this is going to merge before 2020

Well, it didn't... :)


guess my origin

Thanks for PR, I'l try to manage to get to it soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use McMaster's DotNetCorePlugins
4 participants