mirror of
https://github.com/revanced/revanced-patcher.git
synced 2025-05-01 13:44:25 +02:00
chore: Print correct error message
This commit is contained in:
parent
81d1d7f544
commit
909d89fa8d
@ -93,11 +93,16 @@ class TestPatchAnnotationProcessor {
|
|||||||
* @param className The name of the class to get the source file from.
|
* @param className The name of the class to get the source file from.
|
||||||
* @return The source file.
|
* @return The source file.
|
||||||
*/
|
*/
|
||||||
fun getSourceFile(sample: String, className: String) = SourceFile.kotlin(
|
fun getSourceFile(sample: String, className: String): SourceFile {
|
||||||
"$className.kt", TestPatchAnnotationProcessor::class.java.classLoader.getResourceAsStream(
|
val resourceName = "app/revanced/patcher/patch/annotations/processor/samples/$sample/$className.kt"
|
||||||
"app/revanced/patcher/patch/annotations/processor/samples/$sample/$className.kt"
|
return SourceFile.kotlin(
|
||||||
)?.readAllBytes()?.toString(Charsets.UTF_8) ?: error("Could not find resource $className")
|
"$className.kt",
|
||||||
)
|
TestPatchAnnotationProcessor::class.java.classLoader.getResourceAsStream(resourceName)
|
||||||
|
?.readAllBytes()
|
||||||
|
?.toString(Charsets.UTF_8)
|
||||||
|
?: error("Could not find resource $resourceName")
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compile the given source files and return the result.
|
* Compile the given source files and return the result.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user