How-To: Setup and use PARTsLib
Explanation
| ⚠️ Warning |
|---|
| This page only contains technical information. |
Requirements
The library requrires the following vendor dependincies to be installed.
- WPILib-New-Commands
- PathplannerLib
- CTRE-Phoenix (v6)
Method A - Git
This method involves adding PARTsLib as a submodule in your robot project.
The main advantage to adding the library as a submodule is getting the latest updates.
Experimental library versions are also able to be tested this way too.
🔎 Note
This rquires your robot project to be in a git repository.
This rquires your robot project to be in a git repository.
Install Steps
Adding the library as a submodule.
- In your terminal, navigate to your project folder.
-
Add the repository as a submodule.
git submodule add PARTsLib https://github.com/3492PARTs/PARTsLib.git -
Initialize and update the submodule.
git submodule update --init -r
Adding the library into the gradle project.
-
In settings.gradle add thr following to the bottom of the file on a new line.
include("PARTsLib") -
Navigate to build.gradle. Look for the dependencides and add the following line to the bottom.
dependencies { // All other stuff in here. implementation(project(':PARTsLib')) } - Save and build the project.
Method B - Jitpack.io
This method is more stable because a stable release of the library is used.
Adding the library this way is easier due to it just being a dependency.
A git repository is not required.
Install Steps
- In your terminal, navigate to your project folder.
-
Navigate to build.gradle and add the following lines under the java segmemt.
For the version, put any release listed on the Jitpack site. E.g. "v2026.1.0".
java {
// ...
}
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
}
def PARTSLIB_VERSION = "[VERSION_HERE]" -
In the same file, scroll down to the dependencies section and add the following line to the bottom of that segment.
dependencies {
// Other things.
implementation("com.github.3492PARTs:PARTsLib:${PARTSLIB_VERSION}")
}