64 lines
1.5 KiB
Plaintext
64 lines
1.5 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
|
|
}
|
|
|
|
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")
|
|
}
|
|
}
|