~starkingdoms/starkingdoms

04d93e9290f5e4da532ef284aecc9a99abec8ea5 — core 16 days ago ea753e8
fix: remove buildscript that breaks things
6 files changed, 5 insertions(+), 52 deletions(-)

M .build.yml
M crates/unified/Cargo.toml
D crates/unified/build.rs
D crates/unified/src/build_meta.rs
M crates/unified/src/cli.rs
M crates/unified/src/main.rs
M .build.yml => .build.yml +3 -1
@@ 17,9 17,11 @@ tasks:
      echo '. "$HOME/.cargo/env"' > ~/.profile
      source ~/.profile
      rustup target add wasm32-unknown-unknown
      sudo apk add zlib zlib-dev wget
      sudo apk add zlib zlib-dev wget binaryen
      sudo wget https://coredoes.dev/sccache -O /usr/local/bin/sccache
      sudo chmod 0755 /usr/local/bin/sccache
      curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
      cargo binstall wasm-bindgen --version 0.2.118
  - web_client: |
      source ~/.profile
      cd starkingdoms

M crates/unified/Cargo.toml => crates/unified/Cargo.toml +1 -4
@@ 78,14 78,11 @@ bevy_egui = { version = "0.39", optional = true }
leafwing-input-manager = { version = "0.20", optional = true }
good_lp = { version = "1.15", default-features = false, features = ["clarabel"], optional = true }

[build-dependencies]
built = { version = "0.8", features = ["git2", "chrono"] }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
ctrlc = { version = "3.5", optional = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = { version = "0.2" }
wasm-bindgen = { version = "0.2.118" }
tracing-wasm = "0.2"
console_error_panic_hook = "0.1"


D crates/unified/build.rs => crates/unified/build.rs +0 -3
@@ 1,3 0,0 @@
fn main() {
    built::write_built_file().expect("Failed to acquire build-time information");
}
\ No newline at end of file

D crates/unified/src/build_meta.rs => crates/unified/src/build_meta.rs +0 -32
@@ 1,32 0,0 @@
// Use of a mod or pub mod is not actually necessary.
pub mod built_info {
    #![allow(clippy::allow_attributes_without_reason, reason = "generated code")]
    #![allow(clippy::pedantic, reason = "generated code")]
    // The file has been placed there by the build script.
    include!(concat!(env!("OUT_DIR"), "/built.rs"));
}

pub fn version_and_features_line() -> String {
    // Version, commit, and features line
    // ex: starkingdoms v0.1.0 37f85fab-dirty +native +server +client +particle_editor
    let commit = format!("{}{}", built_info::GIT_COMMIT_HASH_SHORT.unwrap_or("<unknown>"), if let Some(d) = built_info::GIT_DIRTY && d { "-dirty" } else { "" }); // TODO
    let mut line = format!("starkingdoms v{} {commit}", env!("CARGO_PKG_VERSION"));

    if cfg!(feature = "native") {
        line += " +native";
    }
    if cfg!(feature = "wasm") {
        line += " +wasm";
    }
    if cfg!(feature = "server") {
        line += " +server";
    }
    if cfg!(feature = "client") {
        line += " +client";
    }
    if cfg!(feature = "particle_editor") {
        line += " +particle_editor";
    }

    line
}
\ No newline at end of file

M crates/unified/src/cli.rs => crates/unified/src/cli.rs +1 -11
@@ 1,6 1,3 @@
use crate::build_meta::built_info::{BUILT_TIME_UTC, HOST, RUSTC_VERSION, TARGET};
use crate::build_meta::version_and_features_line;

#[cfg(not(any(feature = "client", feature = "server", feature = "particle_editor")))]
compile_error!("You need to enable one or more of client, server, particle_editor features");
#[cfg(not(any(feature = "native", feature = "wasm")))]


@@ 35,7 32,7 @@ pub fn parse_args() -> StkArgs {
    }

    if pargs.contains(["-v", "--version"]) {
        print_version();
        println!("{}",env!("CARGO_PKG_VERSION"));
        std::process::exit(0);
    }



@@ 77,8 74,6 @@ pub fn parse_args() -> StkArgs {
}

fn print_help() {
    println!("{}\n", version_and_features_line());

    println!("\
USAGE:
    starkingdoms [FLAGS] <subcommand> [<args>...]


@@ 120,9 115,4 @@ SERVER:
            println!();
        }
    }
}

fn print_version() {
    println!("{}", version_and_features_line());
    println!("built on {BUILT_TIME_UTC} by {RUSTC_VERSION} on {HOST} for {TARGET}");
}
\ No newline at end of file

M crates/unified/src/main.rs => crates/unified/src/main.rs +0 -1
@@ 42,7 42,6 @@ pub mod prelude;
#[cfg(target_arch = "wasm32")]
pub mod wasm_entrypoint;
mod cli;
mod build_meta;
mod thrust;

use std::str::FromStr;