Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[XABT] Split BuildApkArchive from BuildApk task. #9556

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jpobst
Copy link
Contributor

@jpobst jpobst commented Nov 25, 2024

Break down the mega-task BuildApk into smaller separation of concerns:

  • BuildApk - Generate files that need to be placed in the APK.
  • BuildApkArchive - Place files in the APK.

This works via the @(FilesToAddToApk) item group which is defined as:

<FilesToAddToApk
    <!-- Path of file on disk to add -->
    Include="obj\Release\net9.0-android\app_shared_libraries\arm64-v8a\libxamarin-app.so"
    <!-- Path to place file in APK -->
    ApkPath="lib/arm64-v8a/libxamarin-app.so"
    <!-- Package abi -->
    Abi="all"
/>

The %(Abi) metadata must be "all" for the default package. If $(AndroidCreatePackagePerAbi) is being used, additional items should be created for each additional abi package.

This change will allow future PR(s) to break down the BuildApk task into separate tasks for each type of files that belong in the APK, facilitating better incremental builds. For example, if only the Dalvik file changes we don't need to reprocess every managed assembly, etc.

Implementation

To keep the diff more manageable at this point, create the temporary ZipArchiveFileListBuilder as a drop-in replacement for ZipArchiveEx. Instead of adding files to the .apk it collects the file name and apk path so that the BuildApkArchive task can do the actual adding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant