-
Notifications
You must be signed in to change notification settings - Fork 0
2.0.0-rc-1 release #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
2.0.0-rc-1 release #116
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4f42a49
Add `@since` Javadoc tags to classes and APIs added in 2.0.0
kcooney cf01981
2.0.0-rc-1 release
kcooney 72e72ad
Update README.md and add CONTRIBUTING.md
kcooney 1090ce2
Extract publishing-conventions.gradle
kcooney 48d3dc5
Documentation cleanups
kcooney 3e78d4b
Update CONTRIBUTING.md to have the user create a `libs.versions.toml`…
kcooney 1e792b1
Update MAINTAINERS.md to reference publishing-conventions.gradle
kcooney File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| # Contributing to lib2813 | ||
|
|
||
| We welcome contributions! | ||
|
|
||
| ## What to Contribute | ||
|
|
||
| - Bug reports | ||
| - Bug fixes (consider filing a bug report first) | ||
| - Feature additions (please create an issue first) | ||
|
|
||
| ## Pull Request Guidelines | ||
|
|
||
| - Code should be well documented. | ||
| - Please consider writing tests. Tests give us assurance that new changes do not break older functionality. | ||
| - We loosely follow the [Google Java Style Guide](https://google.github.io/styleguide/javaguide.html). Format the code | ||
| using `./gradlew spotlessApply`. | ||
| - Write a [good change description](https://google.github.io/eng-practices/review/developer/cl-descriptions.html) | ||
|
|
||
| We may ask you to test locally on your robot code in simulation mode. | ||
|
|
||
| ## Getting Started | ||
|
|
||
| If you need to make changes to lib213, you can either clone the repository directly, or you | ||
| can include it as a submodule for your robot code. | ||
|
|
||
| ### Option 1: Developing on a Clone | ||
|
|
||
| To clone the repository, run: | ||
|
|
||
| ```shell | ||
| git clone --recurse-submodules https://github.com/Prospect-Robotics/Robot2025.git | ||
| ``` | ||
|
|
||
| ### Option 2: Developing via Submodules | ||
|
|
||
| #### 1. Adding the lib2813 repo as a submodule | ||
|
|
||
| When making changes to lib2813, it is often helpful to build the code along with your robot code. | ||
| To do that, you can add the lib2813 repo as a submodule. | ||
|
|
||
| Before adding the submodule, it is recommended that you set the `submodule.stickyRecursiveClone` | ||
| git config option to `true` to make working with submodule easier (see | ||
| [this StackOverflow answer](https://stackoverflow.com/a/53622660) for details about this option). | ||
| To do this, run the following command from any directory: | ||
| ```shell | ||
| git config --global submodule.stickyRecursiveClone true | ||
| ``` | ||
|
|
||
| To add the lib2813 submodule, go to your robot project directory (where the `settings.gradle` file is), and run | ||
| this command: | ||
| ```shell | ||
| git submodule add https://github.com/Prospect-Robotics/lib2813 | ||
| ``` | ||
|
|
||
| #### 2. Updating Gradle files | ||
|
|
||
| Add the following lines needs to be added to your `settings.gradle`: | ||
| ``` | ||
| includeBuild('lib2813') { | ||
| dependencySubstitution { | ||
| substitute module('com.team2813.lib2813:lib') using project(':lib') | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| Next, remove the version numbers for the lib2813 dependencies in your `build.gradle`: | ||
|
|
||
| ``` | ||
| implementation "com.team2813.lib2813:lib" | ||
| ``` | ||
|
|
||
| Finally, in order to guarantee that the library jars are created before GradleRIO referees to them, add the following | ||
| lines to your `build.gradle`: | ||
| ```groovy | ||
| downloadDepsPreemptively.dependsOn gradle.includedBuild('lib2813').task(':lib:jar') | ||
| downloadDepsPreemptively.dependsOn gradle.includedBuild('lib2813').task(':testing:jar') | ||
| downloadDepsPreemptively.dependsOn gradle.includedBuild('lib2813').task(':limelight:jar') | ||
| ``` | ||
|
|
||
| #### 3. Fixing vscode jank | ||
| As of version 1.85.1, vscode doesn't work properly with gradle composite builds without the old buildServer. To use the old buildServer, add the following line | ||
| to your settings.json | ||
| ``` | ||
| "java.gradle.buildServer.enabled": "off", | ||
| ``` | ||
| This isn't strictly necessary, but without it vscode will not be able to do code completion from things in the library, and tell the user that there are errors, | ||
| when gradle builds fine. | ||
|
|
||
| ## Tips and Tricks | ||
|
|
||
| ### Publishing to Maven Local | ||
|
|
||
| It can often be useful to publish jars locally and test with a real or simulated robot. | ||
|
|
||
| To publish to Maven Local, run: | ||
|
|
||
| ```shell | ||
| ./gradlew publishToMavenLocal -Pversion=2.0.0-test-123 | ||
| ``` | ||
|
|
||
| (replace "test-123" with some unique identifier) | ||
|
|
||
| In your robot's `build.gradle` file, be sure to include Maven Local in your repositories: | ||
|
|
||
| ```groovy | ||
| repositories { | ||
| mavenLocal() | ||
| mavenCentral() | ||
| } | ||
| ``` | ||
|
|
||
| Then update your `libs.versions.toml` to reference the version that you published locally. | ||
|
|
||
| ### Cloning a repository with a git submodule | ||
| When cloning a repository with a git submodule, git will not automatically get the files in the submodules. in order to do this, run the command | ||
| ``` | ||
| git submodule update --init --recursive | ||
| ``` | ||
| This command will recursively initialize all submodules. | ||
|
|
||
| ### Getting blame data | ||
|
|
||
| To ignore code reformatting when running `git blame` run: | ||
|
|
||
| ```shell | ||
| git config blame.ignoreRevsFile .git-blame-ignore-revs | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # Maintainer Documentation | ||
|
|
||
| ## Publishing to Maven Central | ||
|
|
||
| Before publishing to Maven Central, consider publishing to Maven Local. | ||
|
|
||
| 1. Run `./gradlew build` to build the code, run the tests, and verify that there are no formatting | ||
| issues | ||
| 2. Update the version string in `publishing-conventions.gradle`. | ||
| 3. Make sure all changes are pushed to GitHub | ||
| 4. ??? | ||
| 5. Celebrate! | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,51 +1,63 @@ | ||
| # User Documentation | ||
|
|
||
| ## adding submodule | ||
| In order to use, go to your WPILib project directory (the inner one, where the build.gradle file is), and run the command | ||
| ``` | ||
| git submodule add https://github.com/Prospect-Robotics/lib2813 | ||
| ``` | ||
| ## adding submodule to gradle | ||
| The following lines needs to be added to your settings.gradle to make the lib usable: | ||
| ## Using the libraries | ||
|
|
||
| ### Updating your dependencies | ||
|
|
||
| > [!NOTE] | ||
| > The lib2813 jars are not yet published to Maven Central. For the time being, you need to publish | ||
| > them to Maven Local. See [the Contributing page](CONTRIBUTING.md#publishing-to-maven-local) for details. | ||
|
|
||
| In your project's "gradle" directory, create a file named `libs.versions.toml` with the following content: | ||
|
|
||
| ```toml | ||
| [versions] | ||
| lib2813 = "2.0.0-rc-1" | ||
|
|
||
| [libraries] | ||
| lib2813-lib = { module = "com.team2813.lib2813:lib", version.ref="lib2813" } | ||
| lib2813-vision = { module = "com.team2813.lib2813:vision", version.ref="lib2813" } | ||
| lib2813-limelight = { module = "com.team2813.lib2813:limelight", version.ref="lib2813" } | ||
| lib2813-testing = { module = "com.team2813.lib2813:testing", version.ref="lib2813" } | ||
| ``` | ||
| includeBuild('lib2813') { | ||
| dependencySubstitution { | ||
| substitute module('com.team2813:lib2813') using project(':lib') | ||
| } | ||
|
|
||
| In your `build.gradle`, update the `dependencies` section: | ||
|
|
||
| ```groovy | ||
| dependencies { | ||
| // Existing dependencies | ||
| implementation libs.lib2813.lib | ||
| implementation libs.lib2813.vision | ||
| implementation libs.lib2813.limelight | ||
| testImplementation libs.lib2813.testing | ||
| } | ||
| ``` | ||
| Whatever text that is in the module parentheses is the text that will need to be in an `implementation` statement to depend on the library. | ||
| So, after adding the lines to the settings.gradle, this line in the dependencies block will refer to the library. | ||
| ``` | ||
| implementation "com.team2813:lib2813" | ||
| ``` | ||
| Finally, in order to guarantee that the library jars are created before GradleRIO referees to them, add the following line to your build.gradle | ||
| ``` | ||
| downloadDepsPreemptively.dependsOn gradle.includedBuild("lib2813").task(":lib:jar") | ||
| ``` | ||
|
|
||
| ## Fixing vscode jank | ||
| As of version 1.85.1, vscode doesn't work properly with gradle composite builds without the old buildServer. To use the old buildServer, add the following line | ||
| to your settings.json | ||
| ``` | ||
| "java.gradle.buildServer.enabled": "off", | ||
| ``` | ||
| This isn't strictly necessary, but without it vscode will not be able to do code completion from things in the library, and tell the user that there are errors, | ||
| when gradle builds fine. | ||
| Note that you do not need to include all the dependencies. See the [Runtime dependencies](#runtime-dependencies) | ||
| section for details. | ||
|
|
||
| ## Cloning a repository with a git submodule | ||
| When cloning a repository with a git submodule, git will not automatically get the files in the submodules. in order to do this, run the command | ||
| ``` | ||
| git submodule update --init --recursive | ||
| In addition be sure to include Maven Local in the list of repositories in your `build.gradle` | ||
| (needed until we publish to Maven Central): | ||
|
|
||
| ```groovy | ||
| repositories { | ||
| mavenLocal() | ||
| mavenCentral() | ||
| } | ||
| ``` | ||
| This command will recursively initialize all submodules. | ||
|
|
||
| This code is still in development, and apis are still subject to change. The most likely thing to get removed is the swerve api, as ctre recently released their own. | ||
| ### Upgrading | ||
|
|
||
| ## Developer Documentation | ||
| To upgrade the version of the lib2813 libraries you are using, simply update the version string for "lib2813" in | ||
| `libs.versions.toml`. | ||
|
|
||
| To ignore code reformatting when running `git blame` run: | ||
| ### Vendordeps | ||
|
|
||
| ```shell | ||
| git config blame.ignoreRevsFile .git-blame-ignore-revs | ||
| ``` | ||
| - `com.team2813.lib2813:lib`: | ||
| - `WPILibNewCommands.json` | ||
| - `Phoenix6.json` (if using Phoenix motors) | ||
| - `REVLib.json` (if using REV Robotics motors) | ||
| - `com.team2813.lib2813:vision`: | ||
| - `photonlib.json` | ||
| - `com.team2813.lib2813:testing`: | ||
| - `WPILibNewCommands.json` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| plugins { | ||
| id 'maven-publish' | ||
| } | ||
|
|
||
| version = '2.0.0-rc-1' | ||
|
|
||
| publishing { | ||
| publications { | ||
| lib2813(MavenPublication) { | ||
| groupId = 'com.team2813.lib2813' | ||
| from components.java | ||
| artifact sourceJar | ||
| pom { | ||
| licenses { | ||
| license { | ||
| name = 'The Apache License, Version 2.0' | ||
| url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
| } | ||
| } | ||
| scm { | ||
| connection = 'scm:git:git://github.com/Prospect-Robotics/lib2813.git' | ||
| developerConnection = 'scm:git:git://github.com/Prospect-Robotics/lib2813.git' | ||
| url = 'https://github.com/Prospect-Robotics/lib2813' | ||
| } | ||
| organization { | ||
| name = 'FRC 2813 Gear Heads' | ||
| url = 'https://team2813.com' | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.