-
Notifications
You must be signed in to change notification settings - Fork 176
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
[Visual Studio] header files with exclude tag and remove from project if all configurations ignore it #42
base: main
Are you sure you want to change the base?
Conversation
Fixed failure in tests, was missing the updated samples. |
Heya! I agree with you that generally marking .h files as excluded or not doesn't have any impact, except if for instance a custom build was set for headers! So it's good to have it fixed! About the other change, I would prefer the files ending up in Thanks for sharing! |
Hey, Let me see if I understood correctly. So adding a new property to Project.Configuration so that all files matching there would not be added in any way to the project, and leaving ResolvedSourceFilesBuildExclude as before. I think it could work especially because we can configure it on ConfigureAll() step. I'll try to make the changes later and see where it leads. Without much thought I'm thinking it would be nice to add a to Project.Configuration |
If you meant: Strings SourceFilesExclude = new Strings();
Strings SourceFiles*Exclude*Regex = new Strings(); Then yes, exactly :) |
Yes made a typo there, but got it right on the code :) Well I made the changes and my own project is exactly the same with the files I wanted to exclude, I just had to change my configs to SourceFilesExcludeRegex instead of SourceFilesBuildExcludeRegex. Let me know if this was what you were mentioning and if it's acceptable. |
Yes sounds good! Could you reapply your changes on top of the dev branch? I rebased it on master to cleanup the history, and had to force push it again... apologies! |
Can I just resolve the conflicts and push a new commit or do you want me to reapply from a "clean" dev branch as it is right now by opening a new pull request? Not sure if I can edit the commits already in this pull request, sorry kinda newbie with github |
Yes, you'll be able to edit the commits, as it is the branch as a whole you are requesting to integrate :) From your current workspace in the dev branch: > git checkout -b saved_dev # this will backup your dev branch in its current state
> git checkout dev # go back to dev
> git reset --hard upstream/dev # resets the branch to the upstream state, considering upstream is the official sharpmake github repo
> git cherry-pick SHA1_Commit # repeat for every commit you want to integrate, taking the SHA1s from the git log in the saved_dev branch
> git push --force origin dev # rewrite the history of the dev branch in your fork, which will automatically update this merge request :)
> git branch -D saved_dev # to cleanup |
…if they match conf.ResolvedSourceFilesBuildExclude
…e project configurations doesn't exclude it
…ateSamplesOutput.bat" in last commit
…w possible to use these properties to exclude files on a Configuration level Vcxprojec will now use ResolvedSourceFilesExclude instead of ResolveSourceFilesBuildExclude to determine if file should be added or not
Great, thank you for the steps, just did and I think it worked :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! but I'm concerned about the cost of reiterating all the configurations for each file and include.
I'll profile with your changes on some of our codebases, and answer back.
Hello, |
Hello,
This refers to a issue I opened a couple months ago #33
I made some changes so that Include files (.h etc) that match exclude from build regex also get the Template.Project.ProjectFilesSourceExcludeFromBuild tag, previously it was only .cpp files. I know having the .h be part of the build or not doesn't impact the configuration but I think this makes it easier to see the solution tree, now both .h and .cpp will show as not part of build.
Another change I made is that while looping allFiles and deciding if a source or header, if all requested Project configurations happen to exclude a certain file then it doesn't get added at all. So in case someone builds only a win32 project it would exclude all mac files for example. But if they add both to configuration it adds the files but marks as ignore from build.
Let me know thoughts and suggestions, if this is helpful or not.