diff --git a/Configuration.props b/Configuration.props
index b817667364a..a881c28cc21 100644
--- a/Configuration.props
+++ b/Configuration.props
@@ -231,7 +231,7 @@
$(AndroidSupportedTargetAotAbis.Split(':'))
- $(MSBuildThisFileDirectory)bin\Build$(Configuration)\remap-assembly-ref\remap-assembly-ref.exe
+ $(MSBuildThisFileDirectory)bin\Build$(Configuration)\remap-assembly-ref\remap-assembly-ref.dll
$(ManagedRuntime) $(ManagedRuntimeArgs) "$(RemapAssemblyRefToolExecutable)"
diff --git a/build-tools/api-merge/api-merge.csproj b/build-tools/api-merge/api-merge.csproj
index 4331e8673ca..b03a9ad4abb 100644
--- a/build-tools/api-merge/api-merge.csproj
+++ b/build-tools/api-merge/api-merge.csproj
@@ -3,7 +3,7 @@
Debug
Exe
- net472
+ $(DotNetStableTargetFramework)
false
..\..\bin\Build$(Configuration)
diff --git a/build-tools/api-xml-adjuster/api-xml-adjuster.csproj b/build-tools/api-xml-adjuster/api-xml-adjuster.csproj
index 774de0c6512..b12f7bbd7f8 100644
--- a/build-tools/api-xml-adjuster/api-xml-adjuster.csproj
+++ b/build-tools/api-xml-adjuster/api-xml-adjuster.csproj
@@ -3,7 +3,7 @@
Debug
Exe
- net472
+ $(DotNetStableTargetFramework)
false
..\..\bin\Build$(Configuration)
diff --git a/build-tools/check-boot-times/check-boot-times.csproj b/build-tools/check-boot-times/check-boot-times.csproj
index 5fb664b9916..c84be8ca82c 100644
--- a/build-tools/check-boot-times/check-boot-times.csproj
+++ b/build-tools/check-boot-times/check-boot-times.csproj
@@ -1,7 +1,7 @@
- net472
+ $(DotNetStableTargetFramework)
false
Exe
Xamarin.Android.Tools
diff --git a/build-tools/conjure-xamarin-android-cecil/conjure-xamarin-android-cecil.csproj b/build-tools/conjure-xamarin-android-cecil/conjure-xamarin-android-cecil.csproj
index 3cf73cc2264..469501afb30 100644
--- a/build-tools/conjure-xamarin-android-cecil/conjure-xamarin-android-cecil.csproj
+++ b/build-tools/conjure-xamarin-android-cecil/conjure-xamarin-android-cecil.csproj
@@ -1,7 +1,7 @@
- net472
+ $(DotNetStableTargetFramework)
false
Exe
Xamarin.Android.Prepare
diff --git a/build-tools/create-android-api/create-android-api.csproj b/build-tools/create-android-api/create-android-api.csproj
index 73f4a017a2e..dce4739f4e0 100644
--- a/build-tools/create-android-api/create-android-api.csproj
+++ b/build-tools/create-android-api/create-android-api.csproj
@@ -12,7 +12,7 @@
-
+
@@ -52,15 +52,15 @@
Outputs="@(ApiFileDefinition->'%(ClassParseXml)')">
- $(XamarinAndroidSourcePath)\bin\$(Configuration)\lib\xamarin.android\xbuild\Xamarin\Android\class-parse.exe
+ $(MicrosoftAndroidSdkOutDir)class-parse.dll
<_ClassParseCommands
Condition="Exists('$(XamarinAndroidSourcePath)\src\Mono.Android\Profiles\api-%(ApiFileDefinition.Id).params.txt')"
Include="@(ApiFileDefinition)">
- $(ClassParse)
- $(AndroidSdkDirectory)\platforms\android-%(ApiFileDefinition.Id)\android.jar -platform=%(ApiFileDefinition.Id) -parameter-names="%(ApiFileDefinition.ParameterDescription)" -o="%(ApiFileDefinition.ClassParseXml)"
+ $(DotNetPreviewTool)
+ $(ClassParse) $(AndroidSdkDirectory)\platforms\android-%(ApiFileDefinition.Id)\android.jar -platform=%(ApiFileDefinition.Id) -parameter-names="%(ApiFileDefinition.ParameterDescription)" -o="%(ApiFileDefinition.ClassParseXml)"
@@ -68,8 +68,6 @@
@@ -81,22 +79,20 @@
Outputs="@(ApiFileDefinition->'%(ApiAdjustedXml)')">
- $(XamarinAndroidSourcePath)\bin\Build$(Configuration)\api-xml-adjuster.exe
+ $(XamarinAndroidSourcePath)\bin\Build$(Configuration)\api-xml-adjuster.dll
<_AdjustApiXmlPrepareCommands
Condition="Exists('$(XamarinAndroidSourcePath)\src\Mono.Android\Profiles\api-%(ApiFileDefinition.Id).params.txt')"
Include="@(ApiFileDefinition)">
- $(ApiXmlAdjuster)
- %(ApiFileDefinition.ClassParseXml) %(ApiFileDefinition.ApiAdjustedXml)
+ $(DotNetPreviewTool)
+ $(ApiXmlAdjuster) %(ApiFileDefinition.ClassParseXml) %(ApiFileDefinition.ApiAdjustedXml)
@@ -108,24 +104,24 @@
Outputs="@(_MergedXmlFiles->'%(MergedXml)')">
- ..\..\bin\Build$(Configuration)\api-merge.exe
+ ..\..\bin\Build$(Configuration)\api-merge.dll
<_ConfigurationFile>..\..\bin\Build$(Configuration)\merge-configuration.xml
<_ConfigurationInputBaseDirectory>..\..\bin\Build$(Configuration)\api\
<_ConfigurationOutputBaseDirectory>..\..\bin\Build$(Configuration)\api\
+ Command=""$(DotNetPreviewTool)" $(ApiMerge) -config=$(_ConfigurationFile) -config-input-dir=$(_ConfigurationInputBaseDirectory) -config-output-dir=$(_ConfigurationOutputBaseDirectory)" />
@@ -140,4 +136,4 @@
-
\ No newline at end of file
+
diff --git a/build-tools/jnienv-gen/jnienv-gen.csproj b/build-tools/jnienv-gen/jnienv-gen.csproj
index 8a44f5fb401..d5cb4d773ce 100644
--- a/build-tools/jnienv-gen/jnienv-gen.csproj
+++ b/build-tools/jnienv-gen/jnienv-gen.csproj
@@ -3,7 +3,7 @@
Debug
Exe
- net472
+ $(DotNetStableTargetFramework)
false
..\..\bin\Build$(Configuration)
diff --git a/build-tools/plots-to-appinsights/ProcessPlotCSVFile.csproj b/build-tools/plots-to-appinsights/ProcessPlotCSVFile.csproj
index 6e9e5916ce9..158d8837964 100644
--- a/build-tools/plots-to-appinsights/ProcessPlotCSVFile.csproj
+++ b/build-tools/plots-to-appinsights/ProcessPlotCSVFile.csproj
@@ -3,7 +3,7 @@
Exe
- net472
+ $(DotNetStableTargetFramework)
false
Xamarin.Android.Tools.Plots
diff --git a/build-tools/remap-assembly-ref/remap-assembly-ref.csproj b/build-tools/remap-assembly-ref/remap-assembly-ref.csproj
index 950dbe36ec7..cacd4b29f8e 100644
--- a/build-tools/remap-assembly-ref/remap-assembly-ref.csproj
+++ b/build-tools/remap-assembly-ref/remap-assembly-ref.csproj
@@ -1,7 +1,7 @@
- net472
+ $(DotNetStableTargetFramework)
false
Exe
remapassemblyref
diff --git a/build-tools/xaprepare/xaprepare/Application/Utilities.cs b/build-tools/xaprepare/xaprepare/Application/Utilities.cs
index 53462f44d2c..3f1bdfbe1e0 100644
--- a/build-tools/xaprepare/xaprepare/Application/Utilities.cs
+++ b/build-tools/xaprepare/xaprepare/Application/Utilities.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
+using System.Linq;
using System.Net;
using System.Net.Http;
using System.Reflection;
@@ -796,6 +797,25 @@ public static bool RunCommand (string command, string? workingDirectory, bool ec
return runner.Run ();
}
+ public static bool RunManagedCommand (string command, string workingDirectory, bool ignoreEmptyArguments, params string [] arguments)
+ {
+ return RunManagedCommand (command, workingDirectory, echoStderr: true, ignoreEmptyArguments: ignoreEmptyArguments, arguments: arguments);
+ }
+
+ // This is a managed assembly that needs to be run as 'dotnet foo.dll'
+ public static bool RunManagedCommand (string command, string? workingDirectory, bool echoStderr, bool ignoreEmptyArguments, params string [] arguments)
+ {
+ if (string.IsNullOrEmpty (command))
+ throw new ArgumentException ("must not be null or empty", nameof (command));
+
+ var runner = new ProcessRunner ("dotnet", ignoreEmptyArguments, new [] { command }.Concat (arguments).ToArray ()) {
+ EchoStandardError = echoStderr,
+ WorkingDirectory = workingDirectory,
+ };
+
+ return runner.Run ();
+ }
+
public static string GetStringFromStdout (string command, params string?[] arguments)
{
return GetStringFromStdout (command, throwOnErrors: false, trimTrailingWhitespace: true, arguments: arguments);
diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_InstallMonoRuntimes.cs b/build-tools/xaprepare/xaprepare/Steps/Step_InstallMonoRuntimes.cs
index a8d3a30de74..287d5e56a67 100644
--- a/build-tools/xaprepare/xaprepare/Steps/Step_InstallMonoRuntimes.cs
+++ b/build-tools/xaprepare/xaprepare/Steps/Step_InstallMonoRuntimes.cs
@@ -106,17 +106,14 @@ async Task ConjureXamarinCecilAndRemapRef (Context context, bool haveManag
}
StatusStep (context, "Conjuring Xamarin.Android.Cecil and Xamari.Android.Cecil.Mdb");
- string conjurer = Path.Combine (Configurables.Paths.BuildBinDir, "conjure-xamarin-android-cecil.exe");
- string conjurerSourceDir = Configurables.Paths.MonoProfileToolsDir;
- string conjurerDestDir = Configurables.Paths.BuildBinDir;
+ string conjurer = Path.Combine (Configurables.Paths.BuildBinDir, "conjure-xamarin-android-cecil.dll");
- result = Utilities.RunCommand (
- haveManagedRuntime ? managedRuntime : conjurer, // command
+ result = Utilities.RunManagedCommand (
+ conjurer, // command
BuildPaths.XamarinAndroidSourceRoot, // workingDirectory
true, // ignoreEmptyArguments
// arguments
- haveManagedRuntime ? conjurer : String.Empty,
Configurables.Paths.MonoProfileToolsDir, // source dir
Configurables.Paths.BuildBinDir // destination dir
);
@@ -174,13 +171,12 @@ bool InstallUtilities (Context context, bool haveManagedRuntime, string managedR
string relDestFilePath = Utilities.GetRelativePath (BuildPaths.XamarinAndroidSourceRoot, destFilePath);
StatusSubStep (context, $"Remapping Cecil references for {relDestFilePath}");
- bool result = Utilities.RunCommand (
- haveManagedRuntime ? managedRuntime : remapper, // command
+ bool result = Utilities.RunManagedCommand (
+ remapper, // command
BuildPaths.XamarinAndroidSourceRoot, // workingDirectory
true, // ignoreEmptyArguments
// arguments
- haveManagedRuntime ? remapper : String.Empty,
Utilities.GetRelativePath (BuildPaths.XamarinAndroidSourceRoot, muf.SourcePath),
relDestFilePath,
"Mono.Cecil",
diff --git a/tools/decompress-assemblies/decompress-assemblies.csproj b/tools/decompress-assemblies/decompress-assemblies.csproj
index 049031e704c..d073ae2322d 100644
--- a/tools/decompress-assemblies/decompress-assemblies.csproj
+++ b/tools/decompress-assemblies/decompress-assemblies.csproj
@@ -4,7 +4,7 @@
Microsoft Corporation
2021 Microsoft Corporation
0.0.1
- net472
+ $(DotNetStableTargetFramework)
false
Xamarin.Android.Tools.DecompressAssemblies
decompress-assemblies
diff --git a/tools/javadoc2mdoc/javadoc2mdoc.csproj b/tools/javadoc2mdoc/javadoc2mdoc.csproj
index 74beb40b655..e87a01a86c3 100644
--- a/tools/javadoc2mdoc/javadoc2mdoc.csproj
+++ b/tools/javadoc2mdoc/javadoc2mdoc.csproj
@@ -1,6 +1,6 @@
- net472
+ $(DotNetStableTargetFramework)
false
Exe
Xamarin.Android.Tools.JavadocToMDoc
diff --git a/tools/jit-times/jit-times.csproj b/tools/jit-times/jit-times.csproj
index be61d248de0..49d84b9c3e5 100644
--- a/tools/jit-times/jit-times.csproj
+++ b/tools/jit-times/jit-times.csproj
@@ -2,7 +2,7 @@
Debug
Exe
- net472
+ $(DotNetStableTargetFramework)
false
diff --git a/tools/msbuild-fuzzer/msbuild-fuzzer.csproj b/tools/msbuild-fuzzer/msbuild-fuzzer.csproj
index 67253850627..c4ac46a77e8 100644
--- a/tools/msbuild-fuzzer/msbuild-fuzzer.csproj
+++ b/tools/msbuild-fuzzer/msbuild-fuzzer.csproj
@@ -1,6 +1,6 @@
- net472
+ $(DotNetStableTargetFramework)
{A3671983-ABC2-4693-8872-463427B57117}
Exe
diff --git a/tools/setup-windows/setup-windows.csproj b/tools/setup-windows/setup-windows.csproj
index 063e4dfe8c7..970eb7629fc 100644
--- a/tools/setup-windows/setup-windows.csproj
+++ b/tools/setup-windows/setup-windows.csproj
@@ -3,7 +3,7 @@
- net472
+ $(DotNetStableTargetFramework)
false
Exe
setupwindows