|
3 | 3 | */
|
4 | 4 |
|
5 | 5 |
|
| 6 | +import org.gradle.api.internal.artifacts.repositories.resolver.DefaultMutableVariantFilesMetadata |
6 | 7 | import org.jetbrains.kotlin.config.KotlinCompilerVersion
|
7 | 8 | import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
|
8 | 9 | import org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile
|
9 | 10 | import org.jetbrains.kotlin.konan.target.HostManager
|
10 | 11 | import org.jetbrains.dokka.gradle.DokkaTaskPartial
|
| 12 | +import org.jetbrains.kotlin.gradle.targets.js.KotlinJsCompilerAttribute |
11 | 13 |
|
12 | 14 | import static Projects.*
|
13 | 15 |
|
@@ -180,6 +182,31 @@ configure(subprojects.findAll { !sourceless.contains(it.name) }) {
|
180 | 182 | // Remove null assertions to get smaller bytecode on Android
|
181 | 183 | kotlinOptions.freeCompilerArgs += ["-Xno-param-assertions", "-Xno-receiver-assertions", "-Xno-call-assertions"]
|
182 | 184 | }
|
| 185 | + |
| 186 | + dependencies { |
| 187 | + components { |
| 188 | + it.withModule("org.jetbrains.kotlin:atomicfu") { |
| 189 | + def componentMetadataDetails = it as ComponentMetadataDetails |
| 190 | + componentMetadataDetails.withVariant("runtimeElements") { |
| 191 | + def runtimeElementsVariant = it as VariantMetadata |
| 192 | + componentMetadataDetails.addVariant("runtimeJsIrElements") { |
| 193 | + def runtimeJsIrElementsVariant = it |
| 194 | + runtimeElementsVariant.attributes.attribute(KotlinPlatformType.attribute, KotlinPlatformType.js) |
| 195 | + runtimeElementsVariant.attributes.attribute(KotlinJsCompilerAttribute.jsCompilerAttribute, KotlinJsCompilerAttribute.ir) |
| 196 | + runtimeElementsVariant.attributes.attribute(Usage.USAGE_ATTRIBUTE, project.objects.named(Usage, Usage.JAVA_RUNTIME)) |
| 197 | + runtimeElementsVariant.withFiles { |
| 198 | + def runtimeElementsFiles = it as DefaultMutableVariantFilesMetadata |
| 199 | + runtimeJsIrElementsVariant.withFiles { |
| 200 | + runtimeElementsFiles.files.forEach { |
| 201 | + addFile(it.name) |
| 202 | + } |
| 203 | + } |
| 204 | + } |
| 205 | + } |
| 206 | + } |
| 207 | + } |
| 208 | + } |
| 209 | + } |
183 | 210 | }
|
184 | 211 |
|
185 | 212 | if (build_snapshot_train) {
|
|
0 commit comments