bevy/crates/bevy_internal/Cargo.toml
Carter Anderson 98938a8555 Internal Asset Hot Reloading (#3966)
Adds "hot reloading" of internal assets, which is normally not possible because they are loaded using `include_str` / direct Asset collection access.

This is accomplished via the following:
* Add a new `debug_asset_server` feature flag
* When that feature flag is enabled, create a second App with a second AssetServer that points to a configured location (by default the `crates` folder). Plugins that want to add hot reloading support for their assets can call the new `app.add_debug_asset::<T>()` and `app.init_debug_asset_loader::<T>()` functions.
* Load "internal" assets using the new `load_internal_asset` macro. By default this is identical to the current "include_str + register in asset collection" approach. But if the `debug_asset_server` feature flag is enabled, it will also load the asset dynamically in the debug asset server using the file path. It will then set up a correlation between the "debug asset" and the "actual asset" by listening for asset change events.

This is an alternative to #3673. The goal was to keep the boilerplate and features flags to a minimum for bevy plugin authors, and allow them to home their shaders near relevant code. 

This is a draft because I haven't done _any_ quality control on this yet. I'll probably rename things and remove a bunch of unwraps. I just got it working and wanted to use it to start a conversation.

Fixes #3660
2022-02-18 22:56:57 +00:00

82 lines
3.5 KiB
TOML

[package]
name = "bevy_internal"
version = "0.6.0"
edition = "2021"
description = "An internal Bevy crate used to facilitate optional dynamic linking via the 'dynamic' feature"
homepage = "https://bevyengine.org"
repository = "https://github.com/bevyengine/bevy"
license = "MIT OR Apache-2.0"
keywords = ["game", "engine", "gamedev", "graphics", "bevy"]
categories = ["game-engines", "graphics", "gui", "rendering"]
[features]
trace = [ "bevy_app/trace", "bevy_ecs/trace", "bevy_render/trace" ]
trace_chrome = [ "bevy_log/tracing-chrome" ]
trace_tracy = [ "bevy_log/tracing-tracy" ]
wgpu_trace = ["bevy_render/wgpu_trace"]
debug_asset_server = ["bevy_asset/debug_asset_server"]
# Image format support for texture loading (PNG and HDR are enabled by default)
hdr = ["bevy_render/hdr"]
png = ["bevy_render/png"]
dds = ["bevy_render/dds"]
tga = ["bevy_render/tga"]
jpeg = ["bevy_render/jpeg"]
bmp = ["bevy_render/bmp"]
# Audio format support (MP3 is enabled by default)
flac = ["bevy_audio/flac"]
mp3 = ["bevy_audio/mp3"]
vorbis = ["bevy_audio/vorbis"]
wav = ["bevy_audio/wav"]
# Enable watching file system for asset hot reload
filesystem_watcher = ["bevy_asset/filesystem_watcher"]
serialize = ["bevy_input/serialize"]
# Display server protocol support (X11 is enabled by default)
wayland = ["bevy_winit/wayland"]
x11 = ["bevy_winit/x11"]
# enable rendering of font glyphs using subpixel accuracy
subpixel_glyph_atlas = ["bevy_text/subpixel_glyph_atlas"]
# Optimise for WebGL2
webgl = ["bevy_pbr/webgl", "bevy_render/webgl"]
# enable systems that allow for automated testing on CI
bevy_ci_testing = ["bevy_app/bevy_ci_testing", "bevy_render/ci_limits"]
[dependencies]
# bevy
bevy_app = { path = "../bevy_app", version = "0.6.0" }
bevy_asset = { path = "../bevy_asset", version = "0.6.0" }
bevy_core = { path = "../bevy_core", version = "0.6.0" }
bevy_derive = { path = "../bevy_derive", version = "0.6.0" }
bevy_diagnostic = { path = "../bevy_diagnostic", version = "0.6.0" }
bevy_ecs = { path = "../bevy_ecs", version = "0.6.0" }
bevy_input = { path = "../bevy_input", version = "0.6.0" }
bevy_log = { path = "../bevy_log", version = "0.6.0" }
bevy_math = { path = "../bevy_math", version = "0.6.0" }
bevy_reflect = { path = "../bevy_reflect", version = "0.6.0", features = ["bevy"] }
bevy_scene = { path = "../bevy_scene", version = "0.6.0" }
bevy_transform = { path = "../bevy_transform", version = "0.6.0" }
bevy_utils = { path = "../bevy_utils", version = "0.6.0" }
bevy_window = { path = "../bevy_window", version = "0.6.0" }
bevy_tasks = { path = "../bevy_tasks", version = "0.6.0" }
# bevy (optional)
bevy_audio = { path = "../bevy_audio", optional = true, version = "0.6.0" }
bevy_core_pipeline = { path = "../bevy_core_pipeline", optional = true, version = "0.6.0" }
bevy_gltf = { path = "../bevy_gltf", optional = true, version = "0.6.0" }
bevy_pbr = { path = "../bevy_pbr", optional = true, version = "0.6.0" }
bevy_render = { path = "../bevy_render", optional = true, version = "0.6.0" }
bevy_dynamic_plugin = { path = "../bevy_dynamic_plugin", optional = true, version = "0.6.0" }
bevy_sprite = { path = "../bevy_sprite", optional = true, version = "0.6.0" }
bevy_text = { path = "../bevy_text", optional = true, version = "0.6.0" }
bevy_ui = { path = "../bevy_ui", optional = true, version = "0.6.0" }
bevy_winit = { path = "../bevy_winit", optional = true, version = "0.6.0" }
bevy_gilrs = { path = "../bevy_gilrs", optional = true, version = "0.6.0" }
[target.'cfg(target_os = "android")'.dependencies]
ndk-glue = {version = "0.5", features = ["logger"]}