[Gradle] Support configuration cache in Xcode/CocoaPods tasks with Gradle 8.1

This commit moves invocation of `xcodebuild` from configuration to execution time. This also fixes the problem with Xcode version being cached inside the daemon.

^KT-59252 Verification Pending
This commit is contained in:
Artem Daugel-Dauge
2023-06-11 21:00:20 +02:00
committed by Space Team
parent 78f4d399d4
commit b6847d0835
22 changed files with 316 additions and 211 deletions
@@ -143,16 +143,10 @@ class XcodeSimulatorExecutor(
private fun downloadRuntimeFor(osName: String) {
val version = Xcode.findCurrent().version
val versionSplit = version.split(".")
check(versionSplit.size >= 2) {
"Unrecognised version of Xcode $version was split to $versionSplit"
}
val major = versionSplit[0].toInt()
val minor = versionSplit[1].toInt()
check(major >= 14) {
check(version.major >= 14) {
"Was unable to get the required runtimes running on Xcode $version. Check the Xcode installation"
}
if (minor >= 1) {
if (version.minor >= 1) {
// Option -downloadPlatform NAME available only since 14.1
hostExecutor.run("/usr/bin/xcrun", "xcodebuild", "-downloadPlatform", osName)
} else {