|
24 | 24 | * |
25 | 25 | * <p>To instantiate a BuildConstantsPublisher, a build constants class, {@code BuildConstants}, is |
26 | 26 | * needs to be generated for the robot library by enabling the `gversion` plugin in the gradle build |
27 | | - * file. |
28 | | - * |
29 | | - * <pre>{@code |
30 | | - * plugins { |
31 | | - * ... |
32 | | - * // Plugin needed for Git Build Info |
33 | | - * // (see https://docs.wpilib.org/en/stable/docs/software/advanced-gradlerio/deploy-git-data.html) |
34 | | - * id 'com.peterabeles.gversion' version '1.10' |
35 | | - * ... |
36 | | - * } |
37 | | - * ... |
38 | | - * // Generates a BuildConstants file. |
39 | | - * // https://docs.wpilib.org/en/stable/docs/software/advanced-gradlerio/deploy-git-data.html |
40 | | - * project.compileJava.dependsOn(createVersionFile) |
41 | | - * def BUILD_CONSTANTS_AUTOGEN_PATH = 'build/generated/sources/build_constants/' |
42 | | - * gversion { |
43 | | - * // Build inside build/ (so that it will be ignored by git due to .gitignore) |
44 | | - * // and inside build/generated/ (so that it will be ignored by our Spotless |
45 | | - * // rules). |
46 | | - * srcDir = BUILD_CONSTANTS_AUTOGEN_PATH |
47 | | - * classPackage = 'com.team2813' |
48 | | - * className = 'BuildConstants' |
49 | | - * dateFormat = 'yyyy-MM-dd HH:mm:ss z' |
50 | | - * timeZone = 'America/Los_Angeles' // Use preferred time zone |
51 | | - * indent = ' ' |
52 | | - * } |
53 | | - * sourceSets.main.java.srcDirs += BUILD_CONSTANTS_AUTOGEN_PATH |
54 | | - * ... |
55 | | - * }</pre> |
| 27 | + * file. Instructions can be found <a |
| 28 | + * href="https://docs.wpilib.org/en/stable/docs/software/advanced-gradlerio/deploy-git-data.html">in |
| 29 | + * the WPILib documentation</a>. |
56 | 30 | * |
57 | 31 | * <p>With the BuildConstants generation enabled, the publisher is initialized and used like this: |
58 | 32 | * |
59 | 33 | * <pre>{@code |
60 | | - * BuildConstantsPublisher buildConstantsPublisher(com.team2813.BuildConstants.class); |
| 34 | + * BuildConstantsPublisher buildConstantsPublisher(frc.robot.BuildConstants.class); |
61 | 35 | * // Publish the build constants to "/Metadata" on the NetworkTables |
62 | 36 | * buildConstantsPublisher.publish(NetworkTableInstance.getDefault()); |
63 | 37 | * // Log the build constants in the robot console as well. |
|
0 commit comments