diff --git a/.idea/runConfigurations/deploySloth.xml b/.idea/runConfigurations/deploySloth.xml new file mode 100644 index 0000000..682ddad --- /dev/null +++ b/.idea/runConfigurations/deploySloth.xml @@ -0,0 +1,20 @@ + + + + + + + + + diff --git a/README.md b/README.md index 94daf70..bc69042 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ FTC robot controller code for **VC Silver Circuits (Team 16158)** for the 2025-2 - [Teleop Controls](#teleop-controls) - [Autonomous Sequences](#autonomous-sequences) - [Tuning Parameters](#tuning-parameters) +- [Hot Reload with Sloth](#hot-reload-with-sloth) --- @@ -319,3 +320,29 @@ Mirrors the Blue auto using coordinate flipping (`flipX` / `flipHeading` helpers 4. Run `Tuning` OpMode to verify PedroPathing constants for the current robot. 5. Run `MotifScannerAuto` in pre-match to detect and store the motif pattern before running teleop. 6. For competition matches, run the appropriate auto first, then select the matching alliance teleop — pose is automatically transferred via `PoseStorage`. + +--- + +## Hot Reload with Sloth + +This project uses [Sloth](https://github.com/Dairy-Foundation/Sloth) for hot code reloading. Instead of a full 40+ second APK install, Sloth pushes only changed TeamCode classes to the robot in under 2 seconds. + +### Daily workflow + +1. Make code changes in `TeamCode` +2. Run the **`deploySloth`** run configuration in Android Studio +3. Restart the OpMode on the Driver Hub — changes are live immediately + +### Full install (required when) + +- Adding or updating library dependencies +- Modifying files outside of `TeamCode` (e.g. `build.gradle`, `FtcRobotController`) +- First-time setup on a new robot + +For a full install, run `removeSlothRemote` first (added as a "Before launch" step in the TeamCode run config), then do a normal build & deploy. + +### Notes + +- Only classes under `org.firstinspires.ftc.teamcode` are hot-reloaded +- Classes annotated with `@Pinned` are excluded from hot reload and always require a full install +- Sloth changes survive robot restarts and power cycles diff --git a/TeamCode/build.gradle b/TeamCode/build.gradle index 4b84337..8fc79c9 100644 --- a/TeamCode/build.gradle +++ b/TeamCode/build.gradle @@ -11,9 +11,20 @@ // Custom definitions may go here +buildscript { + repositories { + mavenCentral() + maven { url "https://repo.dairy.foundation/releases" } + } + dependencies { + classpath "dev.frozenmilk:Load:0.2.4" + } +} + // Include common definitions from above. apply from: '../build.common.gradle' apply from: '../build.dependencies.gradle' +apply plugin: 'dev.frozenmilk.sinister.sloth.load' android { namespace = 'org.firstinspires.ftc.teamcode' diff --git a/build.dependencies.gradle b/build.dependencies.gradle index 44eb5fc..06a8fdd 100644 --- a/build.dependencies.gradle +++ b/build.dependencies.gradle @@ -2,6 +2,7 @@ repositories { mavenCentral() google() // Needed for androidx maven { url = "https://mymaven.bylazar.com/releases" } + maven { url = "https://repo.dairy.foundation/releases" } } dependencies { @@ -17,6 +18,7 @@ dependencies { implementation 'com.pedropathing:ftc:2.0.5' implementation 'com.pedropathing:telemetry:1.0.0' - implementation 'com.bylazar:fullpanels:1.0.9' + implementation 'com.bylazar.sloth:fullpanels:0.2.4+1.0.12' + implementation 'dev.frozenmilk.sinister:Sloth:0.2.4' }