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

Custom solution hierarchy #37

Closed
jp2masa opened this issue Aug 18, 2018 · 5 comments
Closed

Custom solution hierarchy #37

jp2masa opened this issue Aug 18, 2018 · 5 comments
Labels
feature request New feature or enhancement

Comments

@jp2masa
Copy link
Contributor

jp2masa commented Aug 18, 2018

This project is really good, but I think that the generated solution is too complex.

The main problem is that projects should be grouped by folder, not project file, it's too hard to navigate on a solution where all projects are placed under a folder with the same name for no good reason...

It would also be good to be able to specify a custom path for projects, probably using some property on the project, and solution items, probably as item metadata.

Something like:

<Project ...>
    ...
    <PropertyGroup>
        <SlnGenHierarchyPath>Tests\</SlnGenHierarchyPath>
    </PropertyGroup>
    ...
</Project>

and

<Project ...>
    ...
    <ItemGroup>
        <SlnGenSolutionItem Include="build\Targets\**" HierarchyPath="Solution Items\build\Targets\" />
    </ItemGroup>
    ...
</Project>

Is this currently possible? If not, I can help implementing this.

@jeffkl
Copy link
Collaborator

jeffkl commented Aug 20, 2018

At the moment you cannot customize the hierarchy. I've been wanting to put in these features:

  • Flat hierarch (no folders at all)
  • Collapse single project folders (if a folder contains only a single folder, collapse it to something like src\foo\bar)
  • Custom hierarchy

If you have time to contribute anything, please feel free!

@jeffkl jeffkl added the feature request New feature or enhancement label Aug 20, 2018
@jeffkl
Copy link
Collaborator

jeffkl commented Feb 19, 2020

For now we support having folders or not. Let’s re-open if more people request custom hierarchy

@jeffkl jeffkl closed this as completed Feb 19, 2020
@icnocop
Copy link
Contributor

icnocop commented Aug 17, 2023

I think #466 and #467 are related.

@icnocop
Copy link
Contributor

icnocop commented Aug 17, 2023

A humble +1 for generating a sln file with a custom solution folder hierarchy for a set of project files (or a traversal project file).

As a work-around, here are some other tools which may allow this:

  1. Run slngen multiple times for each subtree and then merge the multiple sln files into one using dotnet-slnmerge or merge-solutions
  2. SubSolution

@icnocop
Copy link
Contributor

icnocop commented Aug 18, 2023

For reference, support for

Collapse single project folders (if a folder contains only a single folder, collapse it to something like src\foo\bar)

Was added with the --collapsefolders command line option.

It doesn't seem like there's an equivalent MSBuild property for it though.

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

No branches or pull requests

3 participants