Skip to content

Commit 1b76a80

Browse files
committed
Fixing build and execute command issue
1 parent b257fed commit 1b76a80

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqCodeTest/model/BuildAndExecuteStatusIcon.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ package software.aws.toolkits.jetbrains.services.amazonqCodeTest.model
66
import software.aws.toolkits.jetbrains.services.amazonqCodeTest.session.BuildAndExecuteProgressStatus
77

88
enum class BuildAndExecuteStatusIcon(val icon: String) {
9-
WAIT("<span>&#9744;</span>"),
10-
CURRENT("<span>&#9744;</span>"),
9+
WAIT("<span>&#9203;</span>"),
10+
CURRENT("<span>&#9203;</span>"),
1111
DONE("<span style=\"color: green;\">&#10004;</span>"),
1212
FAILED("<span style=\"color: red;\">&#10060;</span>"),
1313
}

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqCodeTest/utils/UTGChatUtil.kt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fun constructBuildAndExecutionSummaryText(currentStatus: BuildAndExecuteProgress
4848

4949
if (currentStatus >= BuildAndExecuteProgressStatus.FIXING_TEST_CASES || currentStatus == BuildAndExecuteProgressStatus.BUILD_FAILED) {
5050
val buildStatus = if (currentStatus == BuildAndExecuteProgressStatus.FIXING_TEST_CASES) "Fixing" else "Fixed"
51-
progressMessages.add("${getFixingTestCasesIcon(currentStatus)}: $buildStatus test failures")
51+
progressMessages.add("${getFixingTestCasesIcon(currentStatus)} $buildStatus test failures")
5252
}
5353

5454
if (currentStatus >= BuildAndExecuteProgressStatus.PROCESS_TEST_RESULTS) {
@@ -86,17 +86,23 @@ fun runBuildOrTestCommand(
8686

8787
// Find the nearest Gradle root directory
8888
var packageRoot: File? = testFileAbsolutePath.parentFile
89+
var foundGradleRoot = false
8990
while (packageRoot != null && packageRoot != projectRoot) {
9091
if (File(packageRoot, "settings.gradle.kts").exists() || File(packageRoot, "build.gradle.kts").exists() ||
9192
File(packageRoot, "settings.gradle").exists() || File(packageRoot, "build.gradle").exists()
9293
) {
93-
break // Stop when we find a valid Gradle project root
94+
foundGradleRoot = true
95+
break // Store the last valid Gradle root found
9496
}
9597
packageRoot = packageRoot.parentFile
9698
}
99+
var workingDir = if (foundGradleRoot) {
100+
packageRoot ?: testFileAbsolutePath.parentFile
101+
} else {
102+
testFileAbsolutePath.parentFile
103+
}
97104
// If no valid Gradle directory is found, fallback to the project root
98-
val gradleWrapper = File(packageRoot, "gradlew")
99-
val workingDir = if (gradleWrapper.exists()) packageRoot else projectRoot
105+
// val gradleWrapper = File(packageRoot ?: projectRoot, "gradlew")
100106
val console: ConsoleView = ConsoleViewImpl(project, true)
101107

102108
// Attach Console View to Build Tool Window

0 commit comments

Comments
 (0)