feat: Add template system with testing showcase

Implements template-based project creation allowing teams to start with
professional example code instead of empty projects.

Features:
- Two templates: 'basic' (minimal) and 'testing' (45-test showcase)
- Template variable substitution ({{PROJECT_NAME}}, etc.)
- Template validation with helpful error messages
- `weevil new --list-templates` command
- Templates embedded in binary at compile time

Testing template includes:
- 3 complete subsystems (MotorCycler, WallApproach, TurnController)
- Hardware abstraction layer with mock implementations
- 45 comprehensive tests (unit, integration, system)
- Professional documentation (DESIGN_AND_TEST_PLAN.md, etc.)

Usage:
  weevil new my-robot                    # basic template
  weevil new my-robot --template testing # testing showcase
  weevil new --list-templates            # show available templates

This enables FTC teams to learn from working code and best practices
rather than starting from scratch.

All 62 tests passing.
This commit is contained in:
Eric Ratliff
2026-02-02 22:45:53 -06:00
parent 60679e097f
commit df338987b6
6 changed files with 358 additions and 115 deletions

View File

@@ -133,11 +133,6 @@ deploy.bat
java
}}
repositories {{
mavenCentral()
google()
}}
dependencies {{
// Testing (runs on PC without SDK)
testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
@@ -200,8 +195,18 @@ tasks.register<Exec>("buildApk") {{
"#, sdk_path, sdk_path);
fs::write(project_path.join("build.gradle.kts"), build_gradle)?;
// settings.gradle.kts
let settings_gradle = format!("rootProject.name = \"{}\"\n", self.name);
// settings.gradle.kts - Repositories go here in Gradle 8+
let settings_gradle = format!(r#"rootProject.name = "{}"
// Repository configuration (Gradle 8+ prefers repositories in settings)
dependencyResolutionManagement {{
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
repositories {{
mavenCentral()
google()
}}
}}
"#, self.name);
fs::write(project_path.join("settings.gradle.kts"), settings_gradle)?;
// build.sh (Linux/Mac)