Commit Graph

60 Commits

Author SHA1 Message Date
Peter Johnson
ef676aca70 Merge branch 'main' into 2027 2025-09-25 22:17:00 -07:00
Tyler Veness
ab259c2e89 [build] Fix Gradle 9 archives deprecation warning (#8247)
The deprecation message was:
```
The `archives` configuration added by the `base` plugin has been
deprecated and will be removed in Gradle 10.0.0. Adding artifacts to the
`archives` configuration will now result in a deprecation warning. If
you want the artifact built when running the `assemble` task, you should
add the artifact (or the task that produces it) as a dependency of the
`assemble` task directly.

val specialJar = tasks.register<Jar>("specialJar") {
    archiveBaseName.set("special")
    from("build/special")
}
tasks.named("assemble") {
    dependsOn(specialJar)
}
```
2025-09-22 11:58:14 -06:00
Peter Johnson
3e4e9c9b01 Merge branch 'main' into 2027 2025-08-09 00:55:26 -07:00
Tyler Veness
9ac7e286f5 [build] Upgrade Gradle plugins (#8166)
I upgraded all plugins I could see except org.ysb33r.doxygen. 2.0 made
breaking changes, and I couldn't figure out how to migrate.

Most of the changes are for suppressing new linter purification rites.
2025-08-08 23:04:02 -07:00
Tyler Veness
0a0adebd89 [build] Upgrade to Gradle 8.14.3 (#8164)
This fixes local builds with JDK 24.

I fixed deprecation warnings from `./gradlew wrapper --warning-mode all`
as well.
2025-08-08 09:08:34 -06:00
Jade
e93c8cdb29 [build] Upgrade to Java 21 (#7547)
Signed-off-by: Jade Turner <spacey-sooty@proton.me>
Co-authored-by: sciencewhiz <sciencewhiz@users.noreply.github.com>
2025-07-25 15:45:40 -07:00
Thad House
82132c3272 [hal] Initial SystemCore empty HAL (#7454) 2024-11-30 10:04:00 -08:00
Thad House
3cc541f261 Remove generated google protobuf support (#7371)
It's not used anymore, and cleans up the build.
2024-11-08 18:29:30 -08:00
Thad House
8b8b634f65 [wpiutil] Change C++ protobuf to nanopb (#7309)
The Google C++ protobuf implementation has issues with dynamic linkage across DLL boundaries because it uses global variables.  It also has a compile-time dependency because the protoc version must exactly match the libprotobuf version.  Using nanopb with a customized generator fixes both of these issues.

Co-authored-by: Gold856 <117957790+Gold856@users.noreply.github.com>
2024-11-07 22:42:50 -08:00
Sam Carlberg
f1dde8895e [build] Use project configured groupId in generated output artifact names (#7095)
Instead of hardcoding to use the project name after edu_wpi_first, which broke epilogue publishing

This did not affect local maven publishing, since it does not use those specially named and configured artifacts
2024-09-18 20:44:01 -07:00
Thad House
a9ac5b8e24 Don't read protobuf static data across shared library lines directly (#6979)
Reading exported data from shared objects on windows is broken. It requires __declspec(dllimport). However, this is problematic, as we use the same static libraries both from a shared and static context. So we can't just blindly apply dllimport.

The linker should have caught this, as data members are exported in a different way. However, due to a bug in native-utils, data member symbols were exposed directly. However, interacting with those data member was completely broken.

The only way we can really solve this is to just not use static data members. We're pretty good about this in WPILib itself. However, protobuf is absolutely terrible at this. There are a ton of inline functions that access global data. For the protobuf library itself, we can solve this easily enough.

However, for the generated protobuf code, this is much more problematic. The member needed to bypass the global data is private. This means using just the stock protobuf code, this problem is not solvable. But, protobuf generated code has insertion points. Those insertion points let us add our own code into the generated code via a protoc plugin. And it just so happens that an insertion point exists to add extra public methodsto the generated protobuf header. There is also an insertion point to let us add to the cpp file.

The methods we need are the getters, for unpacking protobufs. For any protobuf that has a message as a member, we generate a new wpi_x() getter (the existing one is just x(), where x is the field name). We then implement this in the cpp file. A trick we can use is in the cpp file, we can safely call the x() function, as the cpp file is in the same library as the global. Thus we can call that inline method, and not actually need to directly access any internal private state of the protobuf object.

TL;DR, all protobuf classes that have messages as fields now have a wpi_x() accessor that must be used instead of x() if you want the code to work on windows. After wpilibsuite/native-utils#212, the bad code will fail to link, rather then just fail at runtime.
2024-08-21 07:53:20 -07:00
Ryan Blue
c13c512221 [build] Spotless: ignore test json files (#6938) 2024-08-10 23:27:47 -07:00
Sam Carlberg
59256f0e00 [epilogue] Add an annotation-based logging framework for Java programs (#6584) 2024-07-16 17:25:43 -07:00
Gold856
b0cc84a9c7 [build] Upgrade to PMD 7.2.0 (#6718) 2024-06-08 22:08:23 -07:00
Isaac Turner
6a73ca8c08 [build] Change source compatibility to Java 17 (#6585) 2024-05-05 07:52:42 -07:00
Tyler Veness
d40bdd70ba [build] Upgrade to spotbugs Gradle plugin 6.0.2 (#6027) 2023-12-09 15:34:29 -08:00
Gold856
28deba20f5 [wpimath] Commit generated quickbuf Java files (#5994)
This removes a build dependency on the quickbuf generator being available for the build platform.

It's safe to generate Java because the quickbuf version is defined by the project.

C++ protobufs can't be committed because the protoc version must
match the library version (this is a particular issue for cmake builds).
2023-12-05 17:02:29 -08:00
PJ Reiniger
54ab65a63a [ntcore] Commit generated files (#5962) 2023-12-01 15:31:06 -08:00
Thad House
9280054eab Revert "[build] Export wpimath protobuf symbols (#5952)"
This reverts commit c80b2d2017.
2023-11-23 22:40:47 -08:00
Peter Johnson
c80b2d2017 [build] Export wpimath protobuf symbols (#5952) 2023-11-23 11:27:54 -08:00
Ryan Blue
80d7ad58ea [build] Declare platform launcher dependency explicitly (#5909) 2023-11-21 10:09:20 -08:00
Peter Johnson
cf54d9ccb7 [wpiutil, ntcore] Add structured data support (#5391)
This adds support for two serialization formats for complex data types:

- Protobuf for complex objects with variable length internals that need forward and backward wire compatibility (lower speed, more flexible)
- Raw struct (ByteBuffer-style) for fixed-length objects (higher speed, less flexible)

Deserialization can be done either by creating a new object (for immutable objects) or overwriting the contents of an existing object (for mutable objects).

Implementing classes should provide inner classes that implement the Protobuf or Struct interface (in Java) or specialize the wpi::Protobuf or wpi::Struct struct (in C++). It is possible for classes to implement both. If the class itself does not implement serialization, it's possible for third parties/users to provide an implementation instead.

Uses the Google protobuf implementation for C++ and the QuickBuffers alternative protobuf implementation for Java.
2023-10-19 21:41:47 -07:00
Ryan Blue
9b3f7fb548 [build] Exclude IntelliJ folders from spotless XML (#5602) 2023-09-05 08:59:12 -07:00
Ryan Blue
b3ef536677 [build] Ignore nt/sim json files in spotless (#5565) 2023-08-24 00:04:28 -07:00
Tyler Veness
96f7fa662e Upgrade Maven dependencies (#5553)
The following source code changes were required:

* Whitespace changes from spotless
* PMD warning suppressions for utility class tests
* PMD warning rename from "BeanMembersShouldSerialize" to
  "NonSerializableClass"
* Declared more class members as final
2023-08-18 19:18:33 -07:00
Thad House
b8cdf97621 [build] Prepare for Windows arm64 builds (#5390)
Builds aren't actually enabled yet due to a bug in Gradle.
2023-07-24 22:46:25 -07:00
Joseph Eng
daf022d3da [build] Make devImplementation inherit from implementation (#5450)
Remove manually adding dependencies to devImplementation.
Fix wpilibNewCommands devMain package.
2023-07-17 17:19:03 -07:00
sciencewhiz
34412ac57e [build] Exclude files in bin from Spotless (#5410)
Was causing failures in fieldImages.
2023-06-22 15:25:01 -07:00
Thad House
91392823ff [build] Update to gradle 8.1 (#5303) 2023-05-12 21:27:31 -07:00
Starlight220
bd6479dc29 [build] Add Spotless for JSON (#4956) 2023-01-16 08:26:46 -08:00
Thad House
aa221597bc [build] Add M1 builds, change arm name, update to 2023 deps (#4315) 2022-06-20 12:28:46 -06:00
Starlight220
f2d243fa68 [build] Change defaults for Java lints (#4300)
Removes the need to individually suppress the "serial" warning.
2022-06-06 17:06:43 -07:00
Tyler Veness
d651a1fcec Fix internal deprecation warnings (#4257)
This allows us to error out on deprecation warnings for thirdparty
libraries and standard library features.

Co-authored-by: Starlight220 <53231611+Starlight220@users.noreply.github.com>
2022-05-24 13:56:48 -07:00
Austin Shalit
f0c821282a [build] Use artifactory mirror (#4220) 2022-05-08 13:59:58 -07:00
Tyler Veness
355a11a414 Update Java linters and fix new PMD errors (#4157)
PMD requires that variables only initialized in the constructor be
final. The compiler errors if those final variables aren't guaranteed to
be initialized, so extra else branches were added to ensure that.

PMD also requires that classes with only private constructors be final.
The equivalent C++ classes were finalized as well, except for
TimeInterpolatableBuffer because it doesn't expose factory functions.
2022-04-24 07:18:05 -07:00
Tyler Veness
7269a170fb Upgrade maven deps to latest versions and fix new linter errors (#3772)
This also makes the Gradle build work with JDK 17.

The extra JVM args in gradle.properties works around a bug with spotless
and JDK 17: https://github.com/diffplug/spotless/issues/834

PMD.CloseResource was ignored because it's almost always a false
positive, and there are many of them.
2021-12-09 12:20:08 -08:00
Tyler Veness
95dd20a151 [build] Enable spotbugs (#3601)
Benign spotbugs warnings were suppressed, and all others were fixed. Bug
descriptions are documented here:
https://spotbugs.readthedocs.io/en/stable/bugDescriptions.html

Co-authored-by: Austin Shalit <austinshalit@gmail.com>
2021-09-24 16:04:02 -07:00
Thad House
179fde3a7b [build] Update to 2022 native utils and gradle 7 (#3588) 2021-09-19 17:59:14 -07:00
Tyler Veness
252b8c83bf Remove Java formatting from build task in CI (#3507)
This saves time in CI spent performing the same source-level checks in
every build job. Checkstyle, PMD, and Spotless are now run once in the
"Lint and Format" job.

The -PskipPMD flag was replaced with a -PskipJavaFormat flag that
disables Checkstyle, PMD, and Spotless.
2021-08-07 20:39:14 -07:00
Tyler Veness
3838cc4ec4 Use unicode characters in docs equations (#3487)
javac and javadoc needed the encoding set to UTF-8.
2021-07-29 22:42:43 -07:00
Austin Shalit
6e1919414e [build] Bring naming checkstyle rules up to date with Google Style guide (#1781)
Also update Checkstyle to 8.38.

Google changed their style guide from the last time we imported it. This PR brings in those naming changes. The change they made is allowing single letter member, parameter, and local variable names. They also added a lambda naming scheme and I thought it would be good to bring that in too.
2020-12-29 09:27:48 -08:00
Austin Shalit
1e17e40868 [build] Add a javaFormat Gradle task (#2805)
This task allows developers to run all of the Java code quality tools at once.
2020-10-24 20:18:19 -07:00
Thad House
708009cd20 Update to gradle 6.0 (#2074) 2019-11-12 17:14:04 -08:00
Thad House
9afea33403 Add support for aarch64 jetson bionic builds (#1844) 2019-08-26 09:49:58 -07:00
Thad House
b2861f8948 Use 2020 artifacts and artifactory server (#1838)
Uses 2020 artifacts and artifactory server, and new versioning and repository plugins.
2019-08-22 21:48:43 -07:00
Austin Shalit
e488861877 Move unit tests from integration test suite (#1170) 2019-07-16 00:02:52 -05:00
Austin Shalit
b6d5d90d9d Add JaCoCo Support (#1734) 2019-06-28 20:01:02 -07:00
Thad House
3dfb01d45b Update to new Native Utils (#1696)
Also update to azure 2019 windows image
2019-06-28 14:09:10 -07:00
Thad House
322ef9b967 Force Java 11, fix javadoc generation (#1695) 2019-05-19 16:59:44 -07:00
Thad House
0d7d880261 Renable full Java 8 Compatibility (#1493) 2018-12-21 00:25:23 -08:00