Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes required for using MacOS ARM agents instead of x86 #998

Merged
merged 5 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ fun SkikoProjectContext.createSkikoJvmJarTask(os: OS, arch: Arch, commonJar: Tas
val createChecksums2 = createChecksumsTask(os, altArch, nativeLib2)
nativeFiles.add(nativeLib2)
nativeFiles.add(createChecksums2.map { it.outputs.files.singleFile })
allJvmRuntimeJars[os to altArch] = skikoJvmRuntimeJarTask(os, altArch, commonJar, nativeFiles)
}
val skikoJvmRuntimeJar = skikoJvmRuntimeJarTask(os, arch, commonJar, nativeFiles)
allJvmRuntimeJars[os to arch] = skikoJvmRuntimeJar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@ fun String.withSuffix(isUikitSim: Boolean = false) =
fun KotlinTarget.isUikitSimulator() =
name.contains("Simulator", ignoreCase = true) || name == "tvosX64" // x64 tvOS is implicitly a simulator

fun Project.findXcodeSdkRoot(): String {
val defaultPath = "/Applications/Xcode.app/Contents/Developer/Platforms"
if (File(defaultPath).exists()) {
return defaultPath.also {
println("findXcodeSdkRoot = $it")
}
}

return (project.property("skiko.ci.xcodehome") as? String)?.let {
val sdkPath = it + "/Platforms"
println("findXcodeSdkRoot = $sdkPath")
sdkPath
} ?: error("gradle property `skiko.ci.xcodehome` is not set")
}

fun SkikoProjectContext.compileNativeBridgesTask(
os: OS, arch: Arch, isUikitSim: Boolean
): TaskProvider<CompileSkikoCppTask> = with (this.project) {
Expand All @@ -52,7 +67,7 @@ fun SkikoProjectContext.compileNativeBridgesTask(

when (os) {
OS.IOS -> {
val sdkRoot = "/Applications/Xcode.app/Contents/Developer/Platforms"
val sdkRoot = findXcodeSdkRoot()
val iphoneOsSdk = "$sdkRoot/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk"
val iphoneSimSdk = "$sdkRoot/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk"
val iosArchFlags = when (arch) {
Expand All @@ -76,7 +91,7 @@ fun SkikoProjectContext.compileNativeBridgesTask(
))
}
OS.TVOS -> {
val sdkRoot = "/Applications/Xcode.app/Contents/Developer/Platforms"
val sdkRoot = findXcodeSdkRoot()
val tvOsSdk = "$sdkRoot/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk"
val tvSimSdk = "$sdkRoot/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator.sdk"
val tvosArchFlags = when (arch) {
Expand Down
Loading