-
Notifications
You must be signed in to change notification settings - Fork 203
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
PART V: clean up mayaUsdPlugin #392
PART V: clean up mayaUsdPlugin #392
Conversation
HamedSabri-adsk
commented
Mar 27, 2020
- mayaUsdPlugin promotion headers are now created under mayaUsdPlugin and not mayaUsd
- clean up include order and directive
…eLists.txt. - fix build/usage requirements for mayaUsdUtils and mayaUsd_Translators, testMayaUsdUI - don't rely on ${PROJECT_NAME} because of the folder restructure.
… and not mayaUsd - clean up include order and directive
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.
So, as I discussed in part 4, I think that headers that aren't installed should be considered private, not promoted, and included with private-header syntax. Otherwise, what is considered a private header?
Also, as with last 2 parts, were associated header changes.
There's also the issue of what's considered 7. Your project’s headers vs 4. Other libraries’ headers - I go into more detail in one of my notes below.
|
||
#include <mayaUsd/base/api.h> |
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.
What requires this header? A quick search of the directory didn't show anything using MAYAUSD_CORE_*
, MAYAUSD_MACROS_*
or MAYAUSD_TEMPLATE_*
.
plugin/adsk/plugin/plugin.cpp
Outdated
#include "importTranslator.h" | ||
#include "exportTranslator.h" | ||
#include "ProxyShape.h" | ||
#include <mayaUsd/base/api.h> |
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.
Needed?
|
||
#include <mayaUsd/utils/undoHelperCommand.h> | ||
#if defined(WANT_QT_BUILD) | ||
#include <mayaUsd/ui/cmds/USDImportDialogCmd.h> | ||
#include <mayaUsdUI/ui/cmds/USDImportDialogCmd.h> | ||
#endif | ||
|
||
#if defined(WANT_UFE_BUILD) | ||
#include <mayaUsd/ufe/Global.h> | ||
#endif |
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.
Conditional includes at end
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.
I agree with all of @elrond79's feedback.
If the private headers have to be promoted so that they end up in the build tree, then I'm ok with that, but we should definitely be including them using double-quotes and file-relative paths. Only publicly available headers should be in angle braces.
I read through all of the comments in all 5 PRs and hopefully I haven't missed anything. Thank you @elrond79 @mattyjams @ppt-adsk @seando-adsk again for all the great and detailed feedback. Header order, blank spaces My original goal in this large PR was to eliminate things that clang-format couldn't handle (eliminating relative paths) and I honestly spent little on cosmetics and let clang-format later catch them. I do also understand that we have cases where clang-format can't be smart enough to handle certain ordering. If people are Ok, I can spend a bit more time on some of the cosmetic ordering so at least it is as close as possible to the coding guideline since I am have some changes to make in this area anyways. Any thoughts? Associated headers I am glad we all have the same understanding/agreement. Internally we have an action item to clarify this a bit more in the coding guideline document. Header promotion I do agree with all the comments around not promoting private headers. One of the main reasons we have the private header files promoted is just so that they simply end up in the build tree and help including them using the full path inside their own project (both in associated cpp or any other files).
To sum it up, we have 2 solutions: A- don't promote private headers ( headers that don't installed ) and include them using quotes and no full-path which would also simplifies the CMakelists.txt
B- promote private headers ( headers that don't installed ) and include them using quotes and full-path
Any Thoughts? |
Re For your question, option A is aligned with our guidelines. |
Sounds good - made a PR to clarify guideline: #400 |
The new changes look good - I marked most of my comments as resolved. Are still a few items left unadressed though - the use of <mayaUsd/base/api.h>, and the location of the conditional includes (which I don't think will be automatically moved by clang-format). |
Thanks. I will address whatever is left which shouldn't be as many once we have these 5 PRs merged. |
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 to me! Just one cosmetic note, but likely addressed by clang-format
.
Thanks @HamedSabri-adsk!
#include <mayaUsd/fileio/jobs/jobArgs.h> | ||
#include <mayaUsd/fileio/jobs/readJob.h> | ||
#include <mayaUsd/fileio/shading/shadingModeRegistry.h> | ||
#include <mayaUsd/fileio/jobs/writeJob.h> | ||
|
||
#include "pxr/base/gf/interval.h" | ||
#include "pxr/base/vt/dictionary.h" | ||
#include <mayaUsd/fileio/shading/shadingModeRegistry.h> |
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.
The mayaUsd
group here should move to the bottom after the pxr
group.
Following the merge of PRs Autodesk#388 through Autodesk#392, the header reorganization created some new sites where M3dView.h was being included earlier than sdf/types.h. This change applies an existing pattern of including sdf/types.h early to work around this issue and fix compiling for Maya 2019 (and earlier).