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.
This commit is contained in:
@@ -20,6 +20,9 @@ pub fn upgrade_project(path: &str) -> Result<()> {
|
||||
// Get SDK config
|
||||
let sdk_config = crate::sdk::SdkConfig::new()?;
|
||||
|
||||
// Ensure FTC SDK has local.properties (in case it was installed before this feature)
|
||||
ensure_local_properties(&sdk_config)?;
|
||||
|
||||
// Load or create project config
|
||||
let project_config = if has_config {
|
||||
println!("Found existing .weevil.toml");
|
||||
@@ -115,5 +118,23 @@ pub fn upgrade_project(path: &str) -> Result<()> {
|
||||
println!("Test it: ./gradlew test");
|
||||
println!();
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn ensure_local_properties(sdk_config: &crate::sdk::SdkConfig) -> Result<()> {
|
||||
let local_properties_path = sdk_config.ftc_sdk_path.join("local.properties");
|
||||
|
||||
if !local_properties_path.exists() {
|
||||
println!("Creating local.properties in FTC SDK...");
|
||||
let android_sdk_str = sdk_config.android_sdk_path
|
||||
.display()
|
||||
.to_string()
|
||||
.replace("\\", "/");
|
||||
|
||||
let local_properties = format!("sdk.dir={}\n", android_sdk_str);
|
||||
fs::write(&local_properties_path, local_properties)?;
|
||||
println!("{} Created local.properties", "✓".green());
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user