jraska / Falcon

Take Android screenshots with Falcons bright eye!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shading or packaging Spoon dependency

tir38 opened this issue · comments

We were initially using Spoon + Falcon. We then switched to using Composer + Falcon. We kept using Falcon cause it's a great library and because it will in-turn match Spoon's file location format, which is needed for Composer read more

The problem we are facing now is that Falcon still depends on Spoon, specifically a snapshot version of 2.x. This is causing a lot of problems for build times (gradle always checks for new snapshot) and for remote devs w/ bad network connection.

We love using Falcon but can't afford the dynamic Spoon dependency. We're asking that you package or shade the Spoon dependency with falcon-spoon.

I know it would be weird to shade/package a "snapshot" version. But as long each release of falcon-spoon release notes referenced the Spoon snapshot commit SHA, other devs could decide to update to latest Falcon (or not).

You should be able to force a certain version of spoon to avoid all that snapshot lookup work

Hello,

Thanks for reaching out and for using the library.

If I understand correctly you are not using Spoon anymore and you use Composer instead, so maybe getting rid of the Spoon dependency completely is a way?
If you want Falcon without Spoon dependency Falcon has a separate falcon artifact. Only falcon-spoon-compat artifact is dependent on Spoon. You could use method:
Falcon.takeScreenshot(Activity activity, File toFile)

However by using only falcon artifact you will lose the Spoon directory structure, but I believe that could be easily implemented or maybe belongs to Composer?

Yeah so that's kinda the problem. We don't need spoon, only the spoon-esque file structure.

It's also tough for Falcon since you don't directly care how Spoon works (you just take the file they create and overwrite it:

File screenshot = spoonRule.screenshot(activity, tag);
// File will be overwritten with new screenshot
Falcon.takeScreenshot(activity, screenshot);

So Falcon can always depend on Spoon Snapshot and it's guaranteed to work.

Ideally Composer should define and expose its own pattern (even if that pattern is identical to Spoon) and then users could just pass a File to Falcon the same way it does with Spoon.

I close this issue and push for changes in Composer

Iirc you need only replicate the spoon logic for file path generation into a composer runtime module then any screenshot engine can do the required work.