Skip to content

Commit

Permalink
Beginnings of CLR hosting
Browse files Browse the repository at this point in the history
  • Loading branch information
grendello committed Dec 2, 2024
1 parent 0e11dc4 commit cbc08f4
Show file tree
Hide file tree
Showing 35 changed files with 4,349 additions and 3 deletions.
7 changes: 7 additions & 0 deletions Xamarin.Android.sln
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Android.Sdk.Analy
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "proguard-android", "src\proguard-android\proguard-android.csproj", "{5FD0133B-69E5-4474-9B67-9FD1D0150C70}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "native-clr", "src\native-clr\native-clr.csproj", "{AD6DF548-2BC0-44E2-9ADC-28B4A23A1F5B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|AnyCPU = Debug|AnyCPU
Expand Down Expand Up @@ -347,6 +349,10 @@ Global
{5FD0133B-69E5-4474-9B67-9FD1D0150C70}.Debug|AnyCPU.Build.0 = Debug|Any CPU
{5FD0133B-69E5-4474-9B67-9FD1D0150C70}.Release|AnyCPU.ActiveCfg = Release|Any CPU
{5FD0133B-69E5-4474-9B67-9FD1D0150C70}.Release|AnyCPU.Build.0 = Release|Any CPU
{AD6DF548-2BC0-44E2-9ADC-28B4A23A1F5B}.Debug|AnyCPU.ActiveCfg = Debug|Any CPU
{AD6DF548-2BC0-44E2-9ADC-28B4A23A1F5B}.Debug|AnyCPU.Build.0 = Debug|Any CPU
{AD6DF548-2BC0-44E2-9ADC-28B4A23A1F5B}.Release|AnyCPU.ActiveCfg = Release|Any CPU
{AD6DF548-2BC0-44E2-9ADC-28B4A23A1F5B}.Release|AnyCPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -406,6 +412,7 @@ Global
{A39B6D7C-6616-40D6-8AE4-C6CEE93D2708} = {CAB438D8-B0F5-4AF0-BEBD-9E2ADBD7B483}
{5E806C9F-1B67-4B6B-A6AB-258834250DBB} = {FFCF518F-2A4A-40A2-9174-2EE13B76C723}
{5FD0133B-69E5-4474-9B67-9FD1D0150C70} = {FFCF518F-2A4A-40A2-9174-2EE13B76C723}
{AD6DF548-2BC0-44E2-9ADC-28B4A23A1F5B} = {FFCF518F-2A4A-40A2-9174-2EE13B76C723}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {53A1F287-EFB2-4D97-A4BB-4A5E145613F6}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ public static partial class Paths
public static readonly string ExternalGitDepsDestDir = ExternalDir;
public static readonly string ExternalXamarinAndroidToolsSln = Path.Combine (ExternalDir, "xamarin-android-tools", "Xamarin.Android.Tools.sln");
public static readonly string NativeSourcesDir = Path.Combine (BuildPaths.XamarinAndroidSourceRoot, "src", "native");
public static readonly string NativeCLRSourcesDir = Path.Combine (BuildPaths.XamarinAndroidSourceRoot, "src", "native-clr");

// Dynamic locations used throughout the code
public static string ExternalJavaInteropDir => GetCachedPath (ref externalJavaInteropDir, () => ctx.Properties.GetRequiredValue (KnownProperties.JavaInteropFullPath));
Expand Down
18 changes: 15 additions & 3 deletions build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ protected override async Task<bool> Execute (Context context)
Get_Configuration_Generated_Props (context),
Get_Cmake_XA_Build_Configuration (context),
Get_Cmake_Presets (context),
Get_Cmake_Presets_CLR (context),
};
} else {
return new List <GeneratedFile> {
Expand All @@ -66,6 +67,7 @@ protected override async Task<bool> Execute (Context context)
Get_Configuration_Generated_Props (context),
Get_Cmake_XA_Build_Configuration (context),
Get_Cmake_Presets (context),
Get_Cmake_Presets_CLR (context),
Get_Ndk_projitems (context),
Get_XABuildConfig_cs (context),
Get_Omnisharp_Json (context),
Expand Down Expand Up @@ -107,7 +109,7 @@ GeneratedFile Get_Cmake_XA_Build_Configuration (Context context)
);
}

GeneratedFile Get_Cmake_Presets (Context context)
GeneratedFile GetCmakePresetsCommon (Context context, string sourcesDir)
{
const string OutputFileName = "CMakePresets.json";

Expand All @@ -126,11 +128,21 @@ GeneratedFile Get_Cmake_Presets (Context context)

return new GeneratedPlaceholdersFile (
replacements,
Path.Combine (Configurables.Paths.NativeSourcesDir, $"{OutputFileName}.in"),
Path.Combine (Configurables.Paths.NativeSourcesDir, OutputFileName)
Path.Combine (sourcesDir, $"{OutputFileName}.in"),
Path.Combine (sourcesDir, OutputFileName)
);
}

GeneratedFile Get_Cmake_Presets (Context context)
{
return GetCmakePresetsCommon (context, Configurables.Paths.NativeSourcesDir);
}

GeneratedFile Get_Cmake_Presets_CLR (Context context)
{
return GetCmakePresetsCommon (context, Configurables.Paths.NativeCLRSourcesDir);
}

GeneratedFile Get_Configuration_Generated_Props (Context context)
{
const string OutputFileName = "Configuration.Generated.props";
Expand Down
2 changes: 2 additions & 0 deletions src/native-clr/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CMakeUserPresets.json
CMakePresets.json
Loading

0 comments on commit cbc08f4

Please sign in to comment.