Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(source-generators): Added support nested folders in solution gene… #1425

Conversation

david-driscoll
Copy link
Contributor

Currently nested folders are not supported. Additionally a folder with the same name, creates a compiler error.

This fix adds support for the nested folders, as well as including the parent in the type name.

I confirm that the pull-request:

  • Follows the contribution guidelines
  • Is based on my own work
  • Is in compliance with my employer

@david-driscoll
Copy link
Contributor Author

This may be a nothing burger for now... closing for the moment lol.

@matkoch
Copy link
Member

matkoch commented Sep 15, 2024

I created another folder misc under misc. Does this look right to you?

//HintName: StronglyTypedSolutionGenerator.cs
/// <auto-generated/>
using Nuke.Common.ProjectModel;

internal class Solution : Nuke.Common.ProjectModel.Solution
{
    private Nuke.Common.ProjectModel.Solution SolutionFolder => this;
    public Project _build => SolutionFolder.GetProject("_build");
    public Project Nuke_Common => SolutionFolder.GetProject("Nuke.Common");
    public Project Nuke_Common_Tests => SolutionFolder.GetProject("Nuke.Common.Tests");
    public Project Nuke_Tooling_Generator => SolutionFolder.GetProject("Nuke.Tooling.Generator");
    public Project Nuke_GlobalTool => SolutionFolder.GetProject("Nuke.GlobalTool");
    public Project Nuke_GlobalTool_Tests => SolutionFolder.GetProject("Nuke.GlobalTool.Tests");
    public Project Nuke_MSBuildTasks => SolutionFolder.GetProject("Nuke.MSBuildTasks");
    public Project Nuke_Components => SolutionFolder.GetProject("Nuke.Components");
    public Project Nuke_SourceGenerators => SolutionFolder.GetProject("Nuke.SourceGenerators");
    public Project Nuke_SourceGenerators_Tests => SolutionFolder.GetProject("Nuke.SourceGenerators.Tests");
    public Project Nuke_Utilities => SolutionFolder.GetProject("Nuke.Utilities");
    public Project Nuke_Utilities_Tests => SolutionFolder.GetProject("Nuke.Utilities.Tests");
    public Project Nuke_Utilities_IO_Globbing => SolutionFolder.GetProject("Nuke.Utilities.IO.Globbing");
    public Project Nuke_Utilities_Text_Json => SolutionFolder.GetProject("Nuke.Utilities.Text.Json");
    public Project Nuke_Utilities_Net => SolutionFolder.GetProject("Nuke.Utilities.Net");
    public Project Nuke_Tooling => SolutionFolder.GetProject("Nuke.Tooling");
    public Project Nuke_Tooling_Tests => SolutionFolder.GetProject("Nuke.Tooling.Tests");
    public Project Nuke_SolutionModel => SolutionFolder.GetProject("Nuke.SolutionModel");
    public Project Nuke_SolutionModel_Tests => SolutionFolder.GetProject("Nuke.SolutionModel.Tests");
    public Project Nuke_ProjectModel => SolutionFolder.GetProject("Nuke.ProjectModel");
    public Project Nuke_ProjectModel_Tests => SolutionFolder.GetProject("Nuke.ProjectModel.Tests");
    public Project Nuke_Build_Shared => SolutionFolder.GetProject("Nuke.Build.Shared");
    public Project Nuke_Build => SolutionFolder.GetProject("Nuke.Build");
    public Project Nuke_Build_Tests => SolutionFolder.GetProject("Nuke.Build.Tests");
    public Project Nuke_Utilities_Text_Yaml => SolutionFolder.GetProject("Nuke.Utilities.Text.Yaml");
    public Project Nuke_Utilities_IO_Compression => SolutionFolder.GetProject("Nuke.Utilities.IO.Compression");
    public _misc misc => new(SolutionFolder.GetSolutionFolder("misc"));

    internal class _misc
    {
        private SolutionFolder SolutionFolder { get; }

        public _misc(SolutionFolder solutionFolder) => SolutionFolder = solutionFolder;
        public __misc misc => new(SolutionFolder.GetSolutionFolder("misc"));

        internal class __misc
        {
            private SolutionFolder SolutionFolder { get; }

            public __misc(SolutionFolder solutionFolder) => SolutionFolder = solutionFolder;
        }
    }
}

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

Successfully merging this pull request may close these issues.

2 participants