blob: 2ce2d6d3b9ed0c28230f268ae30a9e31136a5917 [file] [log] [blame]
/**
* 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 androidx.build.BuildOnServerKt
import androidx.build.KmpPlatformsKt
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")
}
def macEnabled = KmpPlatformsKt.enableMac(project)
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 {
if (macEnabled) {
iosMain {
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"
}