Quick Start¶
Battleaid is not published on Maven as a public package (yet), and is only available as a GitHub package. This requires more setup by the user, but the result functions exactly as any other remote resource.
Steps¶
Generate a GitHub access token (classic) with
read:packagespermission and copy it your clipboard. GitHub has a tutorial.
Tip
Keep your token somewhere safe and easily accessible! If you decide to use a different computer or move to a different project you will need to repeat these steps!
Create the file
gradle.propertiesin the root directory of your FRC robot project and add your username and token (without < or >):
1github.username = <your_github_username_here>
2github.token = <your_token_here>
Tip
You can also put gradle.properties under ~/.gradle if you want your authentication to be system wide.
If it does not already exist, create the file
.gitignorein your project root directory. Addgradle.propertiesto the list of entries.
Danger
If gradle.properties is pushed to the remote repository containing your token (which is basically a password), your token will be publicly exposed. This puts your account at risk.
In your FRC robot project in WPILib, add this to the top of your
build.gradlefile:
repositories {
maven {
url = uri("https://maven.pkg.github.com/frc4206/battleaid")
credentials {
username = project.findProperty("github.username") ?: System.getenv("GITHUB_USERNAME")
password = project.findProperty("github.token") ?: System.getenv("GITHUB_TOKEN")
}
}
}
Add Battleaid to your list of dependencies:
dependencies {
...
implementation 'org.team4206:battleaid:<version_number>' # e.g. 0.1.0
}
Don’t know what version number to use? The releases are on GitHub.
Open a terminal and run
./gradlew build. This will download the package.
Tip
If the build is successful but you still see squiggly red errors in your code, you may need to refresh the Java Lanaguage Server in order for Battleaid to be visible:
Cntrl+Shft+P>Java: Clean Java Language Server Workspace
If all of the above steps are performed correctly, Battleaid will be listed as an external dependency in the Java Projects primary sidebar view container.