Skip to content

Commit

Permalink
fix java cdk utility tasks (airbytehq#34174)
Browse files Browse the repository at this point in the history
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?
  • Loading branch information
edgao authored Jan 16, 2024
1 parent 31db9f8 commit 670ffdd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions buildSrc/src/main/groovy/airbyte-java-cdk.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class AirbyteJavaCdkPlugin implements Plugin<Project> {
@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")
Expand All @@ -48,7 +48,7 @@ class AirbyteJavaCdkPlugin implements Plugin<Project> {
public void assertNotUsingLocalCdk() {
List<String> 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())
Expand Down

0 comments on commit 670ffdd

Please sign in to comment.