Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ static class KnownProperties
public const string CommandLineToolsVersion = nameof (CommandLineToolsVersion);
public const string CommandLineToolsFolder = nameof (CommandLineToolsFolder);
public const string DotNetPreviewPath = "DotNetPreviewPath";
public const string DotNetPreviewVersionBand = nameof (DotNetPreviewVersionBand);
public const string MicrosoftDotnetSdkInternalPackageVersion = "MicrosoftDotnetSdkInternalPackageVersion";
public const string MicrosoftNETCoreAppRefPackageVersion = "MicrosoftNETCoreAppRefPackageVersion";
public const string EmulatorVersion = "EmulatorVersion";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace Xamarin.Android.Prepare
properties.Add (KnownProperties.CommandLineToolsFolder, StripQuotes ("@CommandLineToolsFolder@"));
properties.Add (KnownProperties.CommandLineToolsVersion, StripQuotes ("@CommandLineToolsVersion@"));
properties.Add (KnownProperties.DotNetPreviewPath, StripQuotes (@"@DotNetPreviewPath@"));
properties.Add (KnownProperties.DotNetPreviewVersionBand, StripQuotes (@"@DotNetPreviewVersionBand@"));
properties.Add (KnownProperties.MicrosoftDotnetSdkInternalPackageVersion, StripQuotes ("@MicrosoftDotnetSdkInternalPackageVersion@"));
properties.Add (KnownProperties.MicrosoftNETCoreAppRefPackageVersion, StripQuotes ("@MicrosoftNETCoreAppRefPackageVersion@"));
properties.Add (KnownProperties.EmulatorVersion, StripQuotes ("@EmulatorVersion@"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,13 @@ public static partial class Paths
public static string NetcoreAppRuntimeAndroidX86 => GetCachedPath (ref netcoreAppRuntimeAndroidX86, () => GetNetcoreAppRuntimePath (ctx, "x86"));
public static string NetcoreAppRuntimeAndroidX86_64 => GetCachedPath (ref netcoreAppRuntimeAndroidX86_64, () => GetNetcoreAppRuntimePath (ctx, "x64"));

public static string MicrosoftNETWorkloadMonoToolChainDir => Path.Combine (
XAPackagesDir,
$"microsoft.net.workload.mono.toolchain.manifest-{ctx.Properties.GetRequiredValue (KnownProperties.DotNetPreviewVersionBand)}",
ctx.Properties.GetRequiredValue (KnownProperties.MicrosoftNETCoreAppRefPackageVersion),
"data"
);

// CMake
public static string CmakeMSBuildPropsName = "cmake-config.props";
public static string CmakeShellScriptsPropsName = "cmake-config.sh";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,27 @@ protected override async Task<bool> Execute (Context context)
// Install runtime packs associated with the SDK previously installed.
var packageDownloadProj = Path.Combine (BuildPaths.XamarinAndroidSourceRoot, "build-tools", "xaprepare", "xaprepare", "package-download.proj");
var logPath = Path.Combine (Configurables.Paths.BuildBinDir, $"msbuild-{context.BuildTimeStamp}-download-runtime-packs.binlog");
return Utilities.RunCommand (dotnetTool, new string [] { "restore", ProcessRunner.QuoteArgument (packageDownloadProj), ProcessRunner.QuoteArgument ($"-bl:{logPath}") });
if (!Utilities.RunCommand (dotnetTool, new string [] { "restore", ProcessRunner.QuoteArgument (packageDownloadProj), ProcessRunner.QuoteArgument ($"-bl:{logPath}") })) {
Log.ErrorLine ($"dotnet restore {packageDownloadProj} failed.");
return false;
}

// Copy the WorkloadManifest.* files from the latest Microsoft.NET.Workload.Mono.ToolChain listed in package-download.proj
var destination = Path.Combine (dotnetPath, "sdk-manifests",
context.Properties.GetRequiredValue (KnownProperties.DotNetPreviewVersionBand),
"Microsoft.NET.Workload.Mono.ToolChain"
);
foreach (var file in Directory.GetFiles (Configurables.Paths.MicrosoftNETWorkloadMonoToolChainDir, "WorkloadManifest.*")) {
Utilities.CopyFileToDir (file, destination);
}

// Install the microsoft-net-runtime-android workload
if (!Utilities.RunCommand (dotnetTool, new [] { "workload", "install", "microsoft-net-runtime-android", "--skip-manifest-update", "--verbosity", "diag" })) {
Log.ErrorLine ($"dotnet workload install failed.");
return false;
}

return true;
}

async Task<bool> InstallDotNetAsync (Context context, string dotnetPath, string version, bool runtimeOnly = false)
Expand Down
1 change: 1 addition & 0 deletions build-tools/xaprepare/xaprepare/package-download.proj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Otherwise, $(MicrosoftNETCoreAppRefPackageVersion) from eng/Versions.props will
<PackageDownload Include="Microsoft.NETCore.App.Runtime.Mono.android-arm64" Version="[$(DotNetRuntimePacksVersion)]" />
<PackageDownload Include="Microsoft.NETCore.App.Runtime.Mono.android-x86" Version="[$(DotNetRuntimePacksVersion)]" />
<PackageDownload Include="Microsoft.NETCore.App.Runtime.Mono.android-x64" Version="[$(DotNetRuntimePacksVersion)]" />
<PackageDownload Include="Microsoft.NET.Workload.Mono.ToolChain.Manifest-$(DotNetPreviewVersionBand)" Version="[$(DotNetRuntimePacksVersion)]" />
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions build-tools/xaprepare/xaprepare/xaprepare.targets
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
<Replacement Include="@CommandLineToolsFolder@=$(CommandLineToolsFolder)" />
<Replacement Include="@CommandLineToolsVersion@=$(CommandLineToolsVersion)" />
<Replacement Include="@DotNetPreviewPath@=$(DotNetPreviewPath)" />
<Replacement Include="@DotNetPreviewVersionBand@=$(DotNetPreviewVersionBand)" />
<Replacement Include="@MicrosoftDotnetSdkInternalPackageVersion@=$(MicrosoftDotnetSdkInternalPackageVersion)" />
<Replacement Include="@MicrosoftNETCoreAppRefPackageVersion@=$(MicrosoftNETCoreAppRefPackageVersion)" />
<Replacement Include="@EmulatorVersion@=$(EmulatorVersion)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"Microsoft.Android.Sdk.BundleTool",
"Microsoft.Android.Ref",
"Microsoft.Android.Templates"
]
],
"extends" : [ "microsoft-net-runtime-android" ]
}
},
"packs": {
Expand Down