summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2023-04-19 12:23:22 +0300
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2023-04-20 11:02:12 +0300
commita5128e71bbcc57166412a222d65dbb05ed939d1b (patch)
treeb7bbfa8f78262c1a9323c7d707e5e244c2606693
parent27253f3eb2c78a9ad5114c92eae2036b10e1d7e0 (diff)
downloadredot-engine-a5128e71bbcc57166412a222d65dbb05ed939d1b.tar.gz
[Export docs] Move docs to platform folders.
-rw-r--r--.github/workflows/static_checks.yml4
-rw-r--r--SConstruct12
-rw-r--r--doc/Makefile2
-rwxr-xr-xdoc/tools/make_rst.py2
-rw-r--r--platform/android/detect.py10
-rw-r--r--platform/android/doc_classes/EditorExportPlatformAndroid.xml (renamed from doc/classes/EditorExportPlatformAndroid.xml)0
-rw-r--r--platform/ios/detect.py10
-rw-r--r--platform/ios/doc_classes/EditorExportPlatformIOS.xml (renamed from doc/classes/EditorExportPlatformIOS.xml)0
-rw-r--r--platform/linuxbsd/detect.py10
-rw-r--r--platform/linuxbsd/doc_classes/EditorExportPlatformLinuxBSD.xml (renamed from doc/classes/EditorExportPlatformLinuxBSD.xml)0
-rw-r--r--platform/macos/detect.py10
-rw-r--r--platform/macos/doc_classes/EditorExportPlatformMacOS.xml (renamed from doc/classes/EditorExportPlatformMacOS.xml)0
-rw-r--r--platform/web/detect.py10
-rw-r--r--platform/web/doc_classes/EditorExportPlatformWeb.xml (renamed from doc/classes/EditorExportPlatformWeb.xml)0
-rw-r--r--platform/windows/detect.py10
-rw-r--r--platform/windows/doc_classes/EditorExportPlatformWindows.xml (renamed from doc/classes/EditorExportPlatformWindows.xml)0
16 files changed, 75 insertions, 5 deletions
diff --git a/.github/workflows/static_checks.yml b/.github/workflows/static_checks.yml
index b2ab913234..81c6831a75 100644
--- a/.github/workflows/static_checks.yml
+++ b/.github/workflows/static_checks.yml
@@ -54,11 +54,11 @@ jobs:
- name: Class reference schema checks
run: |
- xmllint --noout --schema doc/class.xsd doc/classes/*.xml modules/*/doc_classes/*.xml
+ xmllint --noout --schema doc/class.xsd doc/classes/*.xml modules/*/doc_classes/*.xml platform/*/doc_classes/*.xml
- name: Documentation checks
run: |
- doc/tools/make_rst.py --dry-run --color doc/classes modules
+ doc/tools/make_rst.py --dry-run --color doc/classes modules platforms
- name: Style checks via clang-format (clang_format.sh)
run: |
diff --git a/SConstruct b/SConstruct
index 8b39f120b4..518dcaa05d 100644
--- a/SConstruct
+++ b/SConstruct
@@ -66,6 +66,7 @@ if ARGUMENTS.get("target", "editor") == "editor":
platform_list = [] # list of platforms
platform_opts = {} # options for each platform
platform_flags = {} # flags for each platform
+platform_doc_class_path = {}
active_platforms = []
active_platform_ids = []
@@ -82,6 +83,15 @@ for x in sorted(glob.glob("platform/*")):
sys.path.insert(0, tmppath)
import detect
+ # Get doc classes paths (if present)
+ try:
+ doc_classes = detect.get_doc_classes()
+ doc_path = detect.get_doc_path()
+ for c in doc_classes:
+ platform_doc_class_path[c] = x.replace("\\", "/") + "/" + doc_path
+ except Exception:
+ pass
+
if os.path.exists(x + "/export/export.cpp"):
platform_exporters.append(x[9:])
if os.path.exists(x + "/api/api.cpp"):
@@ -782,7 +792,7 @@ if selected_platform in platform_list:
modules_enabled = OrderedDict()
env.module_dependencies = {}
env.module_icons_paths = []
- env.doc_class_path = {}
+ env.doc_class_path = platform_doc_class_path
for name, path in modules_detected.items():
if not env["module_" + name + "_enabled"]:
diff --git a/doc/Makefile b/doc/Makefile
index cc2ebf9881..53c5c7dcb0 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -1,5 +1,5 @@
BASEDIR = .
-CLASSES = "$(BASEDIR)/classes/" "$(BASEDIR)/../modules/"
+CLASSES = "$(BASEDIR)/classes/" "$(BASEDIR)/../modules/" "$(BASEDIR)/../platform/"
OUTPUTDIR = $(BASEDIR)/_build
TOOLSDIR = $(BASEDIR)/tools
JSDIR = "$(BASEDIR)/../platform/web"
diff --git a/doc/tools/make_rst.py b/doc/tools/make_rst.py
index 1f71b77cbd..3655a60c35 100755
--- a/doc/tools/make_rst.py
+++ b/doc/tools/make_rst.py
@@ -567,7 +567,7 @@ def main() -> None:
if path.endswith("/") or path.endswith("\\"):
path = path[:-1]
- if os.path.basename(path) == "modules":
+ if os.path.basename(path) in ["modules", "platform"]:
for subdir, dirs, _ in os.walk(path):
if "doc_classes" in dirs:
doc_dir = os.path.join(subdir, "doc_classes")
diff --git a/platform/android/detect.py b/platform/android/detect.py
index ec36a40941..7515d0020d 100644
--- a/platform/android/detect.py
+++ b/platform/android/detect.py
@@ -32,6 +32,16 @@ def get_opts():
]
+def get_doc_classes():
+ return [
+ "EditorExportPlatformAndroid",
+ ]
+
+
+def get_doc_path():
+ return "doc_classes"
+
+
# Return the ANDROID_SDK_ROOT environment variable.
def get_env_android_sdk_root():
return os.environ.get("ANDROID_SDK_ROOT", -1)
diff --git a/doc/classes/EditorExportPlatformAndroid.xml b/platform/android/doc_classes/EditorExportPlatformAndroid.xml
index 570e8f01f1..570e8f01f1 100644
--- a/doc/classes/EditorExportPlatformAndroid.xml
+++ b/platform/android/doc_classes/EditorExportPlatformAndroid.xml
diff --git a/platform/ios/detect.py b/platform/ios/detect.py
index 71612cf1fa..bab055dbd5 100644
--- a/platform/ios/detect.py
+++ b/platform/ios/detect.py
@@ -39,6 +39,16 @@ def get_opts():
]
+def get_doc_classes():
+ return [
+ "EditorExportPlatformIOS",
+ ]
+
+
+def get_doc_path():
+ return "doc_classes"
+
+
def get_flags():
return [
("arch", "arm64"), # Default for convenience.
diff --git a/doc/classes/EditorExportPlatformIOS.xml b/platform/ios/doc_classes/EditorExportPlatformIOS.xml
index 249ee4323c..249ee4323c 100644
--- a/doc/classes/EditorExportPlatformIOS.xml
+++ b/platform/ios/doc_classes/EditorExportPlatformIOS.xml
diff --git a/platform/linuxbsd/detect.py b/platform/linuxbsd/detect.py
index 54351757cd..0bebd29f89 100644
--- a/platform/linuxbsd/detect.py
+++ b/platform/linuxbsd/detect.py
@@ -56,6 +56,16 @@ def get_opts():
]
+def get_doc_classes():
+ return [
+ "EditorExportPlatformLinuxBSD",
+ ]
+
+
+def get_doc_path():
+ return "doc_classes"
+
+
def get_flags():
return [
("arch", detect_arch()),
diff --git a/doc/classes/EditorExportPlatformLinuxBSD.xml b/platform/linuxbsd/doc_classes/EditorExportPlatformLinuxBSD.xml
index 4ab2464929..4ab2464929 100644
--- a/doc/classes/EditorExportPlatformLinuxBSD.xml
+++ b/platform/linuxbsd/doc_classes/EditorExportPlatformLinuxBSD.xml
diff --git a/platform/macos/detect.py b/platform/macos/detect.py
index ae8749354e..7c63fe9211 100644
--- a/platform/macos/detect.py
+++ b/platform/macos/detect.py
@@ -39,6 +39,16 @@ def get_opts():
]
+def get_doc_classes():
+ return [
+ "EditorExportPlatformMacOS",
+ ]
+
+
+def get_doc_path():
+ return "doc_classes"
+
+
def get_flags():
return [
("arch", detect_arch()),
diff --git a/doc/classes/EditorExportPlatformMacOS.xml b/platform/macos/doc_classes/EditorExportPlatformMacOS.xml
index 1a9fd431c7..1a9fd431c7 100644
--- a/doc/classes/EditorExportPlatformMacOS.xml
+++ b/platform/macos/doc_classes/EditorExportPlatformMacOS.xml
diff --git a/platform/web/detect.py b/platform/web/detect.py
index 08c1ff7b4a..419d8918f2 100644
--- a/platform/web/detect.py
+++ b/platform/web/detect.py
@@ -48,6 +48,16 @@ def get_opts():
]
+def get_doc_classes():
+ return [
+ "EditorExportPlatformWeb",
+ ]
+
+
+def get_doc_path():
+ return "doc_classes"
+
+
def get_flags():
return [
("arch", "wasm32"),
diff --git a/doc/classes/EditorExportPlatformWeb.xml b/platform/web/doc_classes/EditorExportPlatformWeb.xml
index 6e5a2ac078..6e5a2ac078 100644
--- a/doc/classes/EditorExportPlatformWeb.xml
+++ b/platform/web/doc_classes/EditorExportPlatformWeb.xml
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index ba8d27bba5..cd6d461a93 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -192,6 +192,16 @@ def get_opts():
]
+def get_doc_classes():
+ return [
+ "EditorExportPlatformWindows",
+ ]
+
+
+def get_doc_path():
+ return "doc_classes"
+
+
def get_flags():
arch = detect_build_env_arch() or detect_arch()
diff --git a/doc/classes/EditorExportPlatformWindows.xml b/platform/windows/doc_classes/EditorExportPlatformWindows.xml
index fee8a118bc..fee8a118bc 100644
--- a/doc/classes/EditorExportPlatformWindows.xml
+++ b/platform/windows/doc_classes/EditorExportPlatformWindows.xml