You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-14 13:41:12 +00:00
GDScript: Reintroduce binary tokenization on export
This adds back a function available in 3.x: exporting the GDScript files in a binary form by converting the tokens recognized by the tokenizer into a data format. It is enabled by default on export but can be manually disabled. The format helps with loading times since, the tokens are easily reconstructed, and with hiding the source code, since recovering it would require a specialized tool. Code comments are not stored in this format. The `--test` command can also include a `--use-binary-tokens` flag which will run the GDScript tests with the binary format instead of the regular source code by converting them in-memory before the test runs.
This commit is contained in:
@@ -54,6 +54,11 @@ public:
|
||||
MODE_FILE_REMOVE,
|
||||
};
|
||||
|
||||
enum ScriptExportMode {
|
||||
MODE_SCRIPT_TEXT,
|
||||
MODE_SCRIPT_BINARY_TOKENS,
|
||||
};
|
||||
|
||||
private:
|
||||
Ref<EditorExportPlatform> platform;
|
||||
ExportFilter export_filter = EXPORT_ALL_RESOURCES;
|
||||
@@ -84,6 +89,7 @@ private:
|
||||
bool enc_directory = false;
|
||||
|
||||
String script_key;
|
||||
int script_mode = MODE_SCRIPT_BINARY_TOKENS;
|
||||
|
||||
protected:
|
||||
bool _set(const StringName &p_name, const Variant &p_value);
|
||||
@@ -152,6 +158,9 @@ public:
|
||||
void set_script_encryption_key(const String &p_key);
|
||||
String get_script_encryption_key() const;
|
||||
|
||||
void set_script_export_mode(int p_mode);
|
||||
int get_script_export_mode() const;
|
||||
|
||||
Variant get_or_env(const StringName &p_name, const String &p_env_var, bool *r_valid = nullptr) const;
|
||||
|
||||
// Return the preset's version number, or fall back to the
|
||||
|
||||
Reference in New Issue
Block a user