Parcelize: More robust code for locating layoutlib.jar
This commit is contained in:
committed by
Yan Zhulanow
parent
9bf3f105d9
commit
a2418484bb
+12
-2
@@ -33,8 +33,18 @@ abstract class AbstractParcelBoxTest : CodegenTestCase() {
|
|||||||
?: throw RuntimeException("Unable to get a valid path from 'ideaSdk.androidPlugin.path' property, please point it to the Idea android plugin location")
|
?: 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, "layoutlib-26.5.0.2.jar") }
|
val layoutlibJar: File by lazy {
|
||||||
val layoutlibApiJar: File by lazy { File(androidPluginPath, "layoutlib-api-26.5.0.jar") }
|
File(androidPluginPath).listFiles { _, name ->
|
||||||
|
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 ->
|
||||||
|
name.startsWith("layoutlib-api-") && name.endsWith(".jar")
|
||||||
|
}?.firstOrNull() ?: error("Unable to locate layoutlib-api jar in '$androidPluginPath'")
|
||||||
|
}
|
||||||
|
|
||||||
private val JUNIT_GENERATED_TEST_CLASS_BYTES by lazy { constructSyntheticTestClass() }
|
private val JUNIT_GENERATED_TEST_CLASS_BYTES by lazy { constructSyntheticTestClass() }
|
||||||
private const val JUNIT_GENERATED_TEST_CLASS_FQNAME = "test.JunitTest"
|
private const val JUNIT_GENERATED_TEST_CLASS_FQNAME = "test.JunitTest"
|
||||||
|
|||||||
Reference in New Issue
Block a user