-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
[Question] Exclude Certain flavor & Build Type #945
Comments
Aditionally, I was able to make it run only 1 combination of build type & flavor by manually comment out build type & flavor. |
What i am looking for is like Sonarcube configuration where you can choose certain build flavor so you dont run all combination of build types and flavor
|
Thanks for the question. Your methodology for excluding variants (disabling tasks) is not the right way to go about it. Instead, please use the appropriate AGP API. See the docs here. Alternatively, you could use the flag |
Thank you, i'll check this out |
Variant exclusion does not work for all use cases. For example, as far as I can see, disabling instrumented tests can only be achieved by disabling their tasks (and EDIT: disabling by source set might help here. Will check it out. |
I found a workaround for this: exclude this plugin from blanked task disabling. I do this by checking |
👋 @autonomousapps ! I too I have been experiencing issues with the ignoring Android variants flag that got introduced with #814 and 1.18.0. The only way for me to exclude variants from the projects I am working with (project like woocommerce-android) is to use a custom configuration (commit). As such, the My assumption is that although the For woocommerce-android, I The result below: If you compare these 2 files you will notice that the ignored variants configuration works for simple modules like Note You will find these changes within the build/dependency-analysis-android-gradle-plugin branch, just in case you would like to clone/pull the repo/branch and experienced it for yourself. I hope all this info will somewhat help you with your investigation, and thank you! 🙏 Cc @sboishtyan |
@ParaskP7 Hey, I could check your hypothesis this week. |
👋 @sboishtyan and thanks so much for jumping right into that to help out, much appreciated. I am really looking forward to whatever insights you can find on this issue, good luck! 🍀 |
@ParaskP7 Could you provide a set up branch for me. Because according to your README file I should setup a project. But I think it would be better if you do it for me. |
👋 @sboishtyan !
For sure, I actually left you a note on that on my initial comment above, see below: Note You will find these changes within the build/dependency-analysis-android-gradle-plugin branch, just in case you would like to clone/pull the repo/branch and experienced it for yourself. As such, you can use this branch. FYI: In general, the only think you would really need after cloning this repo is to copy-paste the Let me know how that works for you! 🙏 PS: Please ignore all the other setup steps (like the OAuth2 Authentication and Configuration Files sections) as those are for when you actually want to test the project. This setup is not needed for building purposes.
Exactly! 💯 |
Hi @ParaskP7 Then I commented code in ignored_variants.gradle So, I propose you apply those changes and check the output. |
👋 @sboishtyan and thank you for looking into it, much appreciated! 🙇
Ah, actually, you are right, with this
I was (incorrectly) thinking that the above is enough to exclude all the Btw, just for completeness purposes, for me to be able to run So ultimately, what is working for me and this project is the following configuration, that is if I want for the dependency analysis to run for the
FYI: For this other WordPress-Android project that I am also working on, which has a more complicated product flavor configuration, based on above, I had to then apply the following configuration, it worked: 🎉
The above would run the dependency analysis for the Again, I was initially trying something like the below, thinking it should work:
Question (❓): Wouldn't the above configuration be feasible with an update. Or, is it better to be explicit, enumerating exactly which variants one would like to ignore, wdyt? 🤔 No matter, your answer solved my issue and any concerns. I can now effectively use this Suggestion (💡): Btw, do you think it is maybe worth adding a wiki page explaining all what we discussed here? Maybe also providing to any readers with examples on how to properly use this configuration, especially when product flavors are involved. |
@ParaskP7 I agree that without the context it's easy to misinterpret what set as a value to a flag. I could add a PR and also add a link to this issue |
My thinking with the original property name is that "variant" in the Android world has always referred to the full variant name, that is, the combination of buildType and flavor. The way this is implemented is very simple: androidComponents.onVariants { variant ->
if (variant.name !in ignoredVariantNames) {
// analyze! I worry about the complexity of handling buildType vs flavor separately, and trying to somehow interpret the user's meaning. Better documentation would certainly be useful though. I appreciate the feedback 👍 For the record, PRs are also welcome, but I may decide not to accept a patch if I think the additional complexity is too much to maintain (I'm the sole maintainer of this project). |
My project currently has 17 flavor & 4 build type, that means 68 combination of build type & flavor task and additional task generated for each combination. I have managed to exclude flavor & build type using the following script
However, it seems task "> A failure occurred while executing com.autonomousapps.tasks.ComputeAdviceTask$ComputeAdviceAction"
still expect all flavor and build type to be compiled somehow because i got this error
"app/build/reports/dependency-analysis/integration01DebugTest/graph/graph-compile.json (No such file or directory)"
Is there a way to exclude certain flavor & build type so i can run this plugin faster without compiling all combination of flavor & build type ?
Thank you
The text was updated successfully, but these errors were encountered: