Skip to content

Commit

Permalink
Merge pull request #20 from benfrankel/dev-feature
Browse files Browse the repository at this point in the history
Add `dev` and `dev_native` features
  • Loading branch information
benfrankel committed Jul 5, 2024
2 parents cebb0e4 + f808ae1 commit 23c0391
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 15 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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: |
Expand Down Expand Up @@ -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: |
Expand Down Expand Up @@ -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: |
Expand Down Expand Up @@ -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: |
Expand Down
3 changes: 2 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"type": "cargo",
"command": "run",
"args": [
"--release"
"--release",
"--no-default-features"
],
"presentation": {
"clear": true
Expand Down
26 changes: 24 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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",
]

16 changes: 9 additions & 7 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 23c0391

Please sign in to comment.