Commit Graph

7 Commits

Author SHA1 Message Date
Eric Ratliff
df338987b6 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.
2026-02-02 23:15:23 -06:00
Eric Ratliff
9ee0d99dd8 feat: add Android Studio integration (v1.1.0)
Generate .idea/ run configurations for one-click build and deployment
directly from Android Studio. Students can now open projects in the IDE
they already know and hit the green play button to deploy to their robot.

Run configurations generated:
- Build: compiles APK without deploying (build.sh / build.bat)
- Deploy (auto): auto-detects USB or WiFi connection
- Deploy (USB): forces USB deployment (deploy.sh --usb)
- Deploy (WiFi): forces WiFi deployment (deploy.sh --wifi)
- Test: runs unit tests (./gradlew test)

Both Unix (.sh) and Windows (.bat) variants are generated. Android Studio
automatically hides the configurations whose script files don't exist, so
only platform-appropriate configs appear in the Run dropdown.

workspace.xml configures the project tree to hide internal directories
(build/, .gradle/, gradle/) and expand src/ by default, giving students
a clean view of just their code and the deployment scripts.

Technical notes:
- Uses ShConfigurationType (not the old ShellScript type) for Android
  Studio 2025.2+ compatibility
- All paths use $PROJECT_DIR$ for portability
- INTERPRETER_PATH is /bin/bash on Unix, cmd.exe on Windows
- upgrade.rs regenerates all .idea/ files so run configs stay in sync
  with any future deploy.sh flag changes

Requires Shell Script plugin (by JetBrains) to be installed in Android
Studio. README.md updated with installation instructions.

Files modified:
- src/project/mod.rs: generate_idea_files() writes 5 XML files per platform
- src/commands/upgrade.rs: add .idea/ files to safe_to_overwrite
2026-02-01 20:56:03 -06:00
Eric Ratliff
5596f5bade 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
2026-01-31 18:45:29 -06:00
Eric Ratliff
64826e2ce2 fix: Complete Windows deployment pipeline
Fixes critical bugs in Windows APK deployment workflow including APK path
resolution, adb integration, and config file parsing.

Changes:
- Fix APK search to look for TeamCode-debug.apk instead of *app-debug.apk
- Strip both single and double quotes from batch file path parsing
- Add android_sdk_path to project configuration (.weevil.toml)
- Resolve adb.exe from Android SDK platform-tools directory
- Check adb install exit code and report deployment failures correctly
- Add migration support for old .weevil.toml files missing android_sdk_path
- Update all tests to use new ProjectConfig::new() signature

The deployment workflow now properly finds the generated APK, locates adb,
and reports success/failure accurately on Windows.
2026-01-26 18:42:06 -06:00
Eric Ratliff
6626ca83d1 feat: Add Windows support and stabilize SDK installation (v1.0.0-rc1)
Complete Windows compatibility overhaul with robust cross-platform SDK management.
This release candidate establishes feature freeze for the 1.0.0 release.

Key improvements:
- Fixed Android SDK installation on Windows
  * Use cmd.exe wrapper for sdkmanager.bat with piped stdin
  * Properly reorganize cmdline-tools directory structure
  * Write license acceptances synchronously to avoid hangs

- Fixed FTC SDK configuration
  * Auto-generate local.properties with Android SDK path
  * Escape backslashes in Kotlin build.gradle.kts strings
  * Support both new installs and upgrades via ensure_local_properties()

- Enhanced Windows console output
  * Enable ANSI color support via enable_ansi_support crate
  * Maintain color compatibility across Windows versions

- Improved error handling and debugging
  * Added comprehensive logging throughout SDK installation
  * Better context messages for troubleshooting failures

Cross-platform testing verified on:
- Windows 11 with Eclipse Adoptium JDK 21
- Linux (existing support maintained)

Breaking changes: None
This RC introduces feature freeze - subsequent 1.0.x releases will be
bug fixes only. New features deferred to 1.1.0.

Closes Windows compatibility milestone.
2026-01-25 18:10:18 -06:00
Eric Ratliff
90ed42b3c5 fix: Remove unused variable warning and add release build script
- Fix unused `project_path` parameter warning in make_executable()
- Add build-release.sh for automated binary packaging
- Update .gitignore to exclude release artifacts
- Support cross-compilation for Linux and Windows binaries

Release artifacts are now built with ./build-release.sh and uploaded
to Gitea releases separately, keeping the git repo clean.
2026-01-25 01:17:47 -06:00
Eric Ratliff
70a1acc2a1 feat: Weevil v1.0.0-beta1 - FTC Project Generator
Cross-platform tool for generating clean, testable FTC robot projects
without editing the SDK installation.

Features:
- Standalone project generation with proper separation from SDK
- Per-project SDK configuration via .weevil.toml
- Local unit testing support (no robot required)
- Cross-platform build/deploy scripts (Linux/macOS/Windows)
- Project upgrade system preserving user code
- Configuration management commands
- Comprehensive test suite (11 passing tests)
- Zero-warning builds

Architecture:
- Pure Rust implementation with embedded Gradle wrapper
- Projects use deployToSDK task to copy code to FTC SDK TeamCode
- Git-ready projects with automatic initialization
- USB and WiFi deployment with auto-detection

Commands:
- weevil new <name> - Create new project
- weevil upgrade <path> - Update project infrastructure
- weevil config <path> - View/modify project configuration
- weevil sdk status/install/update - Manage SDKs

Addresses the core problem: FTC's SDK structure forces students to
edit framework internals instead of separating concerns like industry
standard practices. Weevil enables proper software engineering workflows
for robotics education.
2026-01-25 00:17:51 -06:00