Files
weevil/src/commands/sdk.rs
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

61 lines
1.5 KiB
Rust

use anyhow::Result;
use colored::*;
use crate::sdk::SdkConfig;
pub fn install_sdks() -> Result<()> {
println!("{}", "Installing SDKs...".bright_yellow().bold());
println!();
let config = SdkConfig::new()?;
// Install FTC SDK
crate::sdk::ftc::install(&config.ftc_sdk_path, &config.android_sdk_path)?;
// Install Android SDK
crate::sdk::android::install(&config.android_sdk_path)?;
println!();
println!("{} All SDKs installed successfully", "".green().bold());
config.print_status();
Ok(())
}
pub fn show_status() -> Result<()> {
let config = SdkConfig::new()?;
config.print_status();
// Verify SDKs
println!();
println!("{}", "Verification:".bright_yellow().bold());
match crate::sdk::ftc::verify(&config.ftc_sdk_path) {
Ok(_) => println!("{} FTC SDK is valid", "".green()),
Err(e) => println!("{} FTC SDK: {}", "".red(), e),
}
match crate::sdk::android::verify(&config.android_sdk_path) {
Ok(_) => println!("{} Android SDK is valid", "".green()),
Err(e) => println!("{} Android SDK: {}", "".red(), e),
}
println!();
Ok(())
}
pub fn update_sdks() -> Result<()> {
println!("{}", "Updating SDKs...".bright_yellow().bold());
println!();
let config = SdkConfig::new()?;
// Update FTC SDK
crate::sdk::ftc::update(&config.ftc_sdk_path)?;
println!();
println!("{} SDKs updated successfully", "".green().bold());
Ok(())
}