fix: single source of truth for version across crate and tests

Replace all hardcoded "1.1.0" version strings with env!("CARGO_PKG_VERSION")
in src/, so Cargo.toml is the sole source for the built binary. Tests
intentionally use a separate hardcoded constant in tests/common.rs to act
as a canary — they will fail on a version bump until manually updated.

- src/project/mod.rs: add WEEVIL_VERSION const, wire into Tera context,
  generated README, and .weevil-version marker
- tests/common.rs: new file, holds EXPECTED_VERSION for all test crates
- tests/{integration,project_lifecycle,unit/config_tests}.rs: pull from
  common instead of env! or inline literals
This commit is contained in:
Eric Ratliff
2026-01-31 14:17:51 -06:00
parent d2cc62e32f
commit 5596f5bade
10 changed files with 71 additions and 43 deletions

View File

@@ -3,6 +3,8 @@ use std::path::{Path, PathBuf};
use std::fs;
use anyhow::{Result, Context, bail};
const WEEVIL_VERSION: &str = env!("CARGO_PKG_VERSION");
#[derive(Debug, Serialize, Deserialize)]
pub struct ProjectConfig {
pub project_name: String,
@@ -24,7 +26,7 @@ impl ProjectConfig {
Ok(Self {
project_name: project_name.to_string(),
weevil_version: "1.0.0".to_string(),
weevil_version: WEEVIL_VERSION.to_string(),
ftc_sdk_path,
ftc_sdk_version,
android_sdk_path,