I found a solution that may not be optimal, but it works for what I need.
In my processed application, I must first say that the assembly of Relay depends on my wear and tear: assembleRelease:
application / build.gradle
project.afterEvaluate { preReleaseBuild.dependsOn(':wear:assembleRelease') }
preReleaseBuild is one of the first build tasks, but this task is created dynamically, so you need to wrap it after evaluating the project.
Then, in my wear of build.gradle , I have to specify a copy at the end of the assembly:
clothes / build.gradle
assembleRelease << { println "Copying the Wear APK" copy { from 'build/outputs/apk' into '../app/src/main/assets' include '**/wear-release.apk' } }
Only with the thesis modifications did I manage to explain the workflow in question.
This can be improved because it only works to build the release, but this is a good first step.
Do not forget to comment on this decision.
source share