Compile kotlinx_coroutines
Bug: 141779475
Test: m checkbuild
Change-Id: I9b30aa83f67398a3848f5874550dba3ac3bad714
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..7878b66
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,27 @@
+java_library {
+ name: "kotlinx_coroutines",
+ host_supported: true,
+ // This should be "core_current", but that causes nullability issues
+ // for returned platform types that are explicitly marked @Nullable in
+ // SDK 29 and current.
+ sdk_version: "28",
+ srcs: ["kotlinx-coroutines-core/jvm/src/**/*.kt"],
+ common_srcs: ["kotlinx-coroutines-core/common/src/**/*.kt"],
+ exclude_srcs: [
+ "kotlinx-coroutines-core/jvm/src/debug/**/*.kt",
+ "kotlinx-coroutines-core/jvm/src/test_/TestCoroutineContext.kt",
+ ],
+ static_libs: [
+ "kotlinx_atomicfu",
+ ],
+ kotlincflags: [
+ "-Xmulti-platform",
+ "-Xuse-experimental=kotlin.ExperimentalMultiplatform",
+ "-Xuse-experimental=kotlin.Experimental",
+ "-Xuse-experimental=kotlin.experimental.ExperimentalTypeInference",
+ "-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi",
+ "-Xuse-experimental=kotlinx.coroutines.FlowPreview",
+ "-Xuse-experimental=kotlinx.coroutines.ObsoleteCoroutinesApi",
+ "-Xuse-experimental=kotlinx.coroutines.InternalCoroutinesApi",
+ ],
+}