You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
DocData: Keep Mono properties on non-Mono builds
This doesn't make much sense API-wise, but it's important for the documentation workflow that the Mono and non-Mono builds produce the same output, otherwise we keep having non-Mono builds removing Mono properties and losing their descriptions. This is a terrible hack but it's ad hoc, and should be OK for the time being.
This commit is contained in:
@@ -40,6 +40,9 @@
|
||||
#include "core/version.h"
|
||||
#include "scene/resources/theme.h"
|
||||
|
||||
// Used for a hack preserving Mono properties on non-Mono builds.
|
||||
#include "modules/modules_enabled.gen.h"
|
||||
|
||||
void DocData::merge_from(const DocData &p_data) {
|
||||
|
||||
for (Map<String, ClassDoc>::Element *E = class_list.front(); E; E = E->next()) {
|
||||
@@ -154,6 +157,23 @@ void DocData::merge_from(const DocData &p_data) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef MODULE_MONO_ENABLED
|
||||
// The Mono module defines some properties that we want to keep when
|
||||
// re-generating docs with a non-Mono build, to prevent pointless diffs
|
||||
// (and loss of descriptions) depending on the config of the doc writer.
|
||||
// We use a horrible hack to force keeping the relevant properties,
|
||||
// hardcoded below. At least it's an ad hoc hack... ¯\_(ツ)_/¯
|
||||
// Don't show this to your kids.
|
||||
if (c.name == "@GlobalScope") {
|
||||
// Retrieve GodotSharp singleton.
|
||||
for (int j = 0; j < cf.properties.size(); j++) {
|
||||
if (cf.properties[j].name == "GodotSharp") {
|
||||
c.properties.push_back(cf.properties[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user