Tiem Song | ee0da74 | 2024-01-03 14:08:46 -0800 | [diff] [blame] | 1 | /** |
| 2 | * This file was created using the `create_project.py` script located in the |
| 3 | * `<AndroidX root>/development/project-creator` directory. |
| 4 | * |
| 5 | * Please use that script when creating a new project, rather than copying an existing project and |
| 6 | * modifying its settings. |
| 7 | */ |
Yigit Boyar | 1bd89fe | 2023-11-08 09:15:59 -0800 | [diff] [blame] | 8 | import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType |
Rahul Ravikumar | d7d4fec | 2022-09-12 10:30:24 -0700 | [diff] [blame] | 9 | import org.jetbrains.kotlin.gradle.plugin.mpp.BitcodeEmbeddingMode |
| 10 | import org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFrameworkConfig |
| 11 | |
| 12 | plugins { |
| 13 | id("AndroidXPlugin") |
Rahul Ravikumar | 9911e91 | 2022-09-23 11:17:21 -0700 | [diff] [blame] | 14 | id("androidx.benchmark.darwin") |
Rahul Ravikumar | d7d4fec | 2022-09-12 10:30:24 -0700 | [diff] [blame] | 15 | } |
| 16 | |
| 17 | androidXMultiplatform { |
Rahul Ravikumar | 22f711b | 2022-10-26 13:30:42 -0700 | [diff] [blame] | 18 | // XCFrameworkConfig must always be called AndroidXDarwinBenchmarks |
Rahul Ravikumar | b5a8b40 | 2022-10-20 13:48:29 -0700 | [diff] [blame] | 19 | def xcf = new XCFrameworkConfig(project, "AndroidXDarwinBenchmarks") |
Yigit Boyar | 1bd89fe | 2023-11-08 09:15:59 -0800 | [diff] [blame] | 20 | jvm() // add an empty compilation to prevent the warning for unused sourceSets. |
Rahul Ravikumar | d7d4fec | 2022-09-12 10:30:24 -0700 | [diff] [blame] | 21 | ios { |
| 22 | binaries.framework { |
Rahul Ravikumar | b5a8b40 | 2022-10-20 13:48:29 -0700 | [diff] [blame] | 23 | // The module name must be AndroidXDarwinBenchmarks for the discovery to work. |
| 24 | baseName = "AndroidXDarwinBenchmarks" |
Rahul Ravikumar | d7d4fec | 2022-09-12 10:30:24 -0700 | [diff] [blame] | 25 | // https://youtrack.jetbrains.com/issue/KT-48552 |
| 26 | embedBitcode = BitcodeEmbeddingMode.DISABLE |
| 27 | export(project(":benchmark:benchmark-darwin")) |
| 28 | xcf.add(it) |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | sourceSets { |
Fred Sladkey | d5f3dd3 | 2024-01-23 13:50:51 -0500 | [diff] [blame] | 33 | iosMain { |
Aurimas Liutikas | 4690e59 | 2024-06-05 11:35:57 -0700 | [diff] [blame] | 34 | dependsOn(commonMain) |
Fred Sladkey | d5f3dd3 | 2024-01-23 13:50:51 -0500 | [diff] [blame] | 35 | dependencies { |
| 36 | api(libs.kotlinStdlib) |
| 37 | api(project(":benchmark:benchmark-darwin")) |
Yigit Boyar | 1bd89fe | 2023-11-08 09:15:59 -0800 | [diff] [blame] | 38 | } |
Fred Sladkey | d5f3dd3 | 2024-01-23 13:50:51 -0500 | [diff] [blame] | 39 | } |
| 40 | iosArm64Main { |
| 41 | dependsOn(iosMain) |
| 42 | } |
| 43 | iosSimulatorArm64Main { |
| 44 | dependsOn(iosMain) |
| 45 | } |
| 46 | iosX64Main { |
| 47 | dependsOn(iosMain) |
Rahul Ravikumar | d7d4fec | 2022-09-12 10:30:24 -0700 | [diff] [blame] | 48 | } |
Yigit Boyar | 1bd89fe | 2023-11-08 09:15:59 -0800 | [diff] [blame] | 49 | } |
| 50 | |
| 51 | targets.configureEach { target -> |
| 52 | if (target.platformType == KotlinPlatformType.native) { |
| 53 | target.compilations.configureEach { |
| 54 | compilerOptions.options.optIn.add("kotlinx.cinterop.ExperimentalForeignApi") |
Rahul Ravikumar | d7d4fec | 2022-09-12 10:30:24 -0700 | [diff] [blame] | 55 | } |
| 56 | } |
Rahul Ravikumar | d7d4fec | 2022-09-12 10:30:24 -0700 | [diff] [blame] | 57 | } |
| 58 | } |
| 59 | |
Rahul Ravikumar | 9911e91 | 2022-09-23 11:17:21 -0700 | [diff] [blame] | 60 | darwinBenchmark { |
| 61 | xcodeGenConfigFile = project.rootProject.file( |
Rahul Ravikumar | b5a8b40 | 2022-10-20 13:48:29 -0700 | [diff] [blame] | 62 | "benchmark/benchmark-darwin-xcode/projects/benchmark-darwin-samples-xcode.yml" |
Rahul Ravikumar | 9911e91 | 2022-09-23 11:17:21 -0700 | [diff] [blame] | 63 | ) |
| 64 | xcodeProjectName = "benchmark-darwin-samples-xcode" |
| 65 | scheme = "testapp-ios" |
Rahul Ravikumar | 26673fb | 2023-11-03 11:16:38 -0700 | [diff] [blame] | 66 | // To run locally switch to iOS 17.0 simulators |
| 67 | destination = "platform=iOS Simulator,name=iPhone 13,OS=15.2" |
Rahul Ravikumar | 5f8985c | 2023-01-24 15:43:14 -0800 | [diff] [blame] | 68 | referenceSha.set(androidx.getReferenceSha()) |
Rahul Ravikumar | 9911e91 | 2022-09-23 11:17:21 -0700 | [diff] [blame] | 69 | } |
| 70 | |
Rahul Ravikumar | d7d4fec | 2022-09-12 10:30:24 -0700 | [diff] [blame] | 71 | androidx { |
Alan Viverette | c9e1fd7 | 2023-05-08 17:36:59 -0400 | [diff] [blame] | 72 | name = "Benchmarks - Darwin Samples" |
Rahul Ravikumar | d7d4fec | 2022-09-12 10:30:24 -0700 | [diff] [blame] | 73 | inceptionYear = "2022" |
| 74 | description = "AndroidX Benchmarks - Darwin Samples" |
| 75 | } |