Skip to content

Commit

Permalink
run without winit or rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Sep 11, 2023
1 parent 8637b23 commit e09e766
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/stuff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: |
cargo build --example asset_processing --features "filesystem_watcher,bevy_ci_testing"
& { Start-Sleep -s 1; sed -i.bak 's/"a"/"modified"/' examples/asset/processing/assets/a.cool.ron; } &
cargo run --example asset_processing --features "filesystem_watcher,bevy_ci_testing"
cargo run --example asset_processing --no-default-features --features "filesystem_watcher,bevy_asset,multi-threaded"
cat examples/asset/processing/imported_assets/a.cool.ron
env:
CI_TESTING_CONFIG: .github/example-run/alien_cake_addict.ron
50 changes: 27 additions & 23 deletions examples/asset/processing/processing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,33 @@ use bevy::{
use serde::{Deserialize, Serialize};

fn main() {
App::new()
.insert_resource(
// This is just overriding the default paths to scope this to the correct example folder
// You can generally skip this in your own projects
AssetProviders::default()
.with_default_file_source("examples/asset/processing/assets".to_string())
.with_default_file_destination(
"examples/asset/processing/imported_assets".to_string(),
),
)
// Enabling `processed_dev` will configure the AssetPlugin to use asset processing.
// This will run the AssetProcessor in the background, which will listen for changes to
// the `assets` folder, run them through configured asset processors, and write the results
// to the `imported_assets` folder.
//
// The AssetProcessor will create `.meta` files automatically for assets in the `assets` folder,
// which can then be used to configure how the asset will be processed.
.add_plugins((DefaultPlugins.set(AssetPlugin::processed_dev()), TextPlugin))
// This is what a deployed app should use
// .add_plugins((DefaultPlugins.set(AssetPlugin::processed()), TextPlugin))
.add_systems(Startup, setup)
.add_systems(Update, print_text)
.run();
let mut app = App::new();
app.insert_resource(
// This is just overriding the default paths to scope this to the correct example folder
// You can generally skip this in your own projects
AssetProviders::default()
.with_default_file_source("examples/asset/processing/assets".to_string())
.with_default_file_destination("examples/asset/processing/imported_assets".to_string()),
)
// Enabling `processed_dev` will configure the AssetPlugin to use asset processing.
// This will run the AssetProcessor in the background, which will listen for changes to
// the `assets` folder, run them through configured asset processors, and write the results
// to the `imported_assets` folder.
//
// The AssetProcessor will create `.meta` files automatically for assets in the `assets` folder,
// which can then be used to configure how the asset will be processed.
.add_plugins((DefaultPlugins.set(AssetPlugin::processed_dev()), TextPlugin))
// This is what a deployed app should use
// .add_plugins((DefaultPlugins.set(AssetPlugin::processed()), TextPlugin))
.add_systems(Startup, setup)
.add_systems(Update, print_text);

#[cfg(feature = "bevy_winit")]
app.run();
#[cfg(not(feature = "bevy_winit"))]
loop {
app.update();
}
}

/// This [`TextPlugin`] defines two assets types:
Expand Down

0 comments on commit e09e766

Please sign in to comment.