| /** |
| * This file was created using the `create_project.py` script located in the |
| * `<AndroidX root>/development/project-creator` directory. |
| * |
| * Please use that script when creating a new project, rather than copying an existing project and |
| * modifying its settings. |
| */ |
| import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType |
| import org.jetbrains.kotlin.gradle.plugin.mpp.BitcodeEmbeddingMode |
| import org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFrameworkConfig |
| |
| plugins { |
| id("AndroidXPlugin") |
| id("androidx.benchmark.darwin") |
| } |
| |
| androidXMultiplatform { |
| // XCFrameworkConfig must always be called AndroidXDarwinBenchmarks |
| def xcf = new XCFrameworkConfig(project, "AndroidXDarwinBenchmarks") |
| jvm() // add an empty compilation to prevent the warning for unused sourceSets. |
| ios { |
| binaries.framework { |
| // The module name must be AndroidXDarwinBenchmarks for the discovery to work. |
| baseName = "AndroidXDarwinBenchmarks" |
| // https://youtrack.jetbrains.com/issue/KT-48552 |
| embedBitcode = BitcodeEmbeddingMode.DISABLE |
| export(project(":benchmark:benchmark-darwin")) |
| xcf.add(it) |
| } |
| } |
| |
| sourceSets { |
| iosMain { |
| dependsOn(commonMain) |
| dependencies { |
| api(libs.kotlinStdlib) |
| api(project(":benchmark:benchmark-darwin")) |
| } |
| } |
| iosArm64Main { |
| dependsOn(iosMain) |
| } |
| iosSimulatorArm64Main { |
| dependsOn(iosMain) |
| } |
| iosX64Main { |
| dependsOn(iosMain) |
| } |
| } |
| |
| targets.configureEach { target -> |
| if (target.platformType == KotlinPlatformType.native) { |
| target.compilations.configureEach { |
| compilerOptions.options.optIn.add("kotlinx.cinterop.ExperimentalForeignApi") |
| } |
| } |
| } |
| } |
| |
| darwinBenchmark { |
| xcodeGenConfigFile = project.rootProject.file( |
| "benchmark/benchmark-darwin-xcode/projects/benchmark-darwin-samples-xcode.yml" |
| ) |
| xcodeProjectName = "benchmark-darwin-samples-xcode" |
| scheme = "testapp-ios" |
| // To run locally switch to iOS 17.0 simulators |
| destination = "platform=iOS Simulator,name=iPhone 13,OS=15.2" |
| referenceSha.set(androidx.getReferenceSha()) |
| } |
| |
| androidx { |
| name = "Benchmarks - Darwin Samples" |
| inceptionYear = "2022" |
| description = "AndroidX Benchmarks - Darwin Samples" |
| } |