And one more problem is how to setup dependency on bundle task for variant?
For APK I did simply
variant.assembleProvider.configure {
dependsOn(signTask)
}
But there is nothing for bundle task.
Dne sobota 5. ledna 2019 0:10:32 UTC+1 Tomáš Procházka napsal(a):
>
> Hi.
>
> I started implementing it according your example code. It looks that it
> working in this way.
> I have just few more question.
>
> apkFile = variant.getFinalArtifact(com.android.build.gradle.internal.
> scope.InternalArtifactType.APK)
> def file = apkFile.get().getSingleFile()
> println "APK File " + file
>
> Actually, it doesn't contain APK file itself, but just folder when APK is
> located. It quite weird. I can simply search all apks inside of this folder
> (there is always just one), but I was expecting a file when it is called
> getFinalArtifact.
> And What is the benefit of using variant.getFinalArtifact instead of
> variant.outputs? The second one is not lazy?
>
>
> Dne středa 28. listopadu 2018 1:50:27 UTC+1 Jerome Dochez napsal(a):
>>
>> right, it's for 3.3.x, I am honestly not sure it would work or not with
>> 3.2
>>
>> if you use apk split then it complicate things quite a bit, I need to
>> look.
>>
>> I think the same solution should work for test variants.
>>
>> for dependencies, you only need the second line as the dependency on the
>> packageApplication is embedded in the FileCollection so your task is
>> implicitly made dependent (as long as you declare the FileCollection as an
>> Input of course).
>>
>>
>> On Tue, Nov 27, 2018 at 4:43 PM Tomáš Procházka <[email protected]>
>> wrote:
>>
>>> Thank you very much! I will investigate it.
>>> And yes we are using default debug sign way for debug builds. This
>>> remote sign is used just for release builds.
>>>
>>> First few notes:
>>>
>>> - I'm expecting that your solution is valid for build plugin 3.3.X,
>>> right? It will not work on 3.2.X.
>>> - It is interesting that you suggesting to use
>>> variant.getFinalArtifact(). I'm currently using variant.outputs.each,
>>> because if I know every variant can have multiple outputs if apk split
>>> is
>>> enabled, or it is already removed in 3.3 (there is still no source code
>>> available if I know, but my current solution still works in this way.)
>>> - I'm signing also test apk by using variant.testVariant?.outputs?,
>>> it is still possible?
>>> - I still need to setup dependency on this APKAccessTask to handle
>>> that it will be run in the right time when apk or/and app bundle is
>>> prepared already. Currently, I'm using
>>>
>>> signTask.dependsOn output.packageApplication
>>> output.assemble.dependsOn signTask
>>>
>>>
>>> As you can se here
>>> <https://gist.github.com/tprochazka/09bc1fdf6da0de7ad0830c911d10028d>.
>>> And probably still need to call variant.outputsAreSigned = true.
>>>
>>> --
>>> 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.
>>>
>>
--
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.