Build: fix finding layout-api jar in parcelize box test due to platform change
This commit is contained in:
+6
-2
@@ -28,20 +28,24 @@ abstract class AbstractParcelBoxTest : CodegenTestCase() {
|
||||
companion object {
|
||||
val LIBRARY_KT = File("plugins/android-extensions/android-extensions-compiler/testData/parcel/boxLib.kt")
|
||||
|
||||
private fun String.withoutAndroidPrefix(): String = removePrefix("studio.android.sdktools.")
|
||||
|
||||
private val androidPluginPath: String by lazy {
|
||||
System.getProperty("ideaSdk.androidPlugin.path")?.takeIf { File(it).isDirectory }
|
||||
?: throw RuntimeException("Unable to get a valid path from 'ideaSdk.androidPlugin.path' property, please point it to the Idea android plugin location")
|
||||
}
|
||||
|
||||
val layoutlibJar: File by lazy {
|
||||
File(androidPluginPath).listFiles { _, name ->
|
||||
File(androidPluginPath).listFiles { _, rawName ->
|
||||
val name = rawName.withoutAndroidPrefix()
|
||||
name.startsWith("layoutlib-") && name.endsWith(".jar")
|
||||
&& !name.startsWith("layoutlib-api-") && !name.startsWith("layoutlib-loader")
|
||||
}?.firstOrNull() ?: error("Unable to locate layoutlib jar in '$androidPluginPath'")
|
||||
}
|
||||
|
||||
val layoutlibApiJar: File by lazy {
|
||||
File(androidPluginPath).listFiles { _, name ->
|
||||
File(androidPluginPath).listFiles { _, rawName ->
|
||||
val name = rawName.withoutAndroidPrefix()
|
||||
name.startsWith("layoutlib-api-") && name.endsWith(".jar")
|
||||
}?.firstOrNull() ?: error("Unable to locate layoutlib-api jar in '$androidPluginPath'")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user