mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-05 03:21:42 +00:00
[examples] Reorganize templates to use CommandsV2 (#8432)
Change Commandbased to Commandv2 Run example check on templates
This commit is contained in:
@@ -24,30 +24,12 @@ def fileCheck = { parsedJson, folder ->
|
||||
}
|
||||
}
|
||||
|
||||
task checkTemplates(type: Task) {
|
||||
doLast {
|
||||
def parsedJson = new groovy.json.JsonSlurper().parseText(templateFile.text)
|
||||
fileCheck(parsedJson, templateDirectory)
|
||||
parsedJson.each {
|
||||
assert it.name != null
|
||||
assert it.description != null
|
||||
assert it.tags != null
|
||||
assert it.foldername != null
|
||||
assert it.gradlebase != null
|
||||
assert it.commandversion != null
|
||||
if (it.gradlebase == 'java') {
|
||||
assert it.mainclass != null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def tagList = [
|
||||
/* --- Categories --- */
|
||||
// On-RIO image processing
|
||||
"Vision",
|
||||
"Vision", "AprilTags",
|
||||
// Command-based
|
||||
"Command-based",
|
||||
"Commandv2", "Commandv3",
|
||||
// Romi
|
||||
"Romi",
|
||||
// XRP
|
||||
@@ -79,11 +61,33 @@ def tagList = [
|
||||
/* --- HID --- */
|
||||
"XboxController", "PS4Controller", "PS5Controller", "Joystick",
|
||||
|
||||
/* --- RobotBase --- */
|
||||
"Timed", "Timeslice", "RobotBase", "Educational",
|
||||
|
||||
/* --- Misc --- */
|
||||
/* (try to keep this section minimal) */
|
||||
"EventLoop", "AprilTags", "Mechanism2d", "Preferences",
|
||||
"EventLoop", "Mechanism2d", "Preferences", "Skeleton"
|
||||
]
|
||||
|
||||
task checkTemplates(type: Task) {
|
||||
doLast {
|
||||
def parsedJson = new groovy.json.JsonSlurper().parseText(templateFile.text)
|
||||
fileCheck(parsedJson, templateDirectory)
|
||||
parsedJson.each {
|
||||
assert it.name != null
|
||||
assert it.description != null
|
||||
assert it.tags != null
|
||||
assert it.tags.findAll { !tagList.contains(it) }.empty
|
||||
assert it.foldername != null
|
||||
assert it.gradlebase != null
|
||||
assert it.commandversion != null
|
||||
if (it.gradlebase == 'java') {
|
||||
assert it.mainclass != null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task checkExamples(type: Task) {
|
||||
doLast {
|
||||
def parsedJson = new groovy.json.JsonSlurper().parseText(exampleFile.text)
|
||||
|
||||
Reference in New Issue
Block a user