Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
1d8483b
Apple side of the library builder
Jan 11, 2023
6cc724f
Embed framework through cmake on iOS. Add android fragments
Jan 12, 2023
bbf6992
Android library build
Jan 18, 2023
0055975
Bring back android exports
Jan 19, 2023
76cdbe4
Fix android library build by getting rid of force_load as that is onl…
Jan 21, 2023
9caea1f
Merge remote-tracking branch 'upstream/main' into lib-builder-mobile
Jan 24, 2023
9c3d805
Android builds library in separate cmake. iOS does too, but there are…
Feb 1, 2023
37fde1a
Add ability to pass in library projects to the main app
Feb 6, 2023
e3d1fd4
Clean up Android and scale back iOS to just building the library.
Feb 8, 2023
3911d2c
Merge remote-tracking branch 'upstream/main' into lib-builder-mobile
Feb 8, 2023
9bb0dd9
Move symbol table stripping to its own method
Feb 8, 2023
4ed46bf
Revert aotcompiler.c workaround
Feb 8, 2023
fde2bda
Condition some of the library builder specific items
Feb 8, 2023
d6fd785
Cleanup
Feb 9, 2023
cde3f9d
Add library builder tasks as a correlation payload.
Feb 10, 2023
6ba6aa9
Remove unnecessary librarybuilder props import
Feb 10, 2023
ba37138
Feedback
Feb 13, 2023
d3c03ac
Make sure sample provides linker arg items
Feb 14, 2023
04acf6c
Linker args in runtime test build
Feb 14, 2023
f4c204f
Merge remote-tracking branch 'upstream/main' into lib-builder-mobile
Feb 22, 2023
2ccf282
Make the runtime libraries to link actually work
Feb 23, 2023
807844e
Add default list of pinvokes for android aot
Feb 23, 2023
55e98f5
Merge remote-tracking branch 'upstream/main' into lib-builder-mobile
Feb 28, 2023
340a02f
Feedback
Feb 28, 2023
09aab3c
Remove extra symbols to keep. Condition direct icalls and direct pinv…
Mar 1, 2023
c99889b
PR feedback. Add test UnmanagedCallersOnly back in
Mar 1, 2023
223cf3a
Remove autoinit.c as it will come back in a follow up
Mar 1, 2023
e641c28
Generate list of assemblies that contained unmanagedcallersonly attri…
Mar 4, 2023
6a23439
More feedback
Mar 6, 2023
e272bb0
Merge remote-tracking branch 'upstream/main' into lib-builder-mobile
Mar 6, 2023
f30804d
Ignore CA1850 in the library builder
Mar 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Cleanup
  • Loading branch information
Steve Pfister committed Feb 10, 2023
commit d6fd78502943f95fdb059ca272d17164d494e185
2 changes: 1 addition & 1 deletion src/mono/msbuild/apple/build/AppleApp.LocalBuild.props
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<MonoAOTCompilerDir>$([MSBuild]::NormalizeDirectory($(BuildBaseDir), 'MonoAOTCompiler'))</MonoAOTCompilerDir>
<MonoTargetsTasksDir>$([MSBuild]::NormalizeDirectory($(BuildBaseDir), 'MonoTargetsTasks'))</MonoTargetsTasksDir>
<AppleAppBuilderDir>$([MSBuild]::NormalizeDirectory($(BuildBaseDir), 'AppleAppBuilder'))</AppleAppBuilderDir>
<LibraryBuilderDir>$([MSBuild]::NormalizeDirectory($(BuildBaseDir), 'LibraryBuilder'))</AppleAppBuilderDir>
<LibraryBuilderDir>$([MSBuild]::NormalizeDirectory($(BuildBaseDir), 'LibraryBuilder'))</LibraryBuilderDir>

<MonoAotCrossDir>$([MSBuild]::NormalizePath($(BuildBaseDir), 'cross'))</MonoAotCrossDir>
<_MonoAotCrossCompilerPath>$([MSBuild]::NormalizePath($(MonoAotCrossDir), 'mono-aot-cross'))</_MonoAotCrossCompilerPath>
Expand Down
4 changes: 4 additions & 0 deletions src/tasks/AndroidAppBuilder/ApkBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,8 @@ public ApkBuilder(TaskLoggingHelper logger)
File.WriteAllText(javaActivityPath,
Utils.GetEmbeddedResource("MainActivity.java")
.Replace("%EntryPointLibName%", Path.GetFileName(mainLibraryFileName)));


if (!string.IsNullOrEmpty(NativeMainSource))
File.Copy(NativeMainSource, javaActivityPath, true);

Expand All @@ -407,8 +409,10 @@ public ApkBuilder(TaskLoggingHelper logger)
envVariables += $"\t\tsetEnv(\"{name}\", \"{value}\");\n";
}

string jniLibraryName = (IsLibraryMode) ? ProjectName! : "System.Security.Cryptography.Native.Android";
string monoRunner = Utils.GetEmbeddedResource("MonoRunner.java")
.Replace("%EntryPointLibName%", Path.GetFileName(mainLibraryFileName))
.Replace("%JNI_LIBRARY_NAME%", jniLibraryName)
.Replace("%EnvVariables%", envVariables);

File.WriteAllText(monoRunnerPath, monoRunner);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ add_library(
monodroid
SHARED
monodroid.c
%AotModulesSource%
)

%AotSources%
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/AndroidAppBuilder/Templates/MonoRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class MonoRunner extends Instrumentation
{
static {
// loadLibrary triggers JNI_OnLoad in these libs
System.loadLibrary("Android.Device_Emulator.Aot_Llvm.Test");
System.loadLibrary("%JNI_LIBRARY_NAME%");
System.loadLibrary("monodroid");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one doesn't make sense in library mode right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's still necessary because the only difference in library mode is that it's linked into the library.

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

public static class Program
{
[UnmanagedCallersOnly(EntryPoint="HelloSteve")]
public static void HelloSteve()
[UnmanagedCallersOnly(EntryPoint="SayHello")]
public static void SayHello()
{
Console.WriteLine("Called from the outside! Hello!");
Console.WriteLine("Called from native! Hello!");
}

public static int Main()
Expand Down
6 changes: 3 additions & 3 deletions src/tests/FunctionalTests/iOS/Device/AOT-LLVM/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ public static class Program
[DllImport("__Internal")]
public static extern void mono_ios_set_summary (string value);

[UnmanagedCallersOnly(EntryPoint="HelloSteve")]
public static void HelloSteve()
[UnmanagedCallersOnly(EntryPoint="SayHello")]
public static void SayHello()
{
Console.WriteLine("Called from the outside! Hello!");
Console.WriteLine("Called from native! Hello!");
}

public static async Task<int> Main(string[] args)
Expand Down