Skip to content

Commit

Permalink
Merge pull request #2 from frc1711/feature/vendor-library-json
Browse files Browse the repository at this point in the history
Vendor library update (v2023.1.2-alpha)
  • Loading branch information
gabrielseaver9678 authored Feb 23, 2023
2 parents 193c33f + 3ce6fdf commit d44af21
Show file tree
Hide file tree
Showing 51 changed files with 522 additions and 120 deletions.
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ CLAW stands for "Common Library Addition to WPILib." It is our team's standard l
### Design Goals
The goal of CLAW is not to fight against WPILib, but to integrate as simply as possible for ease-of-use and maintainability. Much of CLAW works by extending abstract WPILib classes and providing additional functionality, without taking away your control over your own robot project.

## WPILib CLAW Usage
### Adding CLAW to Your Classpath
The CLAW library jar is located at `lib\app\build\libs\claw.jar`. To add it to an existing WPILib project, download this JAR and save it to `proj\libs`(where `proj` is the path to your WPILib project). You'll have to create the `libs` directory, as it probably won't exist already.
## CLAW Releases
CLAW versions follow the format `YEAR.V.v`, where `YEAR` is the WPILib release year, `V` is the major version number, and `v` is the minor
version number.

### Making a New Release
To make a new CLAW release, first ensure that everything is functioning properly. CLAW should be well-tested before any releases are made. Make sure you've run `build-lib.bat` with the most recent changes. Secondly, make a copy of `vendordeps\Vendordep Template.tjson` and follow the comments left as directions. Rename the file according to the commented directions, and delete the old CLAW vendor dependency JSON. Third, push your code to GitHub and make a pull request to the master branch. Finally, create a new release/tag following the established format of release names and descriptions, filling in details about the new release.

Next, add the following line to your project's `build.gradle`:
```
implementation files("libs/claw.jar")
```
## WPILib CLAW Usage
### Vendor Library
You can find a vendor library URL for CLAW under the release of CLAW you would like to use. You can import CLAW in this
way just like you would any other vendor library.

### Implementing CLAW in Your Code
CLAW is a work in progress, and this section is still being developed.
Expand All @@ -21,8 +24,8 @@ TODO: Finish this
## Building and Testing
### CLAW and the Driverstation RCT Client
CLAW is located in the `lib` directory. The entirety of the driverstation
client for the Robot Control Terminal is located within CLAW, and is built along with the rest of CLAW using `build-lib.bat`. This batch script will also add the built library jar
`claw.jar` to the test robot. `run-rct-client.bat` can be used to run the driverstation client in a new command prompt window (after CLAW is built).
client for the Robot Control Terminal is located within CLAW, and is built along with the rest of CLAW using `build-lib.bat`. This batch script will also update the local maven repository which the test robot will point to with its vendor dependency.
`run-rct-client.bat` can be used to run the driverstation client in a new command prompt window (after CLAW is built).

### Test Robot
The test robot is located in the `test-bot` directory. It is not a part of CLAW. Its purpose is purely for testing CLAW as it is being written. The `test-bot` code can be deployed to a connected roboRIO using `deploy-test-bot.bat`. If updates are made to CLAW which should be reflected in this code deployment, `build-lib.bat` must be run before `deploy-test-bot.bat`.
Expand Down
18 changes: 3 additions & 15 deletions build-lib.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

echo Building CLAW

@REM Build the distribution zip (used for the driverstation client)
@REM as well as the library "claw.jar" (used for WPILib projects)
cd lib
@REM Build the distribution zip (used for the driverstation client)
call gradlew.bat distZip
@REM Build the maven repo (used for the test-bot and for any vendor dependencies)
call gradlew.bat publish
cd ..

echo Extracting CLAW distribution for driverstation RCT client
Expand All @@ -14,16 +15,3 @@ echo Extracting CLAW distribution for driverstation RCT client
rmdir /S /Q driverstation-app-extract\app
powershell Expand-Archive lib\app\build\distributions\driverstation-rct-client.zip -DestinationPath driverstation-app-extract
rename driverstation-app-extract\driverstation-rct-client app

echo Copying claw.jar to test robot

@REM Add the new claw.jar to the test robot
xcopy lib\app\build\libs\claw.jar test-bot\libs\ /y

echo.
echo NOTICE
echo Use the command Clean Java Language Server Workspace if any changes in CLAW are not reflected in the test robot code,
echo or add/remove a space from the test robot build.gradle and save in order to trigger a classpath recompilation (see
echo the bottom right corner).
echo.
echo.
2 changes: 1 addition & 1 deletion lib/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
/app/build/*

!/app/build/distributions
!/app/build/libs
!/app/build/maven-repo

/app/bin/*
38 changes: 33 additions & 5 deletions lib/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,44 @@

plugins {
// Apply the application plugin to add support for building a CLI application in Java.
id 'maven-publish'
id 'application'
id 'java'
}

distZip {
archiveName "driverstation-rct-client.zip"
java {
withSourcesJar()
}

jar {
archiveName "claw.jar"
// maven-publish configuration
publishing {
publications {
mavenJava(MavenPublication) {
groupId = 'org.frc.raptors1711'
artifactId = 'raptors-claw'
version = '0' // GRADLE VERSION IS PERMANENTLY 0, DO NOT CHANGE
// The version is permanently zero because a separate maven repository actually exists for each version of CLAW.
// In other words, the version number is encoded in the GitHub release name, NOT THE MAVEN REPOSITORY.
// This is helpful because it ensures that each GitHub release only has to actually contain the build
// for its own version.
from components.java
pom {
name = 'Common Library Extension to WPILib'
description = 'An extension to WPILibJ with a focus on testing and debugging.'
}
}
}

repositories {
maven {
url = layout.buildDir.dir('maven-repo')
}
}
}

distZip {
// Used for zipping the driverstation client app
archiveName "driverstation-rct-client.zip"
}

repositories {
Expand Down Expand Up @@ -74,6 +102,6 @@ dependencies {
}

application {
// Define the main class for the application.
// Define the main class for the driverstation RCT client application:
mainClass = 'claw.rct.local.LocalMain'
}
Binary file modified lib/app/build/distributions/driverstation-rct-client.zip
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
f7be92f5ac76d7f011f43a4fbab9352a
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
94c6057efb26087e59d62bc642d50770cae0f2f3
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cc0de2620d8b5d26842e4091d44d9848c9782fc261dbdc893eaecb36e666ff1c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fe7f1e6c62a01bfd8d2d4ef4c7b814db7e818bb0ea0552dc80b6278d41765fc5955627bd1843083a43bf1b6db817afbd51a077ef496f82fd37bfb50ecb5f6e4e
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c64437c4e3855dfdbbc48ce9634a60bb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bb5fa500ca0622333860118f2ad73d77621d4ad6
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
41050bf4db962f80a1e2456ad2def64d4851aac0173987f0cfec1b3a65c7aa3d
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
25bee8a2b2221c1544b9860de60442c8cf77efed71e73f6f168c05ec812308b9c78262debc086cdf77426e26544b10be4af823118e25fc820b0f5962f65c3db7
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
{
"formatVersion": "1.1",
"component": {
"group": "org.frc.raptors1711",
"module": "raptors-claw",
"version": "0",
"attributes": {
"org.gradle.status": "release"
}
},
"createdBy": {
"gradle": {
"version": "7.3.3"
}
},
"variants": [
{
"name": "apiElements",
"attributes": {
"org.gradle.category": "library",
"org.gradle.dependency.bundling": "external",
"org.gradle.jvm.version": 17,
"org.gradle.libraryelements": "jar",
"org.gradle.usage": "java-api"
},
"files": [
{
"name": "raptors-claw-0.jar",
"url": "raptors-claw-0.jar",
"size": 113205,
"sha512": "25bee8a2b2221c1544b9860de60442c8cf77efed71e73f6f168c05ec812308b9c78262debc086cdf77426e26544b10be4af823118e25fc820b0f5962f65c3db7",
"sha256": "41050bf4db962f80a1e2456ad2def64d4851aac0173987f0cfec1b3a65c7aa3d",
"sha1": "bb5fa500ca0622333860118f2ad73d77621d4ad6",
"md5": "c64437c4e3855dfdbbc48ce9634a60bb"
}
]
},
{
"name": "runtimeElements",
"attributes": {
"org.gradle.category": "library",
"org.gradle.dependency.bundling": "external",
"org.gradle.jvm.version": 17,
"org.gradle.libraryelements": "jar",
"org.gradle.usage": "java-runtime"
},
"dependencies": [
{
"group": "com.google.guava",
"module": "guava",
"version": {
"requires": "30.1.1-jre"
}
},
{
"group": "edu.wpi.first.wpiutil",
"module": "wpiutil-java",
"version": {
"requires": "2023.1.1"
}
},
{
"group": "edu.wpi.first.wpilibj",
"module": "wpilibj-java",
"version": {
"requires": "2023.1.1"
}
},
{
"group": "edu.wpi.first.wpilibNewCommands",
"module": "wpilibNewCommands-java",
"version": {
"requires": "2023.1.1"
}
},
{
"group": "edu.wpi.first.ntcore",
"module": "ntcore-java",
"version": {
"requires": "2023.1.1"
}
},
{
"group": "edu.wpi.first.wpimath",
"module": "wpimath-java",
"version": {
"requires": "2023.1.1"
}
},
{
"group": "org.fusesource.jansi",
"module": "jansi",
"version": {
"requires": "2.4.0"
}
},
{
"group": "org.jline",
"module": "jline-terminal-jansi",
"version": {
"requires": "3.21.0"
}
},
{
"group": "org.jline",
"module": "jline-reader",
"version": {
"requires": "3.21.0"
}
},
{
"group": "net.java.dev.jna",
"module": "jna-platform",
"version": {
"requires": "5.12.1"
}
}
],
"files": [
{
"name": "raptors-claw-0.jar",
"url": "raptors-claw-0.jar",
"size": 113205,
"sha512": "25bee8a2b2221c1544b9860de60442c8cf77efed71e73f6f168c05ec812308b9c78262debc086cdf77426e26544b10be4af823118e25fc820b0f5962f65c3db7",
"sha256": "41050bf4db962f80a1e2456ad2def64d4851aac0173987f0cfec1b3a65c7aa3d",
"sha1": "bb5fa500ca0622333860118f2ad73d77621d4ad6",
"md5": "c64437c4e3855dfdbbc48ce9634a60bb"
}
]
},
{
"name": "sourcesElements",
"attributes": {
"org.gradle.category": "documentation",
"org.gradle.dependency.bundling": "external",
"org.gradle.docstype": "sources",
"org.gradle.usage": "java-runtime"
},
"files": [
{
"name": "raptors-claw-0-sources.jar",
"url": "raptors-claw-0-sources.jar",
"size": 71904,
"sha512": "fe7f1e6c62a01bfd8d2d4ef4c7b814db7e818bb0ea0552dc80b6278d41765fc5955627bd1843083a43bf1b6db817afbd51a077ef496f82fd37bfb50ecb5f6e4e",
"sha256": "cc0de2620d8b5d26842e4091d44d9848c9782fc261dbdc893eaecb36e666ff1c",
"sha1": "94c6057efb26087e59d62bc642d50770cae0f2f3",
"md5": "f7be92f5ac76d7f011f43a4fbab9352a"
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b0fc064dd4e57caccd34e492db097cd4
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
da4aa36ea816d3804b06ebf152431494f655656a
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
09b794a92a2a4d97c16d99ae7071b4007290f898bed7f4781b0253fb5b4011b9
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0476cd79862afcdb30762d775b5d37753cd58fe3c35439e2198fa915b396284ff45ebe73121f7a0fc413d15fe6e7ef15e8967bb1ba2c67978c9bd66ef125344e
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- This module was also published with a richer model, Gradle metadata, -->
<!-- which should be used instead. Do not delete the following line which -->
<!-- is to indicate to Gradle or any Gradle module metadata file consumer -->
<!-- that they should prefer consuming it instead. -->
<!-- do_not_remove: published-with-gradle-metadata -->
<modelVersion>4.0.0</modelVersion>
<groupId>org.frc.raptors1711</groupId>
<artifactId>raptors-claw</artifactId>
<version>0</version>
<name>Common Library Extension to WPILib</name>
<description>An extension to WPILibJ with a focus on testing and debugging.</description>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>30.1.1-jre</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>edu.wpi.first.wpiutil</groupId>
<artifactId>wpiutil-java</artifactId>
<version>2023.1.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>edu.wpi.first.wpilibj</groupId>
<artifactId>wpilibj-java</artifactId>
<version>2023.1.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>edu.wpi.first.wpilibNewCommands</groupId>
<artifactId>wpilibNewCommands-java</artifactId>
<version>2023.1.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>edu.wpi.first.ntcore</groupId>
<artifactId>ntcore-java</artifactId>
<version>2023.1.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>edu.wpi.first.wpimath</groupId>
<artifactId>wpimath-java</artifactId>
<version>2023.1.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.fusesource.jansi</groupId>
<artifactId>jansi</artifactId>
<version>2.4.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jline</groupId>
<artifactId>jline-terminal-jansi</artifactId>
<version>3.21.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jline</groupId>
<artifactId>jline-reader</artifactId>
<version>3.21.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna-platform</artifactId>
<version>5.12.1</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</project>
Loading

0 comments on commit d44af21

Please sign in to comment.