cashapp / paparazzi

Render your Android screens without a physical device or emulator
https://cashapp.github.io/paparazzi/
Apache License 2.0
2.25k stars 213 forks source link

Allow custom directories for the snapshot outputs #608

Open JavierSegoviaCordoba opened 1 year ago

JavierSegoviaCordoba commented 1 year ago

Instead of only allowing src/main/, other projects, including official JetBrains products, are using a more flattened project structure, like src (without main).

A paparazzi Gradle extension which can have a sourcesDir property or whatever name should be great.

jrodbx commented 1 year ago

How would this work with source sets? Snapshot outputs wouldn't go in src/main along with source files, but rather src/test.

Also, I'd refrain from a Gradle extension which is more for per-project/module configuration (that would mean either using subprojects {} in a legacy structure or a convention plugin which sets this property on every project using Paparazzi) and instead use a global system property.

JavierSegoviaCordoba commented 1 year ago

Official JetBrains libraries are using test directly instead of src/test.

I wouldn't use allprojects/subprojects as they break project isolation and are a bad practice in Gradle.

I would suggest using convention plugins, but that is not related to paparazzi itself, which only needs to support a custom directory output, how the user decides to share the configuration across all modules is up to them, as they are already doing when they set the sources directories with KGP.