Skip to content

Commit c8e4811

Browse files
Put 'godot_classes' back in 'fetch_godot_classes', and specify the branch
1 parent 97e5768 commit c8e4811

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

fetch_godot_classes/fetch_godot_classes.py

+11-8
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,17 @@
1111
from pathlib import Path
1212

1313
GODOT_REPOSITORY_URL = "https://github.com/godotengine/godot"
14+
BRANCH = "3.2"
1415
GODOT_REPOSITORY_PATH = "godot"
1516
CLASSES_PATH = "doc/classes"
16-
GODOT_CLASSES_FILE = "../godot_classes"
17+
GODOT_CLASSES_FILE = "godot_classes" + "-" + BRANCH + ".txt"
1718

1819
script_path = Path(__file__).absolute().parent
1920
os.chdir(script_path)
2021

2122
# clone if not already done
2223
if not Path(GODOT_REPOSITORY_PATH).exists():
23-
subprocess.call(["git", "clone", "--no-checkout", "--branch", "3.2",
24+
subprocess.call(["git", "clone", "--no-checkout", "--branch", BRANCH,
2425
"--single-branch", "--depth", "1", GODOT_REPOSITORY_URL, GODOT_REPOSITORY_PATH])
2526

2627
# sparse checkout
@@ -29,13 +30,15 @@
2930
subprocess.call(["git", "sparse-checkout", "set", CLASSES_PATH])
3031

3132
# get those files
32-
file_names = "[\n"
33+
file_content = "// This file was automatically generated from the file names at " + \
34+
GODOT_REPOSITORY_URL + "/tree/" + BRANCH + "/doc/classes\n"
35+
file_content += "[\n"
3336
for file in Path(CLASSES_PATH).glob("*"):
3437
file_name = file.name
3538
if (not file_name.startswith("@")) and file_name.endswith(".xml"):
36-
file_names += " \""
39+
file_content += " \""
3740
file_name = file_name[:-4]
38-
file_names += file_name
39-
file_names += "\",\n"
40-
file_names += "]"
41-
Path("../" + GODOT_CLASSES_FILE).write_text(file_names)
41+
file_content += file_name
42+
file_content += "\",\n"
43+
file_content += "]"
44+
Path("../" + GODOT_CLASSES_FILE).write_text(file_content)

godot_classes fetch_godot_classes/godot_classes-3.2.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// This file was automatically generated from the file names at https://github.com/godotengine/godot/tree/3.2/doc/classes
12
[
23
"ColorPickerButton",
34
"SpatialVelocityTracker",

src/backend/resolve.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub struct Resolver {
2727
const GODOT_DOCUMENTATION_URL: &str = "https://docs.godotengine.org/en/stable/classes";
2828

2929
/// List of godot classes, like `Array`, `int`, `Transform2D`...
30-
const GODOT_CLASSES: &[&str] = &include!("../../godot_classes");
30+
const GODOT_CLASSES: &[&str] = &include!("../../fetch_godot_classes/godot_classes-3.2.txt");
3131

3232
/// List of some godot constants and information about where they sould link to.
3333
///

0 commit comments

Comments
 (0)