Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ plugins {
}

dependencies {
// Spotless code formatter.
// Spotless code formatter - https://github.com/diffplug/spotless
implementation('com.diffplug.spotless:com.diffplug.spotless.gradle.plugin:6.25.0')

// Gradle Maven Publish Plugin - https://vanniktech.github.io/gradle-maven-publish-plugin/
implementation('com.vanniktech.maven.publish.base:com.vanniktech.maven.publish.base.gradle.plugin:0.34.0')
}

repositories {
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/groovy/java-common-conventions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ spotless {
javadoc {
options {
// CTRE (Phoenix 5 & 6)
links += "https://api.ctr-electronics.com/phoenix6/release/java/"
links += "https://api.ctr-electronics.com/phoenix6/stable/java/"
// WPILib
links += "https://github.wpilib.org/allwpilib/docs/release/java/"
// REVLib
Expand Down
45 changes: 22 additions & 23 deletions buildSrc/src/main/groovy/publishing-conventions.gradle
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
plugins {
id 'maven-publish'
id 'com.vanniktech.maven.publish'
}

version = '2.0.0-rc-2'

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'
}
mavenPublishing {
publishToMavenCentral()
if (gradle.startParameter.taskNames.any { it.contains('MavenCentral') }) {
signAllPublications()
}

coordinates('com.team2813.lib2813', project.name, project.version)

pom {
inceptionYear = '2023'
url = 'https://github.com/Prospect-Robotics/lib2813'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
scm {
url = 'https://github.com/Prospect-Robotics/lib2813'
connection = 'scm:git:git://github.com/Prospect-Robotics/lib2813.git'
developerConnection = 'scm:git:git://github.com/Prospect-Robotics/lib2813.git'
}
}
}
22 changes: 9 additions & 13 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,15 @@ tasks.named('test') {
systemProperty 'junit.jupiter.extensions.autodetection.enabled', 'true'
}

publishing {
publications {
lib2813(MavenPublication) {
pom {
name = '2813 Library'
description = 'Frequently reused code written by team 2813'
developers {
developer {
id = 'cuttestkittensrule'
name = 'Kyle'
email = 'mangoiscute95@gmail.com'
}
}
mavenPublishing {
pom {
name = '2813 Library'
description = 'Frequently reused code written by team 2813'
developers {
developer {
id = 'cuttestkittensrule'
name = 'Kyle'
email = 'mangoiscute95@gmail.com'
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
*/
final class IsolatedPreferences extends ExternalResource {
private NetworkTableInstance tempInstance;
private NetworkTableInstance prevInstance;

/** Gets the {@link NetworkTable} that contains the preference values. */
public NetworkTable getPreferencesTable() {
Expand All @@ -34,18 +35,18 @@ public NetworkTable getPreferencesTable() {

@Override
protected void before() {
NetworkTableInstance.getDefault();
prevInstance = Preferences.getNetworkTable().getInstance();
tempInstance = NetworkTableInstance.create();
tempInstance.startLocal();
Preferences.setNetworkTableInstance(tempInstance);
}

@Override
protected void after() {
Preferences.setNetworkTableInstance(NetworkTableInstance.getDefault());
if (!tempInstance.waitForListenerQueue(.2)) {
Preferences.setNetworkTableInstance(prevInstance);
if (!tempInstance.waitForListenerQueue(.6)) {
System.err.println(
"Timed out waiting for the NetworkTableInstance listener queue to empty (waited 200ms);"
"Timed out waiting for the NetworkTableInstance listener queue to empty (waited 600ms);"
+ " JVM may crash");
}
tempInstance.close();
Expand Down
32 changes: 14 additions & 18 deletions limelight/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,20 @@ test {
useJUnit()
}

publishing {
publications {
lib2813(MavenPublication) {
pom {
name = '2813 Limelight Library'
description = 'Limelight utilities for FRC robots'
developers {
developer {
id = 'cuttestkittensrule'
name = 'Kyle'
email = 'mangoiscute95@gmail.com'
}
developer {
id = 'kcooney'
name = 'Kevin'
email = 'kcooney@gmail.com'
}
}
mavenPublishing {
pom {
name = '2813 Limelight Library'
description = 'Limelight utilities for FRC robots'
developers {
developer {
id = 'cuttestkittensrule'
name = 'Kyle'
email = 'mangoiscute95@gmail.com'
}
developer {
id = 'kcooney'
name = 'Kevin'
email = 'kcooney@gmail.com'
}
}
}
Expand Down
32 changes: 14 additions & 18 deletions testing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,20 @@ tasks.named('test') {
systemProperty 'junit.jupiter.extensions.autodetection.enabled', 'true'
}

publishing {
publications {
lib2813(MavenPublication) {
pom {
name = '2813 Testing Library'
description = 'Utilities for testing FRC robots'
developers {
developer {
id = 'cuttestkittensrule'
name = 'Kyle'
email = 'mangoiscute95@gmail.com'
}
developer {
id = 'kcooney'
name = 'Kevin'
email = 'kcooney@gmail.com'
}
}
mavenPublishing {
pom {
name = '2813 Testing Library'
description = 'Utilities for testing FRC robots'
developers {
developer {
id = 'cuttestkittensrule'
name = 'Kyle'
email = 'mangoiscute95@gmail.com'
}
developer {
id = 'kcooney'
name = 'Kevin'
email = 'kcooney@gmail.com'
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ public void afterEach(ExtensionContext context) {
// This works around a race condition in WPILib where a listener registered by Preferences can
// be called after the NetworkTableInstance was closed (see
// https://github.com/wpilibsuite/allwpilib/issues/8215).
if (!data.testInstance.waitForListenerQueue(.2)) {
if (!data.testInstance.waitForListenerQueue(.6)) {
System.err.println(
"Timed out waiting for the NetworkTableInstance listener queue to empty (waited 200ms);"
"Timed out waiting for the NetworkTableInstance listener queue to empty (waited 600ms);"
+ " JVM may crash");
}
data.testInstance.close();
Expand Down
32 changes: 14 additions & 18 deletions vision/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,20 @@ test {
systemProperty 'junit.jupiter.extensions.autodetection.enabled', 'true'
}

publishing {
publications {
lib2813(MavenPublication) {
pom {
name = '2813 Vision Library'
description = 'Utilities for location and vision for FRC robots'
developers {
developer {
id = 'cuttestkittensrule'
name = 'Kyle'
email = 'mangoiscute95@gmail.com'
}
developer {
id = 'kcooney'
name = 'Kevin'
email = 'kcooney@gmail.com'
}
}
mavenPublishing {
pom {
name = '2813 Vision Library'
description = 'Utilities for location and vision for FRC robots'
developers {
developer {
id = 'cuttestkittensrule'
name = 'Kyle'
email = 'mangoiscute95@gmail.com'
}
developer {
id = 'kcooney'
name = 'Kevin'
email = 'kcooney@gmail.com'
}
}
}
Expand Down
Loading