Skip to content

Commit

Permalink
Detect Kotlin Gradle DSL & populate .gitpod.yml (#18974)
Browse files Browse the repository at this point in the history
  • Loading branch information
Siddhant-K-code authored Nov 4, 2023
1 parent 428c599 commit 9135435
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
34 changes: 34 additions & 0 deletions components/server/src/config/config-inferrer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,40 @@ describe("config inferrer", () => {
},
},
)),
it("[kotlin] gradle", async () =>
expect(
{
"build.gradle.kts": "",
"pom.xml": "",
},
{
tasks: [
{
init: "gradle build",
},
],
vscode: {
extensions: ["fwcd.kotlin"],
},
},
)),
it("[kotlin] gradle wrapper", async () =>
expect(
{
"build.gradle.kts": "",
gradlew: "",
},
{
tasks: [
{
init: "./gradlew build",
},
],
vscode: {
extensions: ["fwcd.kotlin"],
},
},
)),
it("[python] pip install", async () =>
expect(
{
Expand Down
10 changes: 10 additions & 0 deletions components/server/src/config/config-inferrer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,16 @@ export class ConfigInferrer {
this.addExtension(ctx, "vscjava.vscode-java-debug");
return;
}
// Gradle Kotlin DSL
if (await ctx.exists("build.gradle.kts")) {
let cmd = "gradle";
if (await ctx.exists("gradlew")) {
cmd = "./gradlew";
}
this.addCommand(ctx.config, cmd + " build", "init");
this.addExtension(ctx, "fwcd.kotlin");
return;
}
if (await ctx.exists("pom.xml")) {
let cmd = "mvn";
if (await ctx.exists("mvnw")) {
Expand Down

0 comments on commit 9135435

Please sign in to comment.