AA standalone: introduce multi-module binary dependency test
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.analysis.test.framework.services.configuration
|
||||
|
||||
import org.jetbrains.kotlin.analysis.test.framework.services.libraries.CompiledLibraryProvider
|
||||
import org.jetbrains.kotlin.analysis.test.framework.services.libraries.compiledLibraryProvider
|
||||
import org.jetbrains.kotlin.test.model.DependencyDescription
|
||||
import org.jetbrains.kotlin.test.services.ServiceRegistrationData
|
||||
import org.jetbrains.kotlin.test.services.TestServices
|
||||
import org.jetbrains.kotlin.test.services.configuration.JvmEnvironmentConfigurator
|
||||
import org.jetbrains.kotlin.test.services.dependencyProvider
|
||||
import org.jetbrains.kotlin.test.services.service
|
||||
import java.io.File
|
||||
|
||||
class AnalysisApiJvmEnvironmentConfigurator(testServices: TestServices) : JvmEnvironmentConfigurator(testServices) {
|
||||
override val additionalServices: List<ServiceRegistrationData>
|
||||
get() = super.additionalServices + listOf(
|
||||
service(::CompiledLibraryProvider),
|
||||
)
|
||||
|
||||
override fun convertDependencyToFileList(dependency: DependencyDescription): List<File> {
|
||||
val friendModule = testServices.dependencyProvider.getTestModule(dependency.moduleName)
|
||||
testServices.compiledLibraryProvider.getCompiledLibrary(friendModule.name)?.artifact?.let {
|
||||
return listOf(it.toFile())
|
||||
}
|
||||
return super.convertDependencyToFileList(dependency)
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
@@ -22,6 +22,8 @@ class CompiledLibraryProvider(private val testServices: TestServices) : TestServ
|
||||
|
||||
return CompiledLibrary(libraryJar, librarySourcesJar).also { libraries[module.name] = it }
|
||||
}
|
||||
|
||||
fun getCompiledLibrary(moduleName: String): CompiledLibrary? = libraries[moduleName]
|
||||
}
|
||||
|
||||
val TestServices.compiledLibraryProvider: CompiledLibraryProvider by TestServices.testServiceAccessor()
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user