Implement support for Android target#250
Conversation
| androidTarget { | ||
| // Android target does not have any compilations | ||
| println("android compilations: ${compilations.size()}") | ||
| } |
There was a problem hiding this comment.
JFYI: when implementation project(":kotlinx-benchmark-runtime") is replaced with a dependency on actual artifact (for instance, published to a local maven repo), :compileReleaseKotlinAndroid fails due to unresolved kotlinx.benchnark symbols:
e: file:///Users/filipp.zhinkin/Development/kx-benchmark-android/examples/kotlin-multiplatform/src/androidMain/kotlin/AndroidTestBenchmark.kt:6:7 This class does not have a constructor
e: file:///Users/filipp.zhinkin/Development/kx-benchmark-android/examples/kotlin-multiplatform/src/androidMain/kotlin/AndroidTestBenchmark.kt:6:14 Unresolved reference: Benchmark
e: file:///Users/filipp.zhinkin/Development/kx-benchmark-android/examples/kotlin-multiplatform/src/androidMain/kotlin/AndroidTestBenchmark.kt:7:8 This class does not have a constructor
e: file:///Users/filipp.zhinkin/Development/kx-benchmark-android/examples/kotlin-multiplatform/src/androidMain/kotlin/AndroidTestBenchmark.kt:8:13 This class does not have a constructor
It does not make much sense to redefine a dependency for this sample project, but the same issue is also reproduced on kotlinx-io when I tried to apply kx-benchmark w/ android support.
|
|
||
| private fun detectAndroidDevice() { | ||
| println("Detect running Android devices...") | ||
| val devices = ProcessBuilder("adb", "devices") |
There was a problem hiding this comment.
adb may not be on a PATH.
In that case it makes sense to check sdk.dir property, ANDROID_HOME env variable, or , what seems to be a proper way, ask Android plugin for an ADB path.
|
|
||
| android { | ||
| namespace = "kotlinx.benchmark.android.microbenchmark" | ||
| compileSdk = 34 |
There was a problem hiding this comment.
When generating a project, compile SDK and runtime SDK versions as well as other properties, like defaultConfig and compileOptions, should be overridden by values inferred from a project the plugin was applied to.
| @@ -0,0 +1,2 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | |||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android"/> No newline at end of file | |||
There was a problem hiding this comment.
In future, it would be nice to provide a way to supply a user-defined config (it may be required to setup profiling, for example).
0583e41 to
6f9a271
Compare
a681cdc to
80ea397
Compare
OA# pick ccf3b6f Research android target support # Conflicts: # runtime/build.gradle.kts
To make it work in my laptop
c6a4227 to
934e250
Compare
|
Looks like it's better to reimplement it with the AndroidLibrary target from Android-KMP plugin |
No description provided.