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

[WIP] Refactor: Tool now self-contained, BuildTime merged into it #198

Merged
merged 23 commits into from Mar 27, 2020

Conversation

amis92
Copy link
Collaborator

@amis92 amis92 commented Mar 25, 2020

This is a major refactor.

It's triggered by a disaster of what 0.7.5-alpha turned out to be.

Major features:

  • dotnet-codegen package is now CodeGeneration.Roslyn.Tool, as per project name.
    This was done to prevent confusion with previous CLI tool, which it now is not at all,
    in terms of either DotNetCliToolReference-style tools and global/local .NET CLI tools.
  • Tool is now a DevelopmentDependency=true normal Dependency package (as in,
    suitable for PackageReference usage. Via various properties, it's setup so that it contains
    a framework-dependent executable (.dll) with all dependencies included. Using build/CG.R.Tool.props file, the path to the executable is set in referencing projects.
  • BuildTime package's props/targets were merged into the Tool package because a separate package is no longer necessary, and as such necessary consumer dependencies are trimmed down
    to just CodeGeneration.Roslyn.Tool package and a generator plugin of choice.
  • Samples added: samples that publish generator packages were added, including one that has an external dependency (Newtonsoft.Json). There's also a build script that uses locally built CG.R packages; that script is also called during GitHub Actions CI workflow.

TODO:

  • Update Sdk package as per sample packable generators' csproj files
  • Update samples to use Sdk props/targets directly (not via Sdk element).
  • Update README
  • Update CHANGELOG
  • Note down migration steps

To use Sdk package as an Sdk element, the Sdk will need to be published to nuget.org, because MSBuildSdkResolver doesn't work well with local feeds.

@amis92 amis92 requested a review from AArnott March 25, 2020 23:23
Reason: 3.1 introduces ExcludeFromCodeCoverage on ThisAssembly,
and the attribute is not available in net20 target from Attributes pkg.
@amis92
Copy link
Collaborator Author

amis92 commented Mar 25, 2020

@AArnott as seen in https://github.com/AArnott/CodeGeneration.Roslyn/runs/534972275#step:9:12

Nerdbank.GitVersioning v3.1 introduces ExcludeFromCodeCoverage on ThisAssembly,
and the attribute is not available in net20 target from Attributes pkg.

I had to downgrade. I know net20 is not supported, but maybe you could consider doing an exception for it like you did for netstandard1.x in dotnet/Nerdbank.GitVersioning#453 ?

Don't require runtimes not provided by SDK version used.
@amis92 amis92 added this to the 0.7 milestone Mar 26, 2020
@amis92
Copy link
Collaborator Author

amis92 commented Mar 27, 2020

I've updated the wiki for the newest changes: https://github.com/AArnott/CodeGeneration.Roslyn/wiki/Migrations

@amis92 amis92 merged commit 06982c0 into master Mar 27, 2020
@amis92 amis92 deleted the feature/tool-custom-package branch March 27, 2020 21:36
@amis92
Copy link
Collaborator Author

amis92 commented Mar 27, 2020

@AArnott macos env in AzurePipelines times out since some time.

Edit:
image
https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops

@AArnott
Copy link
Owner

AArnott commented Mar 28, 2020

@amis92 I see you already fixed the macOS problem. :)

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.

None yet

2 participants