Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ jobs:
# --no-scan: For public fork PRs, we won't attempt to publish the scan
run: |
./gradlew --build-cache --info $SCAN_ARG check releaseTarGz -x test
- name: rewriteDryRun
run: ./gradlew rewriteDryRun --build-cache -Dorg.gradle.jvmargs=-Xmx8G
# https://docs.openrewrite.org/reference/faq#im-getting-javalangoutofmemoryerror-java-heap-space-when-running-openrewrite
timeout-minutes: 90
- name: Archive check reports
if: always()
uses: actions/upload-artifact@v4
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,16 @@ The import order is a part of static check. please call `spotlessApply` to optim

./gradlew spotlessApply

#### Rewrite
The build system incorporates [Moderne](https://moderne.io/) rewrite capabilities for automated code transformations.

- **Convention** (e.g., JUnit's naming rules)
- **Refactor** safely (e.g., rename methods, migrate APIs)
- **Modernize** (e.g., Java 8 → Java 17 features)
- **Patterns** (e.g., replace `Vector` with `ArrayList`)

`./gradlew rewriteRun`

#### Spotbugs ####
Spotbugs uses static analysis to look for bugs in the code.
You can run spotbugs using:
Expand Down
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ plugins {
id 'org.scoverage' version '8.0.3' apply false
id 'com.gradleup.shadow' version '8.3.6' apply false
id 'com.diffplug.spotless' version "6.25.0"
id "org.openrewrite.rewrite" version "7.12.1"
}

apply from: "gradle/.qa/rewrite.gradle"

ext {
gradleVersion = versions.gradle
minClientJavaVersion = 11
Expand Down
28 changes: 28 additions & 0 deletions gradle/.qa/rewrite.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

rewrite {
//activeRecipe("org.openrewrite.java.RemoveUnusedImports")
exportDatatables = true
exclusions.add("**.GarbageCollectedMemoryPoolTest.java")
exclusions.add("**.MetadataVersionTest.java")
failOnDryRunResults = true
}

dependencies {
rewrite(platform("org.openrewrite.recipe:rewrite-recipe-bom:latest.release"))
}