rubicon-oss / LicenseHeaderManager

Manage license headers for your source code files in Visual Studio

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`Add an existing License Header Definition file` for a solution

MihailsKuzmins opened this issue · comments

I use a Visual Studio 2019 16.8.2
License Header management: 3.0.3

I have a repository where there are many solution, so I have only a shared license header file with I would like to share amongst all my solutions.
It is possible for project files, but not possible for a solution, therefore, it's a pain to add this shared license header file to all of my projects, then clicking on every project and adding the header.

Would it be possible to the same option "Add an existing License Header Definition file" for a solution? Or at least could you provide any pieces of advice how my approach of sharing a single license header file could be simplified?

Hi @MihailsKuzmins,

unfortunately, there is no included way to achieve what you desire. One possible workaround could be creating hard symbolic links for your .licenseheader files. I tried doing that and it works just fine with local development, the links just have to be named [SolutionName].sln.licenseheader. Unfortunately, the approach becomes tricky when you try to check the link files into git, that doesn't seem to work. You could come up with a solution that generates those symlinks with a script triggered by a build or git hook etc. but that would unfortunately be up to you and not us.

I hope you're able to handle your issue, with symlinks or otherwise.

Best regards,
Stefan

Hi @Stefan-Ilic,

thank you for the answer. I see, so I will try to do it as you suggested. I guess if it is not planned to be on the roadmap you could close the issue.
Or maybe if you are open for PRs I might look into this problem and provide a solution. Do not know yet whether or I can do it, but I think it is worth trying