Skip to content

Commit

Permalink
fix: support kotlin build scripts for gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonleblanc-rl committed Nov 2, 2024
1 parent fe2a712 commit d1c6541
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/@cdktf/commons/src/gradle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { logger } from "./logging";
import { exec } from "./util";

export function isGradleProject(workingDirectory: string): boolean {
const buildGradlePath = path.join(workingDirectory, "build.gradle");
const buildGradlePath = path.join(workingDirectory, "build.gradle" || "build.gradle.kts");

try {
fs.accessSync(buildGradlePath, fs.constants.R_OK | fs.constants.W_OK);
Expand Down Expand Up @@ -151,7 +151,7 @@ export async function getGradlePackageVersion(packageName: string) {
}

export async function getGradlePackageVersionFromBuild(packageName: string) {
const buildGradlePath = path.join(process.cwd(), "build.gradle");
const buildGradlePath = path.join(process.cwd(), "build.gradle" || "build.gradle.kts");
const buildGradleContents = await fs.readFile(buildGradlePath, "utf-8");
const buildLines = buildGradleContents.split(/\r\n|\r|\n/);

Expand Down

0 comments on commit d1c6541

Please sign in to comment.