kotlinx.atomicfu compiler plugin for JS_IR backend (#4581)
* kotlinx.atomicfu compiler plugin for JS_IR Support transformations of atomic operations introduced by the kotlinx.atomicfu library for the JS_IR backend. Compiler plugin is applied externally by the kotlinx.atomicfu gradle plugin. * Apply compiler plugin for JS platform only * New plugin test structure * testGroupOutputDirPrefix changed
This commit is contained in:
+1
-1
@@ -314,7 +314,7 @@ class ClassicFrontendFacade(
|
||||
dependentDescriptors: List<ModuleDescriptorImpl>,
|
||||
friendsDescriptors: List<ModuleDescriptorImpl>,
|
||||
): AnalysisResult {
|
||||
val runtimeKlibsNames = JsEnvironmentConfigurator.getStdlibPathsForModule(module)
|
||||
val runtimeKlibsNames = JsEnvironmentConfigurator.getRuntimePathsForModule(module, testServices)
|
||||
val runtimeKlibs = loadKlib(runtimeKlibsNames, configuration)
|
||||
val transitiveLibraries = JsEnvironmentConfigurator.getDependencies(module, testServices, DependencyRelation.RegularDependency)
|
||||
val friendLibraries = JsEnvironmentConfigurator.getDependencies(module, testServices, DependencyRelation.FriendDependency)
|
||||
|
||||
+6
-2
@@ -137,13 +137,17 @@ class JsEnvironmentConfigurator(testServices: TestServices) : EnvironmentConfigu
|
||||
return getMainModule(testServices).name
|
||||
}
|
||||
|
||||
fun getStdlibPathsForModule(module: TestModule): List<String> {
|
||||
fun getRuntimePathsForModule(module: TestModule, testServices: TestServices): List<String> {
|
||||
val result = mutableListOf<String>()
|
||||
val needsFullIrRuntime = JsEnvironmentConfigurationDirectives.KJS_WITH_FULL_RUNTIME in module.directives ||
|
||||
ConfigurationDirectives.WITH_STDLIB in module.directives ||
|
||||
ConfigurationDirectives.WITH_RUNTIME in module.directives
|
||||
|
||||
val names = if (needsFullIrRuntime) listOf("full.stdlib", "kotlin.test") else listOf("reduced.stdlib")
|
||||
return names.map { System.getProperty("kotlin.js.$it.path") }
|
||||
names.mapTo(result) { System.getProperty("kotlin.js.$it.path") }
|
||||
val runtimeClasspaths = testServices.runtimeClasspathProviders.flatMap { it.runtimeClassPaths(module) }
|
||||
runtimeClasspaths.mapTo(result) { it.absolutePath }
|
||||
return result
|
||||
}
|
||||
|
||||
fun getDependencies(module: TestModule, testServices: TestServices, kind: DependencyRelation): List<ModuleDescriptorImpl> {
|
||||
|
||||
Reference in New Issue
Block a user