Skip to content
Merged
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
5 changes: 5 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ dependencies {
compileOnly("org.openrewrite:rewrite-java:latest.release")
implementation("org.jspecify:jspecify:latest.release")

// Needed for Error Prone annotations like @BeforeTemplate
testImplementation("com.google.errorprone:error_prone_core:latest.release") {
exclude("com.google.auto.service", "auto-service-annotations")
}

// Needed for annotation processing tests
testImplementation(files(tools))
testImplementation("org.openrewrite:rewrite-java:latest.integration")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private void addJarNameFor(Symbol owner) {
if (matcher.find()) {
String jarName = matcher.group(1);
// Ignore when `@Matches` on arguments tries to add rewrite-templating, which is implied present
if (jarName.startsWith("rewrite-templating")) {
if (jarName.startsWith("rewrite-templating") || jarName.startsWith("error_prone_core")) {
return;
}
jarNames.add(jarName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ private void collectRecipes(JCTree.JCClassDecl classDecl, RuleDescriptor descrip
for (Set<String> imports : imports.values()) {
imports.removeIf(i -> {
int endIndex = i.lastIndexOf('.');
return endIndex < 0 || "java.lang".equals(i.substring(0, endIndex)) || "com.google.errorprone.refaster".equals(i.substring(0, endIndex));
return endIndex < 0 || "java.lang".equals(i.substring(0, endIndex)) || i.startsWith("com.google.errorprone.refaster");
});
}
for (Set<String> imports : staticImports.values()) {
Expand Down
22 changes: 0 additions & 22 deletions src/test/java/com/google/errorprone/refaster/ImportPolicy.java

This file was deleted.

23 changes: 0 additions & 23 deletions src/test/java/com/google/errorprone/refaster/Refaster.java

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ static Compilation compile(JavaFileObject javaFileObject, TypeAwareProcessor pro
return javac()
.withProcessors(processor)
.withClasspath(Arrays.asList(
fileForClass(BeforeTemplate.class),
fileForClass(AfterTemplate.class),
fileForClass(com.google.errorprone.refaster.annotation.AfterTemplate.class),
fileForClass(org.openrewrite.java.template.MethodInvocationMatcher.class),
fileForClass(com.google.common.collect.ImmutableMap.class),
fileForClass(org.assertj.core.api.Assertions.class),
fileForClass(org.junit.jupiter.api.Assertions.class),
Expand Down