tschuchortdev / kotlin-compile-testing

A library for testing Kotlin and Java annotation processors, compiler plugins and code generation
Mozilla Public License 2.0
648 stars 61 forks source link

Create parent directories of nested SourceFile #339

Closed pranjalvachaspati-toast closed 1 year ago

pranjalvachaspati-toast commented 1 year ago

Currently, createNewFile() fails if you have a SourceFile in a directory, since it can't create the owning directory.

Calling mkdirs() on the parent directory fixes this, and has no effect if the path already exists.

pranjalvachaspati-toast commented 1 year ago

This fixes Issue #340.

pranjalvachaspati-toast commented 1 year ago

@tschuchortdev please let me know if this PR needs anything!

jisungbin commented 1 year ago

Hi @tschuchortdev, I need this feature. Can you review this PR?

tschuchortdev commented 1 year ago

Thanks for this PR! I'm sorry I didn't get to it sooner. Your work is appreciated and will be in the next release, which I'm about to start.