1package { 2 default_applicable_licenses: ["external_kotlinx.coroutines_license"], 3 default_visibility: ["//visibility:private"], 4} 5 6// Added automatically by a large-scale-change that took the approach of 7// 'apply every license found to every target'. While this makes sure we respect 8// every license restriction, it may not be entirely correct. 9// 10// e.g. GPL in an MIT project might only apply to the contrib/ directory. 11// 12// Please consider splitting the single license below into multiple licenses, 13// taking care not to lose any license_kind information, and overriding the 14// default license using the 'licenses: [...]' property on targets as needed. 15// 16// For unused files, consider creating a 'fileGroup' with "//visibility:private" 17// to attach the license to, and including a comment whether the files may be 18// used in the current project. 19// 20// large-scale-change included anything that looked like it might be a license 21// text as a license_text. e.g. LICENSE, NOTICE, COPYING etc. 22// 23// Please consider removing redundant or irrelevant files from 'license_text:'. 24// See: http://go/android-license-faq 25license { 26 name: "external_kotlinx.coroutines_license", 27 visibility: [":__subpackages__"], 28 license_kinds: [ 29 "SPDX-license-identifier-Apache-2.0", 30 "SPDX-license-identifier-MIT", 31 ], 32 license_text: [ 33 "LICENSE", 34 "LICENSE.txt", 35 "license/**/*", 36 ], 37} 38 39// Upstream compiles this lib against the JVM bootclasspath; compiling against the Android 40// bootclasspath will fail. Work around this by defining this as a java_library_host, and use 41// java_host_for_device to expose it to Android targets. 42java_library_host { 43 name: "kotlinx_coroutines-host", 44 srcs: ["kotlinx-coroutines-core/jvm/src/**/*.kt"], 45 common_srcs: [ 46 "kotlinx-coroutines-core/common/src/**/*.kt", 47 "kotlinx-coroutines-core/concurrent/src/**/*.kt", 48 ], 49 exclude_common_srcs: [ 50 // TODO: go/kotlinx.coroutines/issues/4163 - This file should be deleted 51 "kotlinx-coroutines-core/common/src/internal/LockFreeLinkedList.common.kt", 52 "kotlinx-coroutines-core/jvm/src/test_/TestCoroutineContext.kt", 53 ], 54 java_resource_dirs: ["kotlinx-coroutines-core/jvm/resources"], 55 // See https://github.com/Kotlin/kotlinx.coroutines#avoiding-including-the-debug-infrastructure-in-the-resulting-apk 56 // This file contains `kotlin.coroutines.jvm.internal.DebugProbesKt` class and is only used 57 // by the debugger. 58 // This cause issues when generating coverage as Jacoco will fail with 59 // `Caused by: java.lang.IllegalStateException: Can't add different class with same name: kotlin/coroutines/jvm/internal/DebugProbesKt` 60 // See b/291743544 for more details 61 exclude_java_resources: ["kotlinx-coroutines-core/jvm/resources/DebugProbesKt.bin"], 62 static_libs: [ 63 "kotlinx_atomicfu", 64 ], 65 libs: [ 66 "annotations", // for android.annotation.SuppressLint 67 "kotlinx-coroutines-android-annotation-stubs", 68 ], 69 kotlincflags: [ 70 "-Xmulti-platform", 71 "-Xexpect-actual-classes", 72 "-opt-in=kotlin.RequiresOptIn", 73 "-opt-in=kotlin.experimental.ExperimentalTypeInference", 74 "-opt-in=kotlin.ExperimentalMultiplatform", 75 "-opt-in=kotlinx.coroutines.DelicateCoroutinesApi", 76 "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", 77 "-opt-in=kotlinx.coroutines.ObsoleteCoroutinesApi", 78 "-opt-in=kotlinx.coroutines.InternalCoroutinesApi", 79 "-opt-in=kotlinx.coroutines.FlowPreview", 80 ], 81 apex_available: [ 82 "//apex_available:platform", 83 "//apex_available:anyapex", 84 ], 85 kotlin_lang_version: "2", 86} 87 88// Expose the host library to Android targets. This is generally an unsafe operation; in using 89// this, we are asserting that any host-only code will never be evaluated at runtime on Android. 90// If we're wrong, we will see runtime exceptions. 91java_host_for_device { 92 name: "kotlinx_coroutines-device", 93 libs: ["kotlinx_coroutines-host"], 94} 95 96// Combine host and Android libs back into a single target. 97java_library { 98 name: "kotlinx_coroutines", 99 host_supported: true, 100 sdk_version: "core_current", 101 min_sdk_version: "28", 102 target: { 103 host: { 104 static_libs: ["kotlinx_coroutines-host"], 105 }, 106 android: { 107 static_libs: ["kotlinx_coroutines-device"], 108 }, 109 }, 110 apex_available: [ 111 "//apex_available:platform", 112 "//apex_available:anyapex", 113 ], 114 visibility: ["//visibility:public"], 115} 116 117java_library { 118 name: "kotlinx_coroutines_android", 119 sdk_version: "current", 120 min_sdk_version: "28", 121 srcs: ["ui/kotlinx-coroutines-android/src/**/*.kt"], 122 java_resource_dirs: ["ui/kotlinx-coroutines-android/resources"], 123 kotlincflags: [ 124 "-opt-in=kotlinx.coroutines.InternalCoroutinesApi", 125 "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", 126 ], 127 static_libs: [ 128 "kotlinx_coroutines", 129 ], 130 libs: [ 131 "androidx.annotation_annotation", 132 ], 133 apex_available: [ 134 "//apex_available:platform", 135 "//apex_available:anyapex", 136 ], 137 visibility: ["//visibility:public"], 138} 139 140java_library { 141 name: "kotlinx_coroutines_test", 142 host_supported: true, 143 sdk_version: "core_current", 144 srcs: ["kotlinx-coroutines-test/jvm/src/**/*.kt"], 145 common_srcs: ["kotlinx-coroutines-test/common/src/**/*.kt"], 146 java_resource_dirs: ["kotlinx-coroutines-test/jvm/resources"], 147 kotlincflags: [ 148 "-Xmulti-platform", 149 "-opt-in=kotlin.ExperimentalMultiplatform", 150 "-opt-in=kotlinx.coroutines.InternalCoroutinesApi", 151 "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", 152 ], 153 libs: ["kotlinx_coroutines"], 154 apex_available: [ 155 "//apex_available:platform", 156 "//apex_available:anyapex", 157 ], 158 visibility: ["//visibility:public"], 159} 160 161// Compile stub implementations of annotations used by kotlinx-coroutines but not present in the 162// Android tree. 163java_library { 164 name: "kotlinx-coroutines-android-annotation-stubs", 165 host_supported: true, 166 sdk_version: "core_current", 167 srcs: ["android-annotation-stubs/src/**/*.java"], 168} 169 170// Temporary aliases for kotlinx-coroutines-core, kotlinx-coroutines-core-jvm and 171// kotlinx-coroutines-android 172 173java_library { 174 name: "kotlinx-coroutines-core", 175 host_supported: true, 176 sdk_version: "core_current", 177 min_sdk_version: "28", 178 static_libs: ["kotlinx_coroutines"], 179 apex_available: [ 180 "//apex_available:platform", 181 "//apex_available:anyapex", 182 ], 183 visibility: ["//visibility:public"], 184} 185 186java_library { 187 name: "kotlinx-coroutines-core-jvm", 188 host_supported: true, 189 sdk_version: "core_current", 190 min_sdk_version: "28", 191 static_libs: ["kotlinx_coroutines"], 192 apex_available: [ 193 "//apex_available:platform", 194 "//apex_available:anyapex", 195 ], 196 visibility: ["//visibility:public"], 197} 198 199java_library { 200 name: "kotlinx-coroutines-android", 201 sdk_version: "current", 202 min_sdk_version: "28", 203 static_libs: [ 204 "kotlinx_coroutines_android", 205 "kotlinx_coroutines", 206 ], 207 apex_available: [ 208 "//apex_available:platform", 209 "//apex_available:anyapex", 210 ], 211 visibility: ["//visibility:public"], 212} 213 214filegroup { 215 name: "kotlinx-coroutines-play-services", 216 srcs: ["integration/kotlinx-coroutines-play-services/src/**/*.kt"], 217 visibility: ["//visibility:public"], 218} 219 220// Maven coordinate: org.jetbrains.kotlinx:kotlinx-coroutines-guava 221java_library { 222 name: "kotlinx_coroutines_guava", 223 sdk_version: "current", 224 min_sdk_version: "28", 225 host_supported: true, 226 srcs: ["integration/kotlinx-coroutines-guava/src/**/*.kt"], 227 kotlincflags: [ 228 "-opt-in=kotlin.RequiresOptIn", 229 "-opt-in=kotlinx.coroutines.InternalCoroutinesApi", 230 "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", 231 ], 232 libs: [ 233 "kotlinx_coroutines", 234 "kotlin-stdlib-jdk8", 235 "guava", 236 ], 237 apex_available: [ 238 "//apex_available:platform", 239 "//apex_available:anyapex", 240 ], 241 visibility: ["//visibility:public"], 242} 243 244// Maven coordinate: org.jetbrains.kotlinx:kotlinx-coroutines-reactive 245java_library { 246 name: "kotlinx_coroutines_reactive", 247 host_supported: true, 248 srcs: ["reactive/kotlinx-coroutines-reactive/src/**/*.kt"], 249 kotlincflags: [ 250 "-opt-in=kotlin.RequiresOptIn", 251 "-opt-in=kotlinx.coroutines.InternalCoroutinesApi", 252 "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", 253 "-opt-in=kotlin.experimental.ExperimentalTypeInference", 254 ], 255 libs: [ 256 "kotlin-stdlib", 257 "kotlinx_coroutines", 258 "rxjava", 259 ], 260 apex_available: [ 261 "//apex_available:platform", 262 "//apex_available:anyapex", 263 ], 264 visibility: ["//visibility:public"], 265} 266 267// Maven coordinate: org.jetbrains.kotlinx:kotlinx-coroutines-rx2 268java_library { 269 name: "kotlinx_coroutines_rx2", 270 host_supported: true, 271 srcs: ["reactive/kotlinx-coroutines-rx2/src/**/*.kt"], 272 kotlincflags: [ 273 "-opt-in=kotlin.RequiresOptIn", 274 "-opt-in=kotlinx.coroutines.InternalCoroutinesApi", 275 "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", 276 "-opt-in=kotlin.experimental.ExperimentalTypeInference", 277 ], 278 libs: [ 279 "kotlin-stdlib", 280 "kotlinx_coroutines", 281 "kotlinx_coroutines_reactive", 282 "rxjava", 283 ], 284 apex_available: [ 285 "//apex_available:platform", 286 "//apex_available:anyapex", 287 ], 288 visibility: ["//visibility:public"], 289} 290