Skip to content

Commit

Permalink
Auto-format files at build time
Browse files Browse the repository at this point in the history
  • Loading branch information
edreed committed Feb 19, 2024
1 parent ca49e8d commit f685d4a
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 24 deletions.
6 changes: 6 additions & 0 deletions .styleguide-license
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*
* Copyright (c) $YEAR Newport Robotics Group. All Rights Reserved.
*
* Open Source Software; you can modify and/or share it under the terms of
* the license file in the root directory of this project.
*/
24 changes: 24 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Copyright (c) 2024 Newport Robotics Group All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
* Neither the name of Newport Robotics Group, NRG, NRG948, FIRST, WPILib, nor
the names of other WPILib contributors may be used to endorse or promote
products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY NEWPORT ROBOTICS GROUP "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY NONINFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL FIRST, NEWPORT ROBOTICS GROUP OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 changes: 0 additions & 24 deletions WPILib-License.md

This file was deleted.

11 changes: 11 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,21 @@ buildscript {
plugins {
id "java"
id "edu.wpi.first.GradleRIO" version "2024.2.1"
id "com.diffplug.spotless" version "6.25.0"
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

spotless {
java {
googleJavaFormat()
licenseHeaderFile "./.styleguide-license"
}
}

def ROBOT_MAIN_CLASS = "frc.robot.Main"

repositories {
Expand Down Expand Up @@ -147,5 +155,8 @@ task generateReflectionsMetadata {
}
}

// Reformat Java files before compiing the robot code.
compileJava.dependsOn 'spotlessApply'

// Generate the NRG Common Library metadata when the robot code is built.
jar.dependsOn generateReflectionsMetadata

0 comments on commit f685d4a

Please sign in to comment.