So. I already understand it.

BuildableArtifact provide dependency on PackageApplication task for APK and 
PackageBundleTask 
for bundle.
This works correctly. When I call my sign task it automaticaly run 
PackageApplication  or PackageBundleTask .
But I don't want to run it manually I want to have signed apk or bundle 
when I call assembleRelease o bundleRelease
So I need to declare this depenency for APK

variant.assembleProvider?.configure {
    dependsOn(signTask)
}


Then my sign taks will be automatical run between package and assemble and 
will be completely hidden for all developers.

But for app bundle it is not so easy, but I found hack how to get a bundle 
task:

variant.getVariantData().getTaskContainer().bundleTask?.configure {
    it.dependsOn(bundleSignTask)
}


And another important observation.
As I already wrote,  variant.getFinalArtifact(InternalArtifactType.APK) return 
just the folder name where APK is stored, but not a APK itself by

println "Single file: " + artifact.get().getSingleFile()

I will get *sample\build\outputs\apk\full\release*

But for variant.getFinalArtifact(InternalArtifactType.BUNDLE)
I will get *sample\build\outputs\bundle\fullRelease\sample.aab*

It's bug?

Also, the folder structure for apk and aab is quite non-uniform.



-- 
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