-
-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(Idea) Lazily read APK path from variant #28
Comments
Here’s an example of how this would look in action, from another gradle plugin we use in our project. |
Actually, after talking with that example library's developer a bit, he came up with an easier solution that might work here as well. Instead of getting the APK file upfront in Here's the small commit where he implemented this. It's a fairly similar structure to this project as far as the configuration being in an What do you think? |
Looks very interesting. I have already been looking for a way to honor the custom APK names. The lazy approach looks very promising. Shouldn't be too hard to implement. |
Cool, please let me know how it goes or if you want me to take a shot at it :) |
Uses deprecated APIs for now so we should optimize it.
@bhurling Is the branch |
I took a peak and left a comment with a couple suggested ways to avoid the On Mon, Dec 15, 2014, 2:24 AM Christian Becker notifications@github.com
|
I slightly changed the part where we find the apk file output: def apkOutput = variant.outputs.find { variantOutput -> variantOutput instanceof ApkVariantOutput } Just in case someone does not use the .apk extension in his custom filename. Also I dropped the part that checks for the zipAlign task. That part is already checked during the plugin setup. What do you think? |
Didn't even think of that. If it works then I say go for it! On Mon, Dec 15, 2014, 2:58 AM Björn Hurling notifications@github.com
|
Using our setup as an example, we do some processing in
applicationVariants.all{...}
to format the APK name with some extra information. This however breaks the plugin's ability to find the APK (due to it looking for the default name), so for now we've been using the solution you suggested in #17. This solution isn't really ideal though, as it makes the code depend on an internal field that could change in another release.What would you think of allowing passing in a map of apkNames, where the key-value schema is
defaultApkName -> customApkName
. This way, we can inform the plugin what the new name is, and it can find it because it already has the old name.I would be happy to take a crack at the idea in a pull request if you'd be amenable to it, let me know!
The text was updated successfully, but these errors were encountered: