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

@@ -0,0 +1,62 @@
// Build configuration for {{PROJECT_NAME}}
// This file is managed by the FTC SDK
buildscript {
repositories {
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.1.0'
}
}
apply plugin: 'com.android.application'
android {
namespace 'org.firstinspires.ftc.{{PACKAGE_NAME}}'
compileSdk 34
defaultConfig {
applicationId 'org.firstinspires.ftc.{{PACKAGE_NAME}}'
minSdk 24
//noinspection ExpiredTargetSdkVersion
targetSdk 28
versionCode 1
versionName "1.0"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
sourceSets {
main {
java {
srcDir 'src/main/java'
}
}
test {
java {
srcDir 'src/test/java'
}
}
}
}
repositories {
mavenCentral()
google()
}
dependencies {
implementation 'org.firstinspires.ftc:RobotCore:10.1.1'
implementation 'org.firstinspires.ftc:Hardware:10.1.1'
implementation 'org.firstinspires.ftc:FtcCommon:10.1.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:5.3.1'
}