mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
[HTML5] Export as Progressive Web App.
Adds possibility to export as a progressive web app. Allows customizing base icons, display mode, orientation and offline page.
This commit is contained in:
parent
cb65f9d64b
commit
9446be7dad
4 changed files with 406 additions and 164 deletions
|
@ -1,4 +1,4 @@
|
|||
import os
|
||||
import os, json
|
||||
|
||||
from SCons.Util import WhereIs
|
||||
|
||||
|
@ -59,7 +59,23 @@ def create_template_zip(env, js, wasm, extra):
|
|||
if env["tools"]:
|
||||
# HTML
|
||||
html = "#misc/dist/html/editor.html"
|
||||
subst_dict = {"@GODOT_VERSION@": get_build_version(), "@GODOT_NAME@": "GodotEngine"}
|
||||
cache = [
|
||||
"godot.tools.html",
|
||||
"offline.html",
|
||||
"godot.tools.js",
|
||||
"godot.tools.worker.js",
|
||||
"godot.tools.audio.worklet.js",
|
||||
"logo.svg",
|
||||
"favicon.png",
|
||||
]
|
||||
opt_cache = ["godot.tools.wasm"]
|
||||
subst_dict = {
|
||||
"@GODOT_VERSION@": get_build_version(),
|
||||
"@GODOT_NAME@": "GodotEngine",
|
||||
"@GODOT_CACHE@": json.dumps(cache),
|
||||
"@GODOT_OPT_CACHE@": json.dumps(opt_cache),
|
||||
"@GODOT_OFFLINE_PAGE@": "offline.html",
|
||||
}
|
||||
html = env.Substfile(target="#bin/godot${PROGSUFFIX}.html", source=html, SUBST_DICT=subst_dict)
|
||||
in_files.append(html)
|
||||
out_files.append(zip_dir.File(binary_name + ".html"))
|
||||
|
@ -82,6 +98,10 @@ def create_template_zip(env, js, wasm, extra):
|
|||
# HTML
|
||||
in_files.append("#misc/dist/html/full-size.html")
|
||||
out_files.append(zip_dir.File(binary_name + ".html"))
|
||||
in_files.append(service_worker)
|
||||
out_files.append(zip_dir.File(binary_name + ".service.worker.js"))
|
||||
in_files.append("#misc/dist/html/offline-export.html")
|
||||
out_files.append(zip_dir.File("godot.offline.html"))
|
||||
|
||||
zip_files = env.InstallAs(out_files, in_files)
|
||||
env.Zip(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue