[tasks] Add auto runtime initialization template to LibraryBuilder (#83050)
authorMitchell Hwang <16830051+mdh1418@users.noreply.github.com>
Fri, 17 Mar 2023 13:27:10 +0000 (09:27 -0400)
committerGitHub <noreply@github.com>
Fri, 17 Mar 2023 13:27:10 +0000 (09:27 -0400)
commitea5798205801700f70c31d93fb24be60622cb5a3
treecdba31cf899e03b29ee86ce965b741e2a8b18297
parentb6319cd0f1494b4f4c949c580975c6db9e88824e
[tasks] Add auto runtime initialization template to LibraryBuilder (#83050)

* [tasks] Add auto runtime initialization template to LibraryBuilder

* Grab shared library directory

* [tasks] Extend auto initialization template to account for customization

* Revert "Grab shared library directory"

This reverts commit bc86f2b91c76f0e40ad60516dcb1031d02e7054b.

* Remove platform specific naming

* [tasks] Move App Context setup back to autoinit.c

* Remove registering bundled modules and debugging until they can be validated

* Remove unnecessary wrapper

* Grab bundle_path later without eglib

Setting bundle_path in constructor may be too early for environment variables to be set
so grab it first thing when initializing the runtime.

Use getenv directly instead of calling into eglib with just one api

* Rename AssetsPath to AssembliesLocation

* Move assembly loading into separate function

* Remove unnecessary function

* Cleanup CMakeLists template indentation

* Add dotnet header to autoinit.c

* Default bundle_path if assemblies path environment variable not set

* Pass bundle_path to load assemblies

* Add logging and abort on failures

* Load assemblies with partial name

* Clean up targets and unneeded properties

* Rename source file

* Remove preload hook and make out of memory error more generic

* Throw when no exported symbols are found

* Remove aot data load prehook and aotdata generation

* Address feedback

* Address more feedback

* Add various fixes and make bundle_path a local variable

* Reintroduce load aot data hook in autoinit with guard

* Fix closing tag

* Include guard library-builder.h

* Fix typo
src/mono/msbuild/android/build/AndroidApp.targets
src/mono/msbuild/apple/build/AppleApp.targets
src/mono/msbuild/common/LibraryBuilder.targets
src/tasks/LibraryBuilder/LibraryBuilder.cs
src/tasks/LibraryBuilder/LibraryBuilder.csproj
src/tasks/LibraryBuilder/Templates/CMakeLists.txt.template
src/tasks/LibraryBuilder/Templates/assembly_list.c [deleted file]
src/tasks/LibraryBuilder/Templates/autoinit.c [new file with mode: 0644]
src/tasks/LibraryBuilder/Templates/library-builder.h [new file with mode: 0644]
src/tasks/LibraryBuilder/Templates/preloaded-assemblies.c [new file with mode: 0644]