Generate clean, testable FTC robot projects with proper separation from SDK bloat. Features: - Composite build setup - one shared SDK, multiple clean projects - Subsystem pattern with hardware interfaces for easy testing - JUnit scaffolding - tests run on PC without robot - Minimal project structure (~50KB vs 200MB SDK) - Support for multiple FTC SDK versions Philosophy: Your code should be YOUR code. SDK is just a dependency. Built by Nexus Workshops for FTC teams tired of fighting the standard structure. License: MIT
65 lines
1.8 KiB
Plaintext
65 lines
1.8 KiB
Plaintext
plugins {
|
|
java
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
google()
|
|
}
|
|
|
|
dependencies {
|
|
// Testing (runs on PC without SDK) - THIS IS WHAT YOU USE FOR DEVELOPMENT
|
|
testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
|
|
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
|
testImplementation("org.mockito:mockito-core:5.5.0")
|
|
|
|
// FTC SDK - ONLY needed when you uncomment FTC code for deployment
|
|
// These will be compile errors until you uncomment, that's OK!
|
|
// compileOnly(files("${System.getenv("HOME")}/ftc-sdk/RobotCore/build/libs/RobotCore-release.aar"))
|
|
// compileOnly(files("${System.getenv("HOME")}/ftc-sdk/Hardware/build/libs/Hardware-release.aar"))
|
|
}
|
|
|
|
java {
|
|
sourceCompatibility = JavaVersion.VERSION_11
|
|
targetCompatibility = JavaVersion.VERSION_11
|
|
}
|
|
|
|
tasks.test {
|
|
useJUnitPlatform()
|
|
testLogging {
|
|
events("passed", "skipped", "failed")
|
|
showStandardStreams = false
|
|
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
|
|
}
|
|
}
|
|
|
|
// Task to deploy to FTC SDK
|
|
tasks.register<Copy>("deployToSDK") {
|
|
group = "ftc"
|
|
description = "Copy code to FTC SDK TeamCode for deployment"
|
|
|
|
val sdkDir = System.getenv("HOME") + "/ftc-sdk"
|
|
|
|
from("src/main/java")
|
|
into("$sdkDir/TeamCode/src/main/java")
|
|
|
|
doLast {
|
|
println("✓ Code deployed to $sdkDir/TeamCode")
|
|
println("")
|
|
println("Next steps:")
|
|
println(" cd $sdkDir")
|
|
println(" ./gradlew build")
|
|
}
|
|
}
|
|
|
|
tasks.register<Exec>("ftcBuild") {
|
|
group = "ftc"
|
|
description = "Deploy code and build FTC APK"
|
|
|
|
dependsOn("deployToSDK")
|
|
|
|
val sdkDir = System.getenv("HOME") + "/ftc-sdk"
|
|
workingDir(file(sdkDir))
|
|
commandLine("./gradlew", "build")
|
|
}
|