blob: 1c6e64cc78eb6ab2ef53202b48e56ecd51d7b3d7 [file] [log] [blame]
import androidx.build.KmpPlatformsKt
import androidx.build.PlatformIdentifier
import androidx.build.Publish
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")
}
def enableNative = KmpPlatformsKt.enableNative(project)
androidXMultiplatform {
def xcf = new XCFrameworkConfig(project, "AndroidXDarwinBenchmarks")
ios {
binaries.framework {
baseName = "AndroidXDarwinBenchmarks"
// https://youtrack.jetbrains.com/issue/KT-48552
embedBitcode = BitcodeEmbeddingMode.DISABLE
xcf.add(it)
}
}
// needed for snapshot publishing to trigger component creation
jvm()
// default platform is not JVM but we need to use it because it is
// the only platform built on all machines
defaultPlatform(PlatformIdentifier.JVM)
sourceSets {
// checking this avoids the warning about sourcesets that
// are created but not added to compilation
if (enableNative) {
darwinMain {
dependencies {
api(libs.kotlinStdlib)
}
}
darwinTest {
dependencies {
implementation(libs.kotlinTest)
implementation(libs.kotlinTestAnnotationsCommon)
}
}
iosMain {
dependsOn(darwinMain)
dependencies {
api(project(":benchmark:benchmark-darwin-core"))
}
}
iosArm64Main {
dependsOn(iosMain)
}
iosSimulatorArm64Main {
dependsOn(iosMain)
}
iosX64Main {
dependsOn(iosMain)
}
targets.all { target ->
if (target.platformType == KotlinPlatformType.native) {
target.compilations["main"].defaultSourceSet {
dependsOn(darwinMain)
}
target.compilations["test"].defaultSourceSet {
dependsOn(darwinTest)
}
}
}
}
}
}
androidx {
name = "Benchmarks - Darwin"
inceptionYear = "2022"
description = "AndroidX Benchmarks - Darwin"
publish = Publish.SNAPSHOT_ONLY
}