Compare commits
4 Commits
v1.0.0-rc1
...
b664565321
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b664565321 | ||
|
|
6b05a33daa | ||
|
|
9a41138d4c | ||
|
|
d92d49254b |
12
README.md
12
README.md
@@ -511,11 +511,11 @@ Built with frustration at unnecessarily complex robotics frameworks, and hope th
|
|||||||
|
|
||||||
## Project Status
|
## Project Status
|
||||||
|
|
||||||
**Current Version:** 1.0.0-rc1
|
**Current Version:** 1.0.0-beta2
|
||||||
|
|
||||||
**What Works:**
|
**What Works:**
|
||||||
- ✅ Project generation
|
- ✅ Project generation
|
||||||
- ✅ Cross-platform build/deploy (Linux, macOS, Windows)
|
- ✅ Cross-platform build/deploy
|
||||||
- ✅ SDK management
|
- ✅ SDK management
|
||||||
- ✅ Configuration management
|
- ✅ Configuration management
|
||||||
- ✅ Project upgrades
|
- ✅ Project upgrades
|
||||||
@@ -530,12 +530,6 @@ Built with frustration at unnecessarily complex robotics frameworks, and hope th
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Support & Contact
|
|
||||||
|
|
||||||
**Questions? Issues? Suggestions?**
|
**Questions? Issues? Suggestions?**
|
||||||
|
|
||||||
- 📧 Email: [eric@nxws.dev](mailto:eric@nxws.dev)
|
Open an issue on NXGit or reach out to the FTC community. Let's make robot programming accessible for everyone! 🚀
|
||||||
- 🐛 Issues: Open an issue on the repository
|
|
||||||
- 💬 Community: Reach out via the FTC community
|
|
||||||
|
|
||||||
Building better tools so you can build better robots. 🤖
|
|
||||||
@@ -71,7 +71,7 @@ fn ensure_sdks(config: &SdkConfig) -> Result<()> {
|
|||||||
// Check FTC SDK
|
// Check FTC SDK
|
||||||
if !config.ftc_sdk_path.exists() {
|
if !config.ftc_sdk_path.exists() {
|
||||||
println!("FTC SDK not found. Installing...");
|
println!("FTC SDK not found. Installing...");
|
||||||
crate::sdk::ftc::install(&config.ftc_sdk_path, &config.android_sdk_path)?;
|
crate::sdk::ftc::install(&config.ftc_sdk_path)?;
|
||||||
} else {
|
} else {
|
||||||
println!("{} FTC SDK found at: {}", "✓".green(), config.ftc_sdk_path.display());
|
println!("{} FTC SDK found at: {}", "✓".green(), config.ftc_sdk_path.display());
|
||||||
crate::sdk::ftc::verify(&config.ftc_sdk_path)?;
|
crate::sdk::ftc::verify(&config.ftc_sdk_path)?;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ pub fn install_sdks() -> Result<()> {
|
|||||||
let config = SdkConfig::new()?;
|
let config = SdkConfig::new()?;
|
||||||
|
|
||||||
// Install FTC SDK
|
// Install FTC SDK
|
||||||
crate::sdk::ftc::install(&config.ftc_sdk_path, &config.android_sdk_path)?;
|
crate::sdk::ftc::install(&config.ftc_sdk_path)?;
|
||||||
|
|
||||||
// Install Android SDK
|
// Install Android SDK
|
||||||
crate::sdk::android::install(&config.android_sdk_path)?;
|
crate::sdk::android::install(&config.android_sdk_path)?;
|
||||||
|
|||||||
@@ -20,9 +20,6 @@ pub fn upgrade_project(path: &str) -> Result<()> {
|
|||||||
// Get SDK config
|
// Get SDK config
|
||||||
let sdk_config = crate::sdk::SdkConfig::new()?;
|
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
|
// Load or create project config
|
||||||
let project_config = if has_config {
|
let project_config = if has_config {
|
||||||
println!("Found existing .weevil.toml");
|
println!("Found existing .weevil.toml");
|
||||||
@@ -120,21 +117,3 @@ pub fn upgrade_project(path: &str) -> Result<()> {
|
|||||||
|
|
||||||
Ok(())
|
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(())
|
|
||||||
}
|
|
||||||
@@ -87,6 +87,7 @@ impl ProjectBuilder {
|
|||||||
FTC Robot Project generated by Weevil v1.0.0
|
FTC Robot Project generated by Weevil v1.0.0
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Test your code (runs on PC, no robot needed)
|
# Test your code (runs on PC, no robot needed)
|
||||||
./gradlew test
|
./gradlew test
|
||||||
@@ -123,9 +124,6 @@ deploy.bat
|
|||||||
fs::write(project_path.join(".weevil-version"), "1.0.0")?;
|
fs::write(project_path.join(".weevil-version"), "1.0.0")?;
|
||||||
|
|
||||||
// build.gradle.kts - Pure Java with deployToSDK task
|
// build.gradle.kts - Pure Java with deployToSDK task
|
||||||
// Escape backslashes for Windows paths in Kotlin strings
|
|
||||||
let sdk_path = sdk_config.ftc_sdk_path.display().to_string().replace("\\", "\\\\");
|
|
||||||
|
|
||||||
let build_gradle = format!(r#"plugins {{
|
let build_gradle = format!(r#"plugins {{
|
||||||
java
|
java
|
||||||
}}
|
}}
|
||||||
@@ -194,7 +192,7 @@ tasks.register<Exec>("buildApk") {{
|
|||||||
println("✓ APK built successfully")
|
println("✓ APK built successfully")
|
||||||
}}
|
}}
|
||||||
}}
|
}}
|
||||||
"#, sdk_path, sdk_path);
|
"#, sdk_config.ftc_sdk_path.display(), sdk_config.ftc_sdk_path.display());
|
||||||
fs::write(project_path.join("build.gradle.kts"), build_gradle)?;
|
fs::write(project_path.join("build.gradle.kts"), build_gradle)?;
|
||||||
|
|
||||||
// settings.gradle.kts
|
// settings.gradle.kts
|
||||||
|
|||||||
@@ -2,19 +2,16 @@ use std::path::Path;
|
|||||||
use anyhow::{Result, Context};
|
use anyhow::{Result, Context};
|
||||||
use git2::Repository;
|
use git2::Repository;
|
||||||
use colored::*;
|
use colored::*;
|
||||||
use std::fs;
|
|
||||||
|
|
||||||
const FTC_SDK_URL: &str = "https://github.com/FIRST-Tech-Challenge/FtcRobotController.git";
|
const FTC_SDK_URL: &str = "https://github.com/FIRST-Tech-Challenge/FtcRobotController.git";
|
||||||
const FTC_SDK_VERSION: &str = "v10.1.1";
|
const FTC_SDK_VERSION: &str = "v10.1.1";
|
||||||
|
|
||||||
pub fn install(sdk_path: &Path, android_sdk_path: &Path) -> Result<()> {
|
pub fn install(sdk_path: &Path) -> Result<()> {
|
||||||
if sdk_path.exists() {
|
if sdk_path.exists() {
|
||||||
println!("{} FTC SDK already installed at: {}",
|
println!("{} FTC SDK already installed at: {}",
|
||||||
"✓".green(),
|
"✓".green(),
|
||||||
sdk_path.display()
|
sdk_path.display()
|
||||||
);
|
);
|
||||||
// Make sure local.properties exists even if SDK was already installed
|
|
||||||
create_local_properties(sdk_path, android_sdk_path)?;
|
|
||||||
return check_version(sdk_path);
|
return check_version(sdk_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,32 +28,11 @@ pub fn install(sdk_path: &Path, android_sdk_path: &Path) -> Result<()> {
|
|||||||
repo.checkout_tree(&obj, None)?;
|
repo.checkout_tree(&obj, None)?;
|
||||||
repo.set_head_detached(obj.id())?;
|
repo.set_head_detached(obj.id())?;
|
||||||
|
|
||||||
// Create local.properties with Android SDK path
|
|
||||||
create_local_properties(sdk_path, android_sdk_path)?;
|
|
||||||
|
|
||||||
println!("{} FTC SDK installed successfully", "✓".green());
|
println!("{} FTC SDK installed successfully", "✓".green());
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_local_properties(sdk_path: &Path, android_sdk_path: &Path) -> Result<()> {
|
|
||||||
// Convert path to use forward slashes (works on both Windows and Unix)
|
|
||||||
let android_sdk_str = android_sdk_path
|
|
||||||
.display()
|
|
||||||
.to_string()
|
|
||||||
.replace("\\", "/");
|
|
||||||
|
|
||||||
let local_properties = format!("sdk.dir={}\n", android_sdk_str);
|
|
||||||
|
|
||||||
let properties_path = sdk_path.join("local.properties");
|
|
||||||
fs::write(&properties_path, local_properties)
|
|
||||||
.context("Failed to create local.properties")?;
|
|
||||||
|
|
||||||
println!("{} Created local.properties with Android SDK path", "✓".green());
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn check_version(sdk_path: &Path) -> Result<()> {
|
fn check_version(sdk_path: &Path) -> Result<()> {
|
||||||
let repo = Repository::open(sdk_path)?;
|
let repo = Repository::open(sdk_path)?;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user