Skip to content

Commit

Permalink
Fix 'provider has no value' error when running DGP integration tests …
Browse files Browse the repository at this point in the history
…without ANDROID_HOME (#3727)

Currently, if someone tries to run any Gradle Integration Test and they don't have ANDROID_HOME configured, then the Gradle build breaks because the SDK dir eagerly tries to fetch the value.

This change fixes this by only setting ANDROID_HOME in tests if possible. This allows running the integration tests, although the Android one will fail!
  • Loading branch information
adam-enko authored Aug 5, 2024
1 parent 879c277 commit 4670e4f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dokka-integration-tests/gradle/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ registerTestProjectSuite(
testTask.configure {
// Don't register ANDROID_HOME as a Task input, because the path is different on everyone's machine,
// which means Gradle will never be able to cache the task.
environment("ANDROID_HOME", dokkaBuild.androidSdkDir.get().invariantSeparatorsPath)
dokkaBuild.androidSdkDir.orNull?.let { androidSdkDir ->
environment("ANDROID_HOME", androidSdkDir)
}
}
}
}
Expand Down

0 comments on commit 4670e4f

Please sign in to comment.