mmcc007 / screenshots

Screenshots: A command line utility and package for capturing screenshots for Flutter
Other
265 stars 144 forks source link

[Bug] Support multiple flavors #113

Open Gerrel opened 5 years ago

Gerrel commented 5 years ago

When running 2 'screenshots' commands sequentially for different --flavor it deletes all screenshots for android + iOS except iPad screenshots.

Would like to see that it doesn't delete any screenshots when running the command?

Can we create a subfolder with the --flavor name? because I can runfastlane supply with a metadata_path argument. If that is possible then deleting of images is a non-issue, because then only the flavor sub-folder needs to be deleted.

mmcc007 commented 5 years ago

Screenshots is designed to delete any screenshots, that it created in a prior run, at the start of the current run. It is supporting a workflow where a final set of deliverable screenshots is available at the end of a run. This seems to work for most use cases.

For flavors, since the same integration test can create different screenshots for each flavor run, there seems to be a need to not delete images between flavor runs.

So would skipping the delete-images step work for your use case when running with the flavor option?

Not sure if I follow the subfolder suggestion.

Gerrel commented 5 years ago

Yes, skipping the delete-images step would work for me.

When running the fastlane supply command for uploading metadata to the play store it will upload all images in the default metadata folder. But in case of flavors we have 2 or more apps in the play store. If the screenshots for a flavor are in a different metadata folder (for example: metadata-flavor1, metadata-flavor2) I can call fastlane supply metadata_path ./metadata-flavor1 and fastlane supply metadata_path ./metadata-flavor2. (Have not actually tried the command out just yet)

mmcc007 commented 5 years ago

One way to support this use case is to add a flavor_dir to the config file and at the end of a flavor run, add a step to copy screenshots into a subdir of the flavor_dir with the name of the flavor.

Then when you want to do a release, you always have the latest screenshots for each flavor in a known location and can adjust your release scripts accordingly.

Would that work?

Gerrel commented 5 years ago

Yes that would definitely work.