Javadocs are created on my PC, which cannot tie into the FTC API to render the appropriate links. But this is enough to generate docs to explain how to work with the code.
81 lines
2.2 KiB
Plaintext
81 lines
2.2 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.javadoc {
|
|
// Only generate docs for chute subsystem
|
|
include("**/subsystems/chute/**")
|
|
|
|
// But exclude FTC hardware files (they need Android SDK)
|
|
exclude("**/FtcMotor.java")
|
|
exclude("**/FtcPotentiometer.java")
|
|
exclude("**/opmodes/**")
|
|
|
|
// Ignore broken @see references to excluded files
|
|
options {
|
|
(this as StandardJavadocDocletOptions).addStringOption("Xdoclint:none", "-quiet")
|
|
}
|
|
}
|
|
|
|
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")
|
|
}
|
|
} |