Allow larger common test resources #355
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Part of #354
Before this change, the build logic took all test resources, and converted them into Kotlin code that was building a map using a single expression with using nested
mapOf
function to represent the directory structure. However, when trying to move existing JVM-specific resources (there's a lot of them), one could see a failing build with:This change puts every call to
mapOf(...)
orByteString.of(...)
into a separate method, so that now the limitation is either the maximum number of files/directories in a given directory, or size of a single file. It should unblock migrating tests to the common source set that rely on the large number of files (see a work-in-progress PR: #356).It was still faster to not use KotlinPoet, but the generated code became even more ugly. It's likely that I'm going to use KotlinPoet, especially that I'm planning to extract this functionality into a library.