-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: unit tests were disabled * chore: fix clang formatting * fix: issue for codespell * fix: issue with add_source_files for tests * fix: black formatter * chore: move formatting * fix: disable some static checks * fix: issue with cicd * chore: align generation of files
- Loading branch information
Showing
23 changed files
with
317 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
def get_bindings_header(): | ||
return ( | ||
'/* THIS FILE IS GENERATED DO NOT EDIT */\n#include "../javascript_binder.h"\nString JavaScriptBinder::{} = \n{};' | ||
) | ||
|
||
|
||
def get_binding_files(): | ||
return { | ||
"misc/godot.binding_script.gen.cpp": ( | ||
"BINDING_SCRIPT_CONTENT", | ||
"misc/binding_script.js", | ||
), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
def get_editor_tools_header(): | ||
return ( | ||
'/* THIS FILE IS GENERATED DO NOT EDIT */\n#include "editor_tools.h"\nString JavaScriptPlugin::{} = \n{};' | ||
) | ||
|
||
|
||
def get_editor_tools_files(): | ||
return { | ||
"editor/godot.d.ts.gen.cpp": ( | ||
"BUILTIN_DECLARATION_TEXT", | ||
"misc/typescript/godot.d.ts", | ||
), | ||
"editor/tsconfig.json.gen.cpp": ( | ||
"TSCONFIG_CONTENT", | ||
"misc/typescript/tsconfig.json", | ||
), | ||
"editor/decorators.ts.gen.cpp": ( | ||
"TS_DECORATORS_CONTENT", | ||
"misc/typescript/decorators.ts", | ||
), | ||
"editor/package.json.gen.cpp": ( | ||
"PACKAGE_JSON_CONTENT", | ||
"misc/typescript/package.json", | ||
), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import platform, os | ||
|
||
|
||
def get_path(javascript_dir, path): | ||
return os.path.abspath(os.path.join(javascript_dir, path)) | ||
|
||
|
||
def open_file(javascript_dir, path, mode): | ||
file = get_path(javascript_dir, path) | ||
if platform.python_version() > "3": | ||
return open(file, mode, encoding="utf8") | ||
else: | ||
return open(file, mode) | ||
|
||
|
||
def dump_text_file_to_cpp(javascript_dir, path): | ||
source = open_file(javascript_dir, path, "r").read() | ||
lines = source.split("\n") | ||
source = "" | ||
length = len(lines) | ||
for i in range(length): | ||
line = lines[i].replace('"', '\\"') | ||
line = '\t"' + line + '\\n"' | ||
if i < length - 1: | ||
line += "\n" | ||
source += line | ||
return source | ||
|
||
|
||
def generate(javascript_dir, header, tool_fns): | ||
for fn, subs in tool_fns.items(): | ||
with open_file(javascript_dir, fn, "w") as fh: | ||
name = subs[0] | ||
file = dump_text_file_to_cpp(javascript_dir, subs[1]) | ||
fh.write(header.format(name, file)) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
def get_test_manager_header(): | ||
return ( | ||
'/* THIS FILE IS GENERATED DO NOT EDIT */\n#include "test_manager.h"\nString TestManager::{} = \n{};' | ||
) | ||
|
||
|
||
def get_test_files(): | ||
return { | ||
"src/tests/godot.unit_test.gen.cpp": ( | ||
"UNIT_TEST", | ||
"src/tests/UnitTest.js", | ||
), | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.