Yes. I know that I should use lazy tasks. I'm on the way to rewrite it, it is because I'm asking if there is any better way. Would be great if build plugin provides some interface and allows to inject own implementation of it. And allows doing that without a care about task creating and it's dependency.
The whole implementation of our tasks is here: https://gist.github.com/tprochazka/09bc1fdf6da0de7ad0830c911d10028d But it has several disadvantages currently: 1.) It does not sign app bundles now, just apk 2.) it doesn't work from Android Studio when the Instant run is enabled ( project.android.applicationVariants.all is missing for some reason) 3.) It is not lazy enough Dne středa 14. listopadu 2018 18:40:40 UTC+1 Jerome Dochez napsal(a): > > you should use Lazy tasks > > https://docs.gradle.org/current/userguide/lazy_configuration.html > > How do you express the dependency on the Bundle/APK file you want to sign ? > > On Wed, Nov 14, 2018 at 5:10 AM Tomáš Procházka <[email protected] > <javascript:>> wrote: > >> Hi. >> >> Is there already any more official way how to implement own sign >> mechanism which will be used for apk and app bundles? >> >> We are using a special server where we send the apk and it returns back >> signed version. >> Currenty we are creating a custom task for every variant which handle >> remote sign in this way >> >> >> >> project.android.applicationVariants.all { ApplicationVariant variant -> >> >> if (!isReleaseBuildType(variant)) { >> return >> } >> >> variant.outputs.each { ApkVariantOutput output -> >> project.getLogger().info "Remote signing enabled for build variant: >> $project.name $variant.name" >> >> // create a signing task for this >> project.tasks.create( >> "remoteSign${output.name.capitalize()}Apk", >> RemoteSignApkTask, >> new RemoteSignApkTask.ConfigAction(variant, output) >> ) >> } >> >> variant.testVariant?.outputs?.each { ApkVariantOutput output -> >> project.getLogger().info "Remote signing enabled for build test >> variant: $project.name $variant.testVariant.name" >> >> // create a signing task for this >> project.tasks.create( >> "remoteSign${output.name.capitalize()}Apk", >> RemoteSignApkTask, >> new RemoteSignApkTask.ConfigAction(variant, output) >> ) >> } >> } >> >> >> >> But it starting to be obsolete, it should be rewritten to more lazy way. >> So I'm asking if there is any better way already. >> >> -- >> 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.
