Skip to content

Commit ff74e02

Browse files
authored
Add better messaging for the configuration of the DART_HOME env variable in build.gradle.kts. (#49)
1 parent 7a0fbb7 commit ff74e02

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

third_party/build.gradle.kts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,13 @@ tasks {
118118
test {
119119
val dartSdkPath = System.getenv("DART_HOME")
120120
if (dartSdkPath != null) {
121-
jvmArgs("-Ddart.sdk=${dartSdkPath}")
121+
val versionFile = file("${dartSdkPath}/version")
122+
if (versionFile.exists() && versionFile.isFile()) {
123+
jvmArgs("-Ddart.sdk=${dartSdkPath}")
124+
} else {
125+
logger.error("This directory, ${dartSdkPath}, doesn't appear to be Dart SDK path, " +
126+
"no version file found at ${versionFile.absolutePath}")
127+
}
122128
} else {
123129
logger.error("DART_HOME environment variable is not set. Dart Analysis Server tests will fail.")
124130
}

0 commit comments

Comments
 (0)