Status Update
Comments
xa...@google.com <xa...@google.com>
to...@gmail.com <to...@gmail.com> #2
to...@gmail.com <to...@gmail.com> #4
for all who are looking for a solution use this:
ds...@gmail.com <ds...@gmail.com> #5
Hello, this is a P1 S1 issue for a while now, and it's blocking us from upgrading to AGP 4.2 and further. What's the current status? And do you have plans to backport it to 4.2.x?
je...@google.com <je...@google.com> #6
no we don't have a plan to backport this. why is this blocking you from upgrading ?
ds...@gmail.com <ds...@gmail.com> #7
We sign apk's and bundles via internal service, and i don't know another way to interact with artifacts;
Yesterday i ended up with some ugly workaround:
je...@google.com <je...@google.com> #8
I commented on the merge request but to summarize :
you can set your signing tasks output folder to wherever you need to be :
artifacts.use(target.tasks.signedApkTaskProvider(this)).configure { signedDirProperty.set(File("/path/to/where/you/want/your/signed/files")) }
if you don't set it, then we will set a directory automatically.
ds...@gmail.com <ds...@gmail.com> #9
Thanks, Jerome!
je...@google.com <je...@google.com> #10
I checked that we do have correct behavior for FILE based artifacts like bundle :
> Task :app:debugUpdateArtifact
originalArtifact: /usr/local/google/home/jedo/src/studio-main/out/apiTests/Kotlin/bugTest/app/build/intermediates/bundle/debug/signDebugBundle/app-debug.aab
updatedArtifact: /usr/local/google/home/jedo/src/studio-main/out/apiTests/Kotlin/bugTest/app/build/outputs/bundle/debug/app-debug.aab
however, we still seem to not be consistent for the DIRECTORY based artifacts like APK:
> Task :app:debugUpdateAPKArtifact
Input folder: /usr/local/google/home/jedo/src/studio-main/out/apiTests/Kotlin/bugTest/app/build/outputs/apk/debug
Output folder: /usr/local/google/home/jedo/src/studio-main/out/apiTests/Kotlin/bugTest/app/build/intermediates/apk/debug
Input file: /usr/local/google/home/jedo/src/studio-main/out/apiTests/Kotlin/bugTest/app/build/outputs/apk/debug/app-debug.apk
Alex, can you have a look ?
al...@google.com <al...@google.com>
je...@google.com <je...@google.com> #11
correction, I was not correct about FILE being correct.
Instead of :
updatedArtifact: /usr/local/google/home/jedo/src/studio-main/out/apiTests/Kotlin/bugTest/app/build/outputs/bundle/debug/app-debug.aab
it should be
updatedArtifact: /usr/local/google/home/jedo/src/studio-main/out/apiTests/Kotlin/bugTest/app/build/outputs/app-debug.aab
``
al...@google.com <al...@google.com> #12
Two requests are created as they are API changes
al...@google.com <al...@google.com> #13
Fix will be available in Android Studio F/AGP 8.0 Canary 2 Release
al...@google.com <al...@google.com>
to...@gmail.com <to...@gmail.com> #14
I tried to use it and at first look, it looks like everything works as expected. Thanks!
to...@gmail.com <to...@gmail.com> #15
The big issue is, that the current AGP 7.4.0 is broken. I tried to use this API and it is still broken in 7.4.0, it is probably really in AGP 8 :-(
Description
For single file artifact like bundle
variant.artifacts.use(updateBundleArtifact)
.wiredWithFiles(
UpdateArtifactTask::initialArtifact,
UpdateArtifactTask::updatedArtifact
)
.toTransform(ArtifactType.BUNDLE)
it set this value
originalArtifact: app\build\outputs\bundle\debug\signDebugBundle\app-debug.aab
updatedArtifact: app\build\outputs\bundle\debug\debugUpdateArtifact\out
There are more weird things:
- why there is this "sign" prefix for the original file? It should be just "debugBundle"
- why output file is "out". and not app-debug.aab
- According to Xavier Ducrohet only the final artifact should be inside of outputs folder
- Then I don't see the reason for changing the name of the folder debugBundle to debugUpdateArtifact (if only final artifact should be there), it will really help with old plugins that will not use new variant API and will depend on the hardcoded path.
- I would really appreciate if there will be also the possibility to change the name of the output artifact during this transform, not the only file content.
And when I use this
variant.artifacts.use(updateApkArtifact)
.wiredWithDirectories(
UpdateDirArtifactTask::inputDir,
UpdateDirArtifactTask::outputDir
)
.toTransform(ArtifactType.APK)
It set this
Input folder: app\build\outputs\apk\debug
Output folder: app\build\intermediates\apk\debug\debugUpdateAPKArtifact
- output folder is inside of intermediates instead of input one
- also here I would expect that the output folder will be the same as the normal output folder for APK without transformation (for last one transformation in the chain). Why another level of the hierarchy?
There is one more unexpected thing that
val artifacts = builtArtifactsLoader.get().load(inputDir.get())
artifacts?.elements?.forEach {
it.outputFile is just String. I would expect File there.
Build: AI-202.7660.26.42.6987402, 202011210045,
AI-202.7660.26.42.6987402, JRE 11.0.8+10-b944.6842174x64 JetBrains s.r.o, OS Windows 10(amd64) v10.0 , screens 2560x1440, 2560x1440
AS: 4.2 Beta 1; Kotlin plugin: 1.4.20-release-Studio4.2-1; Android Gradle Plugin: 4.2.0-beta01; Gradle: 6.7; NDK: from local.properties: (not specified), latest from SDK: (not found); LLDB: pinned revision 3.1 not found, latest from SDK: (package not found); CMake: from local.properties: (not specified), latest from SDK: (not found), from PATH: (not found)
IMPORTANT: Please read