blob: cb36cfec4cd19cb5a6a2116708e07447d0595ffd [file] [log] [blame]
Tiem Songee0da742024-01-03 14:08:46 -08001/**
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 Boyar1bd89fe2023-11-08 09:15:59 -08008import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
Rahul Ravikumard7d4fec2022-09-12 10:30:24 -07009import org.jetbrains.kotlin.gradle.plugin.mpp.BitcodeEmbeddingMode
10import org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFrameworkConfig
11
12plugins {
13 id("AndroidXPlugin")
Rahul Ravikumar9911e912022-09-23 11:17:21 -070014 id("androidx.benchmark.darwin")
Rahul Ravikumard7d4fec2022-09-12 10:30:24 -070015}
16
17androidXMultiplatform {
Rahul Ravikumar22f711b2022-10-26 13:30:42 -070018 // XCFrameworkConfig must always be called AndroidXDarwinBenchmarks
Rahul Ravikumarb5a8b402022-10-20 13:48:29 -070019 def xcf = new XCFrameworkConfig(project, "AndroidXDarwinBenchmarks")
Yigit Boyar1bd89fe2023-11-08 09:15:59 -080020 jvm() // add an empty compilation to prevent the warning for unused sourceSets.
Rahul Ravikumard7d4fec2022-09-12 10:30:24 -070021 ios {
22 binaries.framework {
Rahul Ravikumarb5a8b402022-10-20 13:48:29 -070023 // The module name must be AndroidXDarwinBenchmarks for the discovery to work.
24 baseName = "AndroidXDarwinBenchmarks"
Rahul Ravikumard7d4fec2022-09-12 10:30:24 -070025 // 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 Sladkeyd5f3dd32024-01-23 13:50:51 -050033 iosMain {
Aurimas Liutikas4690e592024-06-05 11:35:57 -070034 dependsOn(commonMain)
Fred Sladkeyd5f3dd32024-01-23 13:50:51 -050035 dependencies {
36 api(libs.kotlinStdlib)
37 api(project(":benchmark:benchmark-darwin"))
Yigit Boyar1bd89fe2023-11-08 09:15:59 -080038 }
Fred Sladkeyd5f3dd32024-01-23 13:50:51 -050039 }
40 iosArm64Main {
41 dependsOn(iosMain)
42 }
43 iosSimulatorArm64Main {
44 dependsOn(iosMain)
45 }
46 iosX64Main {
47 dependsOn(iosMain)
Rahul Ravikumard7d4fec2022-09-12 10:30:24 -070048 }
Yigit Boyar1bd89fe2023-11-08 09:15:59 -080049 }
50
51 targets.configureEach { target ->
52 if (target.platformType == KotlinPlatformType.native) {
53 target.compilations.configureEach {
54 compilerOptions.options.optIn.add("kotlinx.cinterop.ExperimentalForeignApi")
Rahul Ravikumard7d4fec2022-09-12 10:30:24 -070055 }
56 }
Rahul Ravikumard7d4fec2022-09-12 10:30:24 -070057 }
58}
59
Rahul Ravikumar9911e912022-09-23 11:17:21 -070060darwinBenchmark {
61 xcodeGenConfigFile = project.rootProject.file(
Rahul Ravikumarb5a8b402022-10-20 13:48:29 -070062 "benchmark/benchmark-darwin-xcode/projects/benchmark-darwin-samples-xcode.yml"
Rahul Ravikumar9911e912022-09-23 11:17:21 -070063 )
64 xcodeProjectName = "benchmark-darwin-samples-xcode"
65 scheme = "testapp-ios"
Rahul Ravikumar26673fb2023-11-03 11:16:38 -070066 // To run locally switch to iOS 17.0 simulators
67 destination = "platform=iOS Simulator,name=iPhone 13,OS=15.2"
Rahul Ravikumar5f8985c2023-01-24 15:43:14 -080068 referenceSha.set(androidx.getReferenceSha())
Rahul Ravikumar9911e912022-09-23 11:17:21 -070069}
70
Rahul Ravikumard7d4fec2022-09-12 10:30:24 -070071androidx {
Alan Viverettec9e1fd72023-05-08 17:36:59 -040072 name = "Benchmarks - Darwin Samples"
Rahul Ravikumard7d4fec2022-09-12 10:30:24 -070073 inceptionYear = "2022"
74 description = "AndroidX Benchmarks - Darwin Samples"
75}