This project is a gradle plugin designed to help generate and keep up to date vendor JSON files.
Note: This is a copy (fork) of this project from Sean Flo's repository. Our RobotLib build calls his version of this plugin as his has been published to the gradle plugins directory and this copy has not. For now, this copy functions as our backup of Sean's project.
It'll read the existing json file, then update the file with any values set in the vendorJSON block in the build.gradle file.
First, you need to apply the plugin by adding this to the beginning of your build.gradle file:
plugins {
// other plugins here.
id "io.github.mosadie.vendorJSON" version "1.1"
}
Then you configure the vendorJSON
task in your build.gradle file.
You only have to set the values you want to change, with the exception of the file name.
Example for a complete vendorJSON block that updates the version number and file name:
vendorJSON {
fileName = "robotLib.json"
version = LibraryVersion
addJavaArtifact("com.github.ORF-4450", archivesBaseName, LibraryVersion)
}
Here is another example with all possible values:
vendorJSON {
name = "Project Name"
version = "Version"
uuid = "uuid"
addMavenUrl("http://example.com/maven/")
jsonUrl = "http://example.com/exampleJson.json"
frcYear = 2024
fileName = "FileName.json"
addJavaArtifact("the.group.id", "artifactId", "version")
// need more Java Artifacts? Call addJavaArtifact again!
addJniArtifact("the.group.id", "artifactId", "version", false, stringArray("examplePlatform"), true)
// need more JNI Artifacts? Call addJniArtifact again!
addCppArtifact("the.group.id", "artifactId", "version", "libName", "configuration", "headerClassifier", "sourcesClassifier", stringArray("examplePlatform"), true, false)
// need more C++ Artifacts? Call addCppArtifact again!
}
Finally, just run the vendorJSON
task from the command line like this: ./gradlew.bat vendorJSON
(Windows) or gradlew vendorJSON
(Other platforms)