Tied into the right adb file
This commit is contained in:
@@ -77,7 +77,7 @@ impl ProjectBuilder {
|
||||
|
||||
fn create_project_files(&self, project_path: &Path, sdk_config: &SdkConfig) -> Result<()> {
|
||||
// Create .weevil.toml config
|
||||
let project_config = ProjectConfig::new(&self.name, sdk_config.ftc_sdk_path.clone())?;
|
||||
let project_config = ProjectConfig::new(&self.name, sdk_config.ftc_sdk_path.clone(), sdk_config.android_sdk_path.clone())?;
|
||||
project_config.save(project_path)?;
|
||||
|
||||
// README.md
|
||||
@@ -334,47 +334,56 @@ echo "✓ Deployed!"
|
||||
let deploy_bat = r#"@echo off
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
REM Read SDK path from config
|
||||
for /f "tokens=2 delims==" %%a in ('findstr /c:"ftc_sdk_path" .weevil.toml') do (
|
||||
set SDK_DIR=%%a
|
||||
)
|
||||
REM Read SDK paths from config
|
||||
for /f "tokens=2 delims==" %%a in ('findstr /c:"ftc_sdk_path" .weevil.toml') do set SDK_DIR=%%a
|
||||
for /f "tokens=2 delims==" %%a in ('findstr /c:"android_sdk_path" .weevil.toml') do set ANDROID_SDK=%%a
|
||||
|
||||
REM Strip all quotes (both single and double)
|
||||
set SDK_DIR=%SDK_DIR:"=%
|
||||
set SDK_DIR=%SDK_DIR:'=%
|
||||
set SDK_DIR=%SDK_DIR: =%
|
||||
set ANDROID_SDK=%ANDROID_SDK:"=%
|
||||
set ANDROID_SDK=%ANDROID_SDK:'=%
|
||||
set ANDROID_SDK=%ANDROID_SDK: =%
|
||||
|
||||
if not defined SDK_DIR (
|
||||
echo Error: Could not read FTC SDK path from .weevil.toml
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
if not defined ANDROID_SDK (
|
||||
echo Error: Could not read Android SDK path from .weevil.toml
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
REM Set ADB path
|
||||
set ADB_PATH=%ANDROID_SDK%\platform-tools\adb.exe
|
||||
|
||||
echo Building APK...
|
||||
call gradlew.bat buildApk
|
||||
|
||||
echo.
|
||||
echo Deploying to Control Hub...
|
||||
echo.
|
||||
echo DEBUG: SDK_DIR = %SDK_DIR%
|
||||
echo DEBUG: Searching for: %SDK_DIR%\TeamCode-debug.apk
|
||||
echo.
|
||||
|
||||
REM Find APK - look for TeamCode-debug.apk
|
||||
for /f "delims=" %%i in ('dir /s /b "%SDK_DIR%\TeamCode-debug.apk" 2^>nul') do set APK=%%i
|
||||
|
||||
if not defined APK (
|
||||
echo Error: APK not found
|
||||
echo.
|
||||
echo DEBUG: Tried searching in: %SDK_DIR%
|
||||
echo DEBUG: Let's see what APKs exist:
|
||||
dir /s /b "%SDK_DIR%\*.apk" 2>nul
|
||||
echo.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo Found APK: %APK%
|
||||
|
||||
REM Check for adb
|
||||
if not exist "%ADB_PATH%" (
|
||||
echo Error: adb not found at %ADB_PATH%
|
||||
echo Run: weevil sdk install
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo Installing: %APK%
|
||||
adb install -r "%APK%"
|
||||
"%ADB_PATH%" install -r "%APK%"
|
||||
|
||||
echo.
|
||||
echo Deployed!
|
||||
|
||||
Reference in New Issue
Block a user