# How-To: Setup and use PARTsLib

### Explanation
<table style="width: 80%; margin: 0 auto; border-collapse: collapse;">
  <thead>
    <tr>
      <th style="text-align: center;">⚠️ Warning</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td style="text-align: center;">This page only contains technical information.</td>
    </tr>
  </tbody>
</table>

<center>Last updated: April 2nd, 2026</center>
</p>
This guide explains how to setup and include PARTsLib into your robot project. There are two ways to add PARTsLib into your robot project.

#### 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.<br>
The main advantage to adding the library as a submodule is getting the latest updates.<br>
Experimental library versions are available for testing.

<!-- I like how GitHub's markdown flavor has these types of notes, so I remade it in HTML. -->
<div style="border-left: 4px solid #2f81f7; padding: 0.75em 1em;">
    <strong style="color:#2f81f7;">🔎 Note</strong><br> This rquires your robot project to be in a git repository.
</div>
<br>

<details>
<summary>Install Steps</summary>

  <b>Adding the library as a submodule.</b>
  <ol>
      <li>In your terminal, navigate to your project folder.</li>
      <li>
        Add the repository as a submodule.
        <pre><code>git submodule add PARTsLib https://github.com/3492PARTs/PARTsLib.git</code></pre>
      </li>
      <li>
        Initialize and update the submodule.
        <pre><code>git submodule update --init -r</code></pre>
      </li>
  </ol>

<!--
  + <details>
    <summary>Bonus: VS Code Task</summary>
    This involves making VS Code tasks that auto update and build the project on launch of the IDE.

    <ol>
      <li>
        
      </li>
    </ol>
    </details>
-->

  <b>Adding the library into the gradle project.</b>
  <ol>
      <li>
        In settings.gradle add thr following to the bottom of the file on a new line.
        <pre><code>include("PARTsLib")</code></pre>
      </li>
      <li>
        Navigate to build.gradle. Look for the dependencides and add the following line to the bottom.
        <pre><code>dependencies {
    // All other stuff in here.
    implementation(project(':PARTsLib'))
}</code></pre>
      </li>
      <li>Save and build the project.</li>
  </ol>
</details>

#### Method B - Jitpack.io
This method is more stable because a stable release of the library is used.<br>
Adding the library this way is easier due to it just being a dependency.<br>
A git repository is not required.

<details>
<summary>Install Steps</summary>

  <b>Adding the library as a dependency.</b>
  <ol>
      <li>In your terminal, navigate to your project folder.</li>
      <li>
        Navigate to build.gradle and add the following lines under the java segmemt.
        For the version, put any release listed on the <a href="https://jitpack.io/#3492PARTs/PARTsLib" target="_blank">Jitpack</a> site. E.g. "v2026.1.0".
        <pre><code>java {<br>    // ...<br>}<br><br>repositories {<br>    mavenCentral()<br>    maven { url "https://jitpack.io" }<br>}<br><br>def PARTSLIB_VERSION = "[VERSION_HERE]"</code></pre>
      </li>
      <li>
        In the same file, scroll down to the dependencies section and add the following line to the bottom of that segment.
        <pre><code>dependencies {<br>    // Other things.<br><br>    implementation("com.github.3492PARTs:PARTsLib:${PARTSLIB_VERSION}")<br>}</code></pre>
      </li>
  </ol>
</details>