File tree Expand file tree Collapse file tree 5 files changed +18
-5
lines changed
src/main/java/org/wpilib/math/kinematics Expand file tree Collapse file tree 5 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -287,6 +287,10 @@ set(WPIUNITS_DEP_REPLACE_IMPL "find_dependency(wpiunits)")
287287set (WPIANNOTATIONS_DEP_REPLACE_IMPL "find_dependency(wpiannotations)" )
288288set (WPIUTIL_DEP_REPLACE "find_dependency(wpiutil)" )
289289set (DATALOG_DEP_REPLACE "find_dependency(datalog)" )
290+ if (WITH_JAVA)
291+ add_subdirectory (wpiannotations )
292+ endif ()
293+
290294add_subdirectory (wpiutil )
291295
292296add_subdirectory (datalog )
@@ -307,10 +311,6 @@ if(WITH_WPIMATH)
307311 add_subdirectory (wpimath )
308312endif ()
309313
310- if (WITH_JAVA)
311- add_subdirectory (wpiannotations )
312- endif ()
313-
314314if (WITH_WPIUNITS AND NOT WITH_WPIMATH)
315315 # In case of building wpiunits standalone
316316 set (WPIUNITS_DEP_REPLACE ${WPIUNITS_DEP_REPLACE_IMPL} )
Original file line number Diff line number Diff line change @@ -236,13 +236,15 @@ wpilib_cc_shared_library(
236236wpilib_jni_java_library (
237237 name = "wpimath-java" ,
238238 srcs = [":generated_java" ] + glob (["src/main/java/**/*.java" ]),
239+ exported_plugins = ["//javacPlugin:plugin" ],
239240 maven_artifact_name = "wpimath-java" ,
240241 maven_group_id = "org.wpilib.wpimath" ,
241242 native_libs = [":wpimathjni" ],
242243 resource_strip_prefix = "wpimath/src/main/proto" ,
243244 resources = glob (["src/main/proto/**" ]),
244245 visibility = ["//visibility:public" ],
245246 deps = [
247+ "//wpiannotations" ,
246248 "//wpiunits:wpiunits-java" ,
247249 "//wpiutil:wpiutil-java" ,
248250 "@maven//:com_fasterxml_jackson_core_jackson_annotations" ,
Original file line number Diff line number Diff line change @@ -70,7 +70,13 @@ if(WITH_JAVA)
7070 add_jar (
7171 wpimath_jar
7272 ${JAVA_SOURCES}
73- INCLUDE_JARS wpiutil_jar wpiunits_jar ${EJML_JARS} ${JACKSON_JARS} ${QUICKBUF_JAR}
73+ INCLUDE_JARS
74+ wpiutil_jar
75+ wpiunits_jar
76+ wpiannotations_jar
77+ ${EJML_JARS}
78+ ${JACKSON_JARS}
79+ ${QUICKBUF_JAR}
7480 OUTPUT_NAME wpimath
7581 OUTPUT_DIR ${WPILIB_BINARY_DIR} /${java_lib_dest}
7682 GENERATE_NATIVE_HEADERS wpimath_jni_headers
Original file line number Diff line number Diff line change @@ -92,6 +92,9 @@ dependencies {
9292 api libs. bundles. ejml
9393 api libs. bundles. jackson
9494 api libs. quickbuf. runtime
95+ implementation project(" :wpiannotations" )
96+ annotationProcessor project(' :javacPlugin' )
97+ testAnnotationProcessor project(' :javacPlugin' )
9598}
9699
97100sourceSets. main. java. srcDir " ${ projectDir} /src/generated/main/java"
Original file line number Diff line number Diff line change 77import static org .wpilib .units .Units .MetersPerSecond ;
88
99import java .util .Objects ;
10+ import org .wpilib .annotation .NoDiscard ;
1011import org .wpilib .math .geometry .Rotation2d ;
1112import org .wpilib .math .interpolation .Interpolatable ;
1213import org .wpilib .math .kinematics .proto .SwerveModuleVelocityProto ;
1617import org .wpilib .util .struct .StructSerializable ;
1718
1819/** Represents the velocity of one swerve module. */
20+ @ NoDiscard
1921public class SwerveModuleVelocity
2022 implements Interpolatable <SwerveModuleVelocity >,
2123 Comparable <SwerveModuleVelocity >,
You can’t perform that action at this time.
0 commit comments