Skip to content

Commit

Permalink
Update library and styleguide version (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjreiniger authored Jul 8, 2024
1 parent 007cf9c commit d14c547
Show file tree
Hide file tree
Showing 41 changed files with 4,267 additions and 5,461 deletions.
6 changes: 4 additions & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
try-import %workspace%/user.bazelrc

build --java_language_version=17
#build --java_runtime_version=roboriojdk_11
build --java_runtime_version=roboriojdk_17
build --tool_java_language_version=11
build --tool_java_runtime_version=remotejdk_11

# build --javacopt=-Werror
# build --javacopt=-Xlint:all,-try,-serial
Expand All @@ -18,4 +20,4 @@ test --test_arg="--exclude-tag=ctre"
test --test_arg="--exclude-tag=flaky"


build --registry=https://raw.githubusercontent.com/pjreiniger/bazel-central-registry/bzlmodrio/
always --registry=https://raw.githubusercontent.com/pjreiniger/bazel-central-registry/bzlmodrio/
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.4.0
7.2.0
22 changes: 14 additions & 8 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ jobs:
fail-fast: false
matrix:
include:
- { os: windows-latest, architecture: x64, config: "" }
- { os: windows-latest, architecture: x64, config: "--enable_bzlmod" }
- { os: macos-latest, architecture: x64, config: "" }
- { os: macos-latest, architecture: x64, config: "--enable_bzlmod" }
- { os: ubuntu-latest, architecture: x64, config: "" }
- { os: ubuntu-latest, architecture: x64, config: "--enable_bzlmod" }
- { os: windows-latest, architecture: x64, config: "--noenable_bzlmod" }
- { os: windows-latest, architecture: x64, config: "--enable_bzlmod" }
- { os: macos-latest, architecture: x64, config: "--noenable_bzlmod" }
- { os: macos-latest, architecture: x64, config: "--enable_bzlmod" }
- { os: ubuntu-latest, architecture: x64, config: "--noenable_bzlmod" }
- { os: ubuntu-latest, architecture: x64, config: "--enable_bzlmod" }
name: "Build - ${{ matrix.os }} ${{ matrix.architecture }} ${{ matrix.config }}"
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -22,6 +22,12 @@ jobs:
fetch-depth: 0
- uses: bazelbuild/setup-bazelisk@v3

- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
architecture: x64

# Unix systems sometimes fail to create the symlink the first time around
- name: Build (Allow failure)
run: bazel build ... --nojava_header_compilation -k ${{ matrix.config }} || true
Expand All @@ -36,7 +42,7 @@ jobs:
fail-fast: false
matrix:
include:
- { os: ubuntu-latest, architecture: x64, config: "--config=for-roborio" }
- { os: ubuntu-latest, architecture: x64, config: "--config=for-roborio --noenable_bzlmod" }
- { os: ubuntu-latest, architecture: x64, config: "--config=for-roborio --enable_bzlmod" }
name: "Build - ${{ matrix.os }} ${{ matrix.architecture }} ${{ matrix.config }}"
runs-on: ${{ matrix.os }}
Expand All @@ -57,7 +63,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: bazelbuild/setup-bazelisk@v3
- run: bazel run @unpinned_maven//:pin
- run: bazel run @unpinned_maven//:pin --noenable_bzlmod
- run: git diff HEAD
- uses: actions/upload-artifact@v4
with:
Expand Down
87 changes: 76 additions & 11 deletions .github/workflows/lint_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,40 +29,105 @@ jobs:
sudo apt-get install -y clang-format-14
- name: Install wpiformat
run: pip3 install wpiformat

- name: Run wpiformat
run: wpiformat -clang 14

# Check the diff
- name: Check Output
run: git --no-pager diff --exit-code HEAD
- name: Generate diff
run: git diff HEAD > wpiformat-fixes.patch
if: ${{ failure() }}
- uses: actions/upload-artifact@v4
with:
name: wpiformat fixes
path: wpiformat-fixes.patch
if: ${{ failure() }}

buildifier:
name: "buildifier"
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v4

- name: Set up Go 1.15.x
uses: actions/setup-go@v5
with:
go-version: 1.15.x
id: go

- name: Install Buildifier
run: |
cd $(mktemp -d)
GO111MODULE=on go get github.com/bazelbuild/buildtools/[email protected]
- name: Run buildifier
run: buildifier --lint=fix -r .

# Check the diff
- name: Check Output
run: git --no-pager diff --exit-code HEAD
- name: Generate diff
run: git diff HEAD > buildifier-fixes.patch
if: ${{ failure() }}
- uses: actions/upload-artifact@v4
with:
name: buildifier fixes
path: buildifier-fixes.patch
if: ${{ failure() }}

spotless:
name: "spotless"
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v4

# Run formatters
- name: Run Spotless
run: ./gradlew spotlessApply

# Check the diff
- name: Check Output
run: git --no-pager diff --exit-code HEAD
- name: Generate diff
run: git diff HEAD > spotless-fixes.patch
if: ${{ failure() }}
- uses: actions/upload-artifact@v4
with:
name: spotless fixes
path: spotless-fixes.patch
if: ${{ failure() }}

unused_deps:
name: "unused deps"
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v4

- name: Set up Go 1.15.x
uses: actions/setup-go@v5
with:
go-version: 1.15.x
id: go
- name: Install Unused Deps
run: |
cd $(mktemp -d)
GO111MODULE=on go get github.com/bazelbuild/buildtools/[email protected]
# Run formatters
- name: Run wpiformat
run: wpiformat -clang 14
- name: Run buildifier
run: buildifier --lint=fix -r .
- name: Run Spotless
run: ./gradlew spotlessApply
- name: Run unused deps
run: unused_deps //...

# Check the diff
- name: Check Output
run: git --no-pager diff --exit-code HEAD
- name: Generate diff
run: git diff HEAD > wpiformat-fixes.patch
run: git diff HEAD > unused-deps-fixes.patch
if: ${{ failure() }}
- uses: actions/upload-artifact@v4
with:
name: wpiformat fixes
path: wpiformat-fixes.patch
name: unused deps fixes
path: unused-deps-fixes.patch
if: ${{ failure() }}
2 changes: 2 additions & 0 deletions .styleguide
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ includeGuardRoots {

generatedFileExclude {
examples/project_files/standard/gradlew
BUILD.bazel
BUILD
}

# Used by unit tests
Expand Down
20 changes: 7 additions & 13 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
bazel_dep(name = "rules_jvm_external", version = "5.3")
bazel_dep(name = "rules_java", version = "6.4.0")
bazel_dep(name = "rules_jvm_external", version = "6.1")
bazel_dep(name = "rules_java", version = "7.6.1")
bazel_dep(name = "rules_bazelrio", version = "0.0.14")
bazel_dep(name = "rules_bzlmodrio_toolchains", version = "2024-1")
bazel_dep(name = "rules_pmd", version = "6.43.0")
bazel_dep(name = "bzlmodrio-allwpilib", version = "2024.1.1")
bazel_dep(name = "rules_bzlmodrio_jdk", version = "17.0.8.1-1")
bazel_dep(name = "rules_pmd", version = "7.2.0")
bazel_dep(name = "bzlmodrio-allwpilib", version = "2024.3.2")
bazel_dep(name = "bzlmodrio-navx", version = "2024.1.0")
bazel_dep(name = "bzlmodrio-phoenix", version = "5.32.0-beta-5")
bazel_dep(name = "bzlmodrio-phoenix", version = "5.33.1")
bazel_dep(name = "bzlmodrio-phoenix6", version = "24.0.0-beta-8")
bazel_dep(name = "bzlmodrio-revlib", version = "2024.2.0")
bazel_dep(name = "bzlmodrio-revlib", version = "2024.2.4")

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
Expand All @@ -27,10 +28,3 @@ use_repo(
maven,
"maven",
)

archive_override(
module_name = "rules_pmd",
integrity = "sha256-bVoEKdAOBoieMDQqVqErrfVvVW/G69WmuUuqLoWGdNc=",
strip_prefix = "bazel_rules_pmd-d2179affb58aa221fa345525ad128339d3e69a71",
urls = "https://github.com/bzlmodRio/bazel_rules_pmd/archive/d2179affb58aa221fa345525ad128339d3e69a71.tar.gz",
)
Loading

0 comments on commit d14c547

Please sign in to comment.