Thanks much. This works. I am still a little fuzzy when it comes to the order of precedence for BuildType/BuildFlavor and friends. I guess I should go back and watch your tools video from IO.
On Thursday, December 4, 2014 3:29:12 PM UTC-5, Xavier Ducrohet wrote: > > No it won't. > > If both productFlavors.B1.signingConfig and buildTypes.debug.signingConfig > are non null, the build type one will be used. > > On Thu, Dec 4, 2014 at 12:16 PM, Aditya Gore <[email protected] > <javascript:>> wrote: > >> Thank you for responding. But this will give both debug and release >> versions of the B* flavors the same signing config. I am looking for a way >> to differentiate between those. If I print a productFlavor object I don't >> see anything in there (at least in the toString() value) that indicates the >> BuildType. I went and looked at the source code for the Android plugin but >> nothing looked promising. Any pointers? >> >> >> >> On Tuesday, December 2, 2014 2:31:15 PM UTC-5, Xavier Ducrohet wrote: >>> >>> Dont set a signingconfig on the release build-type, it'll override the >>> signing config set in the flavor (this is how the debug signing config >>> works). >>> >>> If you really have a lot of B* flavors, I would try to do something like >>> this after you create the flavors/signingconfigs: >>> >>> for (int i = 0 ; i < n ; i++) { >>> android.produtFlavors.getByName("B${i}").signingConfig = >>> android.signingConfigs.getByName("releaseB${i}") >>> } >>> >>> >>> >>> >>> On Wed, Nov 26, 2014 at 11:45 AM, Aditya Gore <[email protected]> >>> wrote: >>> >>>> I have an app that has several flavors: A, B, B1..Bn >>>> >>>> The release buildType for Flavor A needs to be signed using one >>>> signingConfig and the release buildType for all "B" flavors need a second >>>> signingConfig. However I want all debug buildTypes to be unsigned or >>>> signed >>>> with the default debug key. The closest I got was to define a default >>>> signingConfig for the release buildType and then override that in the "A" >>>> productFlavor. But that causes both release and debug buildTypes for A to >>>> get the "A" signingConfig, which I don't want. I tried >>>> applicationVariants.find {it.name == "ARelease"}.signingConfig = >>>> signingConfigs.ARelease, but turns out that's a read-only property in the >>>> applicationVariants.* closure. >>>> >>>> Any pointers? Thanks much. >>>> >>>> My build.gradle (summarized) : >>>> >>>> android { >>>> ... >>>> signingConfigs { >>>> releaseA { >>>> ... >>>> } >>>> releaseB { >>>> ... >>>> } >>>> } >>>> buildTypes { >>>> release { >>>> signingConfigs signingConfigs.releaseB >>>> } >>>> } >>>> productFlavors { >>>> A { >>>> signingConfig signingConfigs.releaseA >>>> } >>>> B1 { >>>> } >>>> ... >>>> Bn { >>>> } >>>> } >>>> } >>>> >>>> -- >>>> 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. >>>> >>> >>> >>> >>> -- >>> Xavier Ducrohet >>> Android SDK Tech Lead >>> Google Inc. >>> http://developer.android.com | http://tools.android.com >>> >>> Please do not send me questions directly. Thanks! >>> >> -- >> 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. >> > > > > -- > Xavier Ducrohet > Android SDK Tech Lead > Google Inc. > http://developer.android.com | http://tools.android.com > > Please do not send me questions directly. Thanks! > -- 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.
