Skip to content

A Gradle plugin to add a task to generate/update the vendor JSON file needed for GradleRio

License

Notifications You must be signed in to change notification settings

ORF-4450/GradleVendorJSON

 
 

Repository files navigation

Gradle Vendor JSON

What is this?

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.

How do I use this?

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)

About

A Gradle plugin to add a task to generate/update the vendor JSON file needed for GradleRio

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%