-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement support for Android target #250
base: master
Are you sure you want to change the base?
Conversation
androidTarget { | ||
// Android target does not have any compilations | ||
println("android compilations: ${compilations.size()}") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
No description provided.