From 670ffdd32c5869fed3fd8c6d6d9787de84104965 Mon Sep 17 00:00:00 2001 From: Edward Gao Date: Tue, 16 Jan 2024 06:04:29 -0800 Subject: [PATCH] fix java cdk utility tasks (#34174) these tasks were only checking within the cdk directory, so they didn't actually accomplish anything. Fix them to walk the entire tree. ... afaict we don't actually use these tasks for anything, but might as well make them work? --- buildSrc/src/main/groovy/airbyte-java-cdk.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/groovy/airbyte-java-cdk.gradle b/buildSrc/src/main/groovy/airbyte-java-cdk.gradle index c97594543b0b8..68f1c95fdeb65 100644 --- a/buildSrc/src/main/groovy/airbyte-java-cdk.gradle +++ b/buildSrc/src/main/groovy/airbyte-java-cdk.gradle @@ -32,7 +32,7 @@ class AirbyteJavaCdkPlugin implements Plugin { @TaskAction public void disableLocalCdkRefs() { // Step through the project tree and set useLocalCdk to false on all connectors - getProject().fileTree(dir: '.', include: '**/build.gradle').forEach(file -> { + getProject().rootProject.fileTree(dir: '.', include: '**/build.gradle').forEach(file -> { String content = file.getText() if (content.contains("useLocalCdk = true")) { content = content.replace("useLocalCdk = true", "useLocalCdk = false") @@ -48,7 +48,7 @@ class AirbyteJavaCdkPlugin implements Plugin { public void assertNotUsingLocalCdk() { List foundPaths = new ArrayList<>() - for (File file : getProject().fileTree(dir: '.', include: '**/build.gradle')) { + for (File file : getProject().rootProject.fileTree(dir: '.', include: '**/build.gradle')) { String content = file.getText() if (content.contains("useLocalCdk = true")) { System.err.println("Found usage of 'useLocalCdk = true' in " + file.getPath())