Skip to content

Commit cbc08f4

Browse files
committed
Beginnings of CLR hosting
1 parent 0e11dc4 commit cbc08f4

35 files changed

+4349
-3
lines changed

Xamarin.Android.sln

+7
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Android.Sdk.Analy
125125
EndProject
126126
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "proguard-android", "src\proguard-android\proguard-android.csproj", "{5FD0133B-69E5-4474-9B67-9FD1D0150C70}"
127127
EndProject
128+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "native-clr", "src\native-clr\native-clr.csproj", "{AD6DF548-2BC0-44E2-9ADC-28B4A23A1F5B}"
129+
EndProject
128130
Global
129131
GlobalSection(SolutionConfigurationPlatforms) = preSolution
130132
Debug|AnyCPU = Debug|AnyCPU
@@ -347,6 +349,10 @@ Global
347349
{5FD0133B-69E5-4474-9B67-9FD1D0150C70}.Debug|AnyCPU.Build.0 = Debug|Any CPU
348350
{5FD0133B-69E5-4474-9B67-9FD1D0150C70}.Release|AnyCPU.ActiveCfg = Release|Any CPU
349351
{5FD0133B-69E5-4474-9B67-9FD1D0150C70}.Release|AnyCPU.Build.0 = Release|Any CPU
352+
{AD6DF548-2BC0-44E2-9ADC-28B4A23A1F5B}.Debug|AnyCPU.ActiveCfg = Debug|Any CPU
353+
{AD6DF548-2BC0-44E2-9ADC-28B4A23A1F5B}.Debug|AnyCPU.Build.0 = Debug|Any CPU
354+
{AD6DF548-2BC0-44E2-9ADC-28B4A23A1F5B}.Release|AnyCPU.ActiveCfg = Release|Any CPU
355+
{AD6DF548-2BC0-44E2-9ADC-28B4A23A1F5B}.Release|AnyCPU.Build.0 = Release|Any CPU
350356
EndGlobalSection
351357
GlobalSection(SolutionProperties) = preSolution
352358
HideSolutionNode = FALSE
@@ -406,6 +412,7 @@ Global
406412
{A39B6D7C-6616-40D6-8AE4-C6CEE93D2708} = {CAB438D8-B0F5-4AF0-BEBD-9E2ADBD7B483}
407413
{5E806C9F-1B67-4B6B-A6AB-258834250DBB} = {FFCF518F-2A4A-40A2-9174-2EE13B76C723}
408414
{5FD0133B-69E5-4474-9B67-9FD1D0150C70} = {FFCF518F-2A4A-40A2-9174-2EE13B76C723}
415+
{AD6DF548-2BC0-44E2-9ADC-28B4A23A1F5B} = {FFCF518F-2A4A-40A2-9174-2EE13B76C723}
409416
EndGlobalSection
410417
GlobalSection(ExtensibilityGlobals) = postSolution
411418
SolutionGuid = {53A1F287-EFB2-4D97-A4BB-4A5E145613F6}

build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.cs

+1
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ public static partial class Paths
175175
public static readonly string ExternalGitDepsDestDir = ExternalDir;
176176
public static readonly string ExternalXamarinAndroidToolsSln = Path.Combine (ExternalDir, "xamarin-android-tools", "Xamarin.Android.Tools.sln");
177177
public static readonly string NativeSourcesDir = Path.Combine (BuildPaths.XamarinAndroidSourceRoot, "src", "native");
178+
public static readonly string NativeCLRSourcesDir = Path.Combine (BuildPaths.XamarinAndroidSourceRoot, "src", "native-clr");
178179

179180
// Dynamic locations used throughout the code
180181
public static string ExternalJavaInteropDir => GetCachedPath (ref externalJavaInteropDir, () => ctx.Properties.GetRequiredValue (KnownProperties.JavaInteropFullPath));

build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs

+15-3
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ protected override async Task<bool> Execute (Context context)
5858
Get_Configuration_Generated_Props (context),
5959
Get_Cmake_XA_Build_Configuration (context),
6060
Get_Cmake_Presets (context),
61+
Get_Cmake_Presets_CLR (context),
6162
};
6263
} else {
6364
return new List <GeneratedFile> {
@@ -66,6 +67,7 @@ protected override async Task<bool> Execute (Context context)
6667
Get_Configuration_Generated_Props (context),
6768
Get_Cmake_XA_Build_Configuration (context),
6869
Get_Cmake_Presets (context),
70+
Get_Cmake_Presets_CLR (context),
6971
Get_Ndk_projitems (context),
7072
Get_XABuildConfig_cs (context),
7173
Get_Omnisharp_Json (context),
@@ -107,7 +109,7 @@ GeneratedFile Get_Cmake_XA_Build_Configuration (Context context)
107109
);
108110
}
109111

110-
GeneratedFile Get_Cmake_Presets (Context context)
112+
GeneratedFile GetCmakePresetsCommon (Context context, string sourcesDir)
111113
{
112114
const string OutputFileName = "CMakePresets.json";
113115

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

127129
return new GeneratedPlaceholdersFile (
128130
replacements,
129-
Path.Combine (Configurables.Paths.NativeSourcesDir, $"{OutputFileName}.in"),
130-
Path.Combine (Configurables.Paths.NativeSourcesDir, OutputFileName)
131+
Path.Combine (sourcesDir, $"{OutputFileName}.in"),
132+
Path.Combine (sourcesDir, OutputFileName)
131133
);
132134
}
133135

136+
GeneratedFile Get_Cmake_Presets (Context context)
137+
{
138+
return GetCmakePresetsCommon (context, Configurables.Paths.NativeSourcesDir);
139+
}
140+
141+
GeneratedFile Get_Cmake_Presets_CLR (Context context)
142+
{
143+
return GetCmakePresetsCommon (context, Configurables.Paths.NativeCLRSourcesDir);
144+
}
145+
134146
GeneratedFile Get_Configuration_Generated_Props (Context context)
135147
{
136148
const string OutputFileName = "Configuration.Generated.props";

src/native-clr/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CMakeUserPresets.json
2+
CMakePresets.json

0 commit comments

Comments
 (0)