Skip to content

Commit

Permalink
Rename to libruntime-android.so to libmonodroid.so (dotnet#37251)
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorBo authored Jun 2, 2020
1 parent 1cf4bde commit 3156f30
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/mono/mono/metadata/loader-internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#if defined(TARGET_OSX)
#define MONO_LOADER_LIBRARY_NAME "libcoreclr.dylib"
#elif defined(TARGET_ANDROID)
#define MONO_LOADER_LIBRARY_NAME "libruntime-android.so"
#define MONO_LOADER_LIBRARY_NAME "libmonodroid.so"
#else
#define MONO_LOADER_LIBRARY_NAME "libcoreclr.so"
#endif
Expand Down
14 changes: 7 additions & 7 deletions tools-local/tasks/mobile.tasks/AndroidAppBuilder/ApkBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public class ApkBuilder
if (!File.Exists(androidJar))
throw new ArgumentException($"API level={BuildApiLevel} is not downloaded in Android SDK");

// 1. Build libruntime-android.so` via cmake
// 1. Build libmonodroid.so` via cmake

string monoRuntimeLib = Path.Combine(sourceDir, "libmonosgen-2.0.a");
if (!File.Exists(monoRuntimeLib))
Expand All @@ -140,15 +140,15 @@ public class ApkBuilder
.Replace("%NativeLibrariesToLink%", monoRuntimeLib);
File.WriteAllText(Path.Combine(OutputDir, "CMakeLists.txt"), cmakeLists);

string runtimeAndroidSrc = Utils.GetEmbeddedResource("runtime-android.c")
string monodroidSrc = Utils.GetEmbeddedResource("monodroid.c")
.Replace("%EntryPointLibName%", Path.GetFileName(entryPointLib)
.Replace("%RID%", GetRid(abi)));
File.WriteAllText(Path.Combine(OutputDir, "runtime-android.c"), runtimeAndroidSrc);
File.WriteAllText(Path.Combine(OutputDir, "monodroid.c"), monodroidSrc);

string cmakeGenArgs = $"-DCMAKE_TOOLCHAIN_FILE={androidToolchain} -DANDROID_ABI=\"{abi}\" -DANDROID_STL=none " +
$"-DANDROID_NATIVE_API_LEVEL={MinApiLevel} -B runtime-android";
$"-DANDROID_NATIVE_API_LEVEL={MinApiLevel} -B monodroid";

string cmakeBuildArgs = "--build runtime-android";
string cmakeBuildArgs = "--build monodroid";

if (StripDebugSymbols)
{
Expand Down Expand Up @@ -192,7 +192,7 @@ public class ApkBuilder
Utils.RunProcess(aapt, $"package -f -m -F {apkFile} -A assets -M AndroidManifest.xml -I {androidJar}", workingDir: OutputDir);

var dynamicLibs = new List<string>();
dynamicLibs.Add(Path.Combine(OutputDir, "runtime-android", "libruntime-android.so"));
dynamicLibs.Add(Path.Combine(OutputDir, "monodroid", "libmonodroid.so"));
dynamicLibs.AddRange(Directory.GetFiles(sourceDir, "*.so"));

// add all *.so files to lib/%abi%/
Expand All @@ -202,7 +202,7 @@ public class ApkBuilder
string dynamicLibName = Path.GetFileName(dynamicLib);
if (dynamicLibName == "libmonosgen-2.0.so")
{
// we link mono runtime statically into libruntime-android.so
// we link mono runtime statically into libmonodroid.so
continue;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
cmake_minimum_required(VERSION 3.10)

project(runtime-android)
project(monodroid)

add_library(
runtime-android
monodroid
SHARED
runtime-android.c)
monodroid.c)

include_directories("%MonoInclude%")

target_link_libraries(
runtime-android
monodroid
%NativeLibrariesToLink%
libz.so
log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class MonoRunner extends Instrumentation
static MonoRunner inst;

static {
System.loadLibrary("runtime-android");
System.loadLibrary("monodroid");
}

@Override
Expand Down

0 comments on commit 3156f30

Please sign in to comment.