You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a variant named "LOCAL_Debug". The val types = variantName.split("(?=\\p{Upper})".toRegex()) will split my varaintName into ["L", "O", "C", "A", "L", "Debug"]. Then the for each will match many unexcepted files. For example, I use the MacBook. There is a .ds_store file under app/srcdirs. In this case, the file.list() casue exception.
Since the varaintName can be various, this is a unstable logic. Looking forward to improvement it.
A problem occurred configuring project ':app'.
>file.list() must not be null
funfindSourcesForVariant(project:Project, variantName:String, language:String): MutableSet<File> {
val possibleDirs:MutableSet<File> =mutableSetOf()
if (project.file("src/main/$language").exists()) {
possibleDirs.add(project.file("src/main/$language"))
}
val types = variantName.split("(?=\\p{Upper})".toRegex())
val root = project.file("src").listFiles()
root.forEach { file ->
types.forEach { type ->if (file.name.contains(type.toLowerCase()) &&
file.list().any { it.contains(language) }) {
possibleDirs.add(File(file, language))
}
}
}
returnLinkedHashSet(possibleDirs)
}
The text was updated successfully, but these errors were encountered:
I have a variant named "LOCAL_Debug". The
val types = variantName.split("(?=\\p{Upper})".toRegex())
will split my varaintName into ["L", "O", "C", "A", "L", "Debug"]. Then thefor each
will match many unexcepted files. For example, I use the MacBook. There is a.ds_store
file underapp/src
dirs. In this case, thefile.list()
casue exception.Since the varaintName can be various, this is a unstable logic. Looking forward to improvement it.
The text was updated successfully, but these errors were encountered: