Skip to content

Commit

Permalink
Exclude some transitive dependencies of OpenRewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
Col-E committed Nov 24, 2024
1 parent ea47421 commit 4950fd2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ logback-classic = { strictly = "1.4.11" } # newer releases break in jar releases
mapping-io = "0.6.1"
mockito = "5.14.2"
natural-order = "1.1"
openrewrite = "8.37.1"
openrewrite = "8.40.3"
picocli = "4.7.6"
procyon = "0.6.0"
reactfx = { strictly = "2.0-M5" } # won't get updates, dead
Expand Down
9 changes: 8 additions & 1 deletion recaf-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ dependencies {
api(libs.procyon)
api(libs.jackson)
api(libs.jlinker)
api(libs.openrewrite)
api(libs.openrewrite) {
exclude group: 'net.java.dev.jna'
exclude group: 'org.latencyutils'
exclude group: 'org.openrewrite', module: 'rewrite-yaml'
exclude group: 'org.openrewrite', module: 'rewrite-xml'
exclude group: 'org.xerial.snappy'
exclude group: 'org.yaml'
}
api(libs.regex)
api(libs.bundles.jasm)
api(libs.vineflower)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,17 @@ public J visit(@Nullable Tree tree, @Nonnull PrintOutputCapture<ExecutionContext
}

@Override
protected void visitModifier(@Nonnull J.Modifier modifier, PrintOutputCapture<ExecutionContext> p) {
public J visitModifier(@Nonnull J.Modifier modifier, PrintOutputCapture<ExecutionContext> p) {
PositionPrintOutputCapture prefix = new PositionPrintOutputCapture(ppoc);
spacePrinter.visitSpace(modifier.getPrefix(), Space.Location.ANY, prefix);

Range.Position startPosition = new Range.Position(prefix.posInBacking, prefix.line, prefix.column);
super.visitModifier(modifier, p);
J ret = super.visitModifier(modifier, p);
Range.Position endPosition = new Range.Position(ppoc.posInBacking, ppoc.line, ppoc.column);
Range range = new Range(randomId(), startPosition, endPosition);
rangeMap.put(range, modifier);
return ret;
}

};
printer.visit(tree, ppoc);

Expand Down

0 comments on commit 4950fd2

Please sign in to comment.