Implements automated homing, potentiometer wraparound tracking, and position control for FTC chute mechanism. Includes mock hardware for testing and real hardware adapters for deployment.
66 lines
1.7 KiB
Plaintext
66 lines
1.7 KiB
Plaintext
plugins {
|
|
java
|
|
}
|
|
dependencies {
|
|
// Testing (runs on PC without SDK)
|
|
testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
|
|
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
|
testImplementation("org.mockito:mockito-core:5.5.0")
|
|
}
|
|
java {
|
|
sourceCompatibility = JavaVersion.VERSION_11
|
|
targetCompatibility = JavaVersion.VERSION_11
|
|
}
|
|
|
|
// Exclude FTC hardware files from PC compilation (they need Android SDK)
|
|
tasks.withType<JavaCompile> {
|
|
exclude("**/FtcMotor.java")
|
|
exclude("**/FtcPotentiometer.java")
|
|
exclude("**/opmodes/ChuteOpMode.java")
|
|
}
|
|
|
|
tasks.test {
|
|
useJUnitPlatform()
|
|
testLogging {
|
|
events("passed", "skipped", "failed")
|
|
showStandardStreams = false
|
|
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
|
|
}
|
|
}
|
|
// Task to deploy code to FTC SDK
|
|
tasks.register<Copy>("deployToSDK") {
|
|
group = "ftc"
|
|
description = "Copy code to FTC SDK TeamCode for deployment"
|
|
|
|
val sdkDir = "/home/eric/.weevil/ftc-sdk"
|
|
|
|
from("src/main/java") {
|
|
include("robot/**/*.java")
|
|
}
|
|
|
|
into(layout.projectDirectory.dir("$sdkDir/TeamCode/src/main/java"))
|
|
|
|
doLast {
|
|
println("✓ Code deployed to TeamCode")
|
|
}
|
|
}
|
|
// Task to build APK
|
|
tasks.register<Exec>("buildApk") {
|
|
group = "ftc"
|
|
description = "Build APK using FTC SDK"
|
|
|
|
dependsOn("deployToSDK")
|
|
|
|
val sdkDir = "/home/eric/.weevil/ftc-sdk"
|
|
workingDir = file(sdkDir)
|
|
|
|
commandLine = if (System.getProperty("os.name").lowercase().contains("windows")) {
|
|
listOf("cmd", "/c", "gradlew.bat", "assembleDebug")
|
|
} else {
|
|
listOf("./gradlew", "assembleDebug")
|
|
}
|
|
|
|
doLast {
|
|
println("✓ APK built successfully")
|
|
}
|
|
} |