diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2da09e88..fd33fe16 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -37,7 +37,7 @@ jobs: - name: Build run: | - cargo build --release --target wasm32-unknown-unknown + cargo build --release --target wasm32-unknown-unknown --no-default-features - name: Prepare package run: | @@ -85,7 +85,7 @@ jobs: - name: Build run: | - cargo build --release --target x86_64-unknown-linux-gnu + cargo build --release --target x86_64-unknown-linux-gnu --no-default-features --features=bevy/wayland - name: Prepare package run: | @@ -131,7 +131,7 @@ jobs: - name: Build run: | - cargo build --release --target x86_64-pc-windows-msvc + cargo build --release --target x86_64-pc-windows-msvc --no-default-features - name: Prepare package run: | @@ -181,7 +181,7 @@ jobs: - name: Build run: | - cargo build --release --target x86_64-apple-darwin + cargo build --release --target x86_64-apple-darwin --no-default-features - name: Prepare Package run: | @@ -227,7 +227,7 @@ jobs: - name: Build run: | - cargo build --release --target aarch64-apple-darwin + cargo build --release --target aarch64-apple-darwin --no-default-features - name: Prepare Package run: | diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 6e762cdb..6dfee1fc 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -26,7 +26,8 @@ "type": "cargo", "command": "run", "args": [ - "--release" + "--release", + "--no-default-features" ], "presentation": { "clear": true diff --git a/Cargo.toml b/Cargo.toml index 3fbf4831..2f9ec6f3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "bevy_github_ci_template" +name = "bevy_template" version = "0.1.0" edition = "2021" license = "MIT OR Apache-2.0 OR CC0-1.0" @@ -16,4 +16,26 @@ opt-level = 1 opt-level = 3 [dependencies] -bevy = "0.12" +bevy = "0.14" + +[target.'cfg(target_family = "wasm")'.dependencies] +wasm-bindgen = "0.2" + +[features] +default = [ + # Default to a native dev build. + "dev_native", +] +dev = [ + # Improve compile times for dev builds. + # NOTE: Uncomment to enable dynamic linking, but this may not work on Windows. + #"bevy/dynamic_linking", +] +dev_native = [ + "dev", + # Enable asset hot reloading for native dev builds. + "bevy/file_watcher", + # Enable embedded asset hot reloading for native dev builds. + "bevy/embedded_watcher", +] + diff --git a/src/main.rs b/src/main.rs index 895a257a..ef38a8b8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,19 +3,21 @@ // workflow treats them as errors, so this allows them throughout the project. // Feel free to delete this line. #![allow(clippy::too_many_arguments, clippy::type_complexity)] -// Disable console on Windows for release builds. -#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] +// Disable console on Windows for non-dev builds. +#![cfg_attr(not(feature = "dev"), windows_subsystem = "windows")] use bevy::asset::AssetMetaCheck; use bevy::prelude::*; fn main() { App::new() - // Wasm builds will check for meta files (that don't exist) if this isn't set. - // This causes errors and even panics on web build on itch. - // See https://github.com/bevyengine/bevy_github_ci_template/issues/48. - .insert_resource(AssetMetaCheck::Never) - .add_plugins(DefaultPlugins) + .add_plugins(DefaultPlugins.set(AssetPlugin { + // Wasm builds will check for meta files (that don't exist) if this isn't set. + // This causes errors and even panics on web build on itch. + // See https://github.com/bevyengine/bevy_github_ci_template/issues/48. + meta_check: AssetMetaCheck::Never, + ..default() + })) .add_systems(Startup, setup) .run(); }