Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert: Add a new WORKING_DIRECTORY message to ExecutionContext (#3776) #3796

Merged
merged 1 commit into from
Dec 8, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
public interface ExecutionContext {
String CURRENT_CYCLE = "org.openrewrite.currentCycle";
String CURRENT_RECIPE = "org.openrewrite.currentRecipe";
String WORKING_DIRECTORY = "org.openrewrite.workingDirectory";
String DATA_TABLES = "org.openrewrite.dataTables";
String RUN_TIMEOUT = "org.openrewrite.runTimeout";
String REQUIRE_PRINT_EQUALS_INPUT = "org.openrewrite.requirePrintEqualsInput";
Expand Down

This file was deleted.

15 changes: 6 additions & 9 deletions rewrite-test/src/main/java/org/openrewrite/test/RewriteTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -341,15 +341,12 @@ default void rewriteRun(Consumer<RecipeSpec> spec, SourceSpec<?>... sourceSpecs)
lss = new LargeSourceSetCheckingExpectedCycles(expectedCyclesThatMakeChanges, runnableSourceFiles);
}

RecipeRun recipeRun;
try (WorkingDirectoryExecutionContextView ctx = WorkingDirectoryExecutionContextView.createNew(recipeExecutionContext)) {
recipeRun = recipe.run(
lss,
ctx,
cycles,
expectedCyclesThatMakeChanges + 1
);
}
RecipeRun recipeRun = recipe.run(
lss,
recipeExecutionContext,
cycles,
expectedCyclesThatMakeChanges + 1
);

for (Consumer<RecipeRun> afterRecipe : testClassSpec.afterRecipes) {
afterRecipe.accept(recipeRun);
Expand Down