>>... gradle connectedAndroidTest<VariantName>

yes, I'm using connectedAndroidTestFlavor1Debug. But, with 'app' and 
subprojects 'model', 'ui', 'core', etc., it builds a separate apk for each 
:lib and runs tests for each module separately.  So, there's a bunch of 
redundancy.

>>...variantFilter

That sounds promising - thanks!

greg

On Thursday, April 30, 2015 at 5:05:07 PM UTC-7, Jerome Dochez wrote:
>
>
>
> On Thu, Apr 30, 2015 at 10:29 AM Greg Macdonald <[email protected] 
> <javascript:>> wrote:
>
>> When I run assembleFlavor1Debug, then all build variant combinations for 
>> flavor * buildType are built even though they should not be needed. I 
>> thought I read somewhere this could be inhibited but can't find it or 
>> discover a way to cause it.  Is there a way to inhibit unneeded build 
>> variants from being processed?
>>
> not yet, this is something we are working on with gradleware as it is 
> currently a gradle limitation. 
>
>>
>> We've a multi-module project and we were using multiple application 
>> modules to get different build configurations. In that case, we used 
>> sourceSets to cause all androidTest code to be included when testing the 
>> 'app' module.  Starting from the suggestion in 
>> https://code.google.com/p/android/issues/detail?id=106561 I switched to 
>> using productFlavors.  I had the expectation that this technique would work 
>> the similarly.  But, now when I run connectedAndroidTest it builds a full 
>> apk for each library module, runs test on that module and iterates to the 
>> next module.
>>
>> Between the build compiling every possible combination of everything and 
>> building an entire collection of full apk's, running tests has quadrupled 
>> from a bit over 2 minutes to 10 minutes.
>>
>> Also, we are now on AS 1.2 RC3 w/ plugin 1.1.3 and AS is getting really 
>> slow in things like sync'ing the build configuration. Often after changing 
>> a build.gradle file AS saturates the CPU and then just grinds away forever 
>> and after many minutes might finally run out of memory and I get an error 
>> that the JVM needs to be shut down.  Is there some trick to improve this?  
>> Or perhaps some improvement on the horizon?  This is really getting bad and 
>> folks are starting to force quit AS and restart to get out of this state.
>>
>> if you are not interested in running all the connectedAndroidTest, one 
> simple thing it to just run the variant of course :
> gradle connectedAndroidTest<VariantName>
>
> do "gradle tasks" to see all the connectedAndroidTest tasks
> connectedAndroidTest 
>
>> Any suggestions to improve any of this greatly appreciated.
>>
>
> a bit more involving, is to disable certain variants that you know you do 
> not care about :
>
> variantFilter {
>   if (it.buildType.name.equals("debug") && 
>    it.getFlavors().get(0).name.equals("flavor1")) {
>      it.ignore = true
>   }
>  }
>  
>
>>
>>
>> thanks,
>> greg
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "adt-dev" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to