-
Notifications
You must be signed in to change notification settings - Fork 80
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
Example for CustomBeforeSlnGenTargets #448
Comments
@michael-hawker the targets only run when you use We could come up with a new design of something like "run this before and after solution generation", I'm open to suggestions and designs... |
I guess I don't still quite understand how the old property version worked. Was it just a path to an Could we have a project owner just specify a custom target in their own project files that are getting analyzed by slngen itself? Like: <Target Name="PreSolutionGeneration">
<Message Text="Target would be executed before slngen runs the rest of its code." />
</Target>
<Target Name="PostSolutionGeneration">
<Message Text="Target would be executed after slngen runs its code before it opens Visual Studio" />
</Target> I'd imagine someone could also do something similar like this instead too: <Target Name="MyCustomStep" BeforeTargets="PreSolutionGeneration">
<Message Text="Target would still be executed before slngen runs the rest of its code." />
</Target> Which would be safer as instead of replacing the Would something like that be possible? It'd basically just make it feel like it fits in with the rest of the msbuild ecosystem? |
The way the target version of SlnGen worked is you'd add a
The And that file imports a file based on the value of the But the global tool just loads the projects and gets the info, it does not run any targets. This is because its much faster that way. |
Thanks @jeffkl, where are the projects loaded in the code base? There are some properties specific to slngen that get looked at, right? Does that happen in the same spot. Would it also not be possible to look at targets defined in the project files loaded and see if they have a specific name then? |
Think this allows us to run msbuild logic before a solution is generated? This should be useful for us as we want to generate some projects from common code for our project. (e.g. we have a runner that is basically the same to execute the code within the repo, we don't want to duplicate it in each folder for each project)
However, the docs just call this property/target out without a clear example of how this system should work. Is it a target to write a custom target section or is this supposed to just be a path to a props file or something???
Like I'd like to have actual logic to run like a file copy, which means I'd need it to be a target or something to do something before the rest of the slngen command runs, right?
The text was updated successfully, but these errors were encountered: