diff --git a/Configuration.props b/Configuration.props index 870a4620286..38f3dcf8526 100644 --- a/Configuration.props +++ b/Configuration.props @@ -190,9 +190,6 @@ $(AndroidNdkDirectory)\ndk-build.cmd $(MicrosoftAndroidSdkOutDir)bundletool.jar - - $(MSBuildThisFileDirectory)bin/Build$(Configuration)/SourceLink.json - - + + + + + diff --git a/build-tools/xaprepare/xaprepare/Application/GeneratedFile.cs b/build-tools/xaprepare/xaprepare/Application/GeneratedFile.cs index a5aa9399fe4..a2c22860c50 100644 --- a/build-tools/xaprepare/xaprepare/Application/GeneratedFile.cs +++ b/build-tools/xaprepare/xaprepare/Application/GeneratedFile.cs @@ -36,16 +36,4 @@ protected void EnsureOutputDir () Utilities.CreateDirectory (Path.GetDirectoryName (OutputPath)); } } - - sealed class SkipGeneratedFile : GeneratedFile { - - public SkipGeneratedFile () - : base (Path.Combine (BuildPaths.XAPrepareSourceDir, "shall-not-exist.txt")) - { - } - - public override void Generate (Context context) - { - } - } } diff --git a/build-tools/xaprepare/xaprepare/Application/GeneratedSourceLinkJsonFile.cs b/build-tools/xaprepare/xaprepare/Application/GeneratedSourceLinkJsonFile.cs deleted file mode 100644 index 060fe510eba..00000000000 --- a/build-tools/xaprepare/xaprepare/Application/GeneratedSourceLinkJsonFile.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; - -namespace Xamarin.Android.Prepare -{ - class GeneratedSourceLinkJsonFile : GeneratedFile - { - IEnumerable submodules; - string xaCommit; - - public GeneratedSourceLinkJsonFile (IEnumerable submodules, string xaCommit, string outputPath) - : base (outputPath) - { - this.submodules = submodules ?? throw new ArgumentNullException (nameof (submodules)); - this.xaCommit = !string.IsNullOrEmpty (xaCommit) ? xaCommit : throw new ArgumentNullException (nameof (xaCommit)); - } - - public override void Generate (Context context) - { - var json = new StringBuilder (); - json.AppendLine ("{"); - json.AppendLine (" \"documents\": {"); - - foreach (var submodule in submodules.OrderBy (s => s.Name)) { - var localPath = Path.Combine (BuildPaths.XamarinAndroidSourceRoot, submodule.LocalPath); - - var contentUri = new UriBuilder (submodule.RepositoryUrl); - contentUri.Host = "raw.githubusercontent.com"; - contentUri.Path += $"/{submodule.CommitHash}"; - - json.AppendLine ($" \"{localPath}/*\": \"{contentUri.Uri}/*\","); - } - json.AppendLine ($" \"{BuildPaths.XamarinAndroidSourceRoot}/*\": \"https://raw.githubusercontent.com/dotnet/android/{xaCommit}/*\""); - json.AppendLine (" }"); - json.AppendLine ("}"); - - EnsureOutputDir (); - string outputData = json.ToString (); - File.WriteAllText (OutputPath, outputData, Utilities.UTF8NoBOM); - - if (!EchoOutput) - return; - - Log.DebugLine (); - Log.DebugLine ("--------------------------------------------"); - Log.DebugLine (outputData); - Log.DebugLine ("--------------------------------------------"); - Log.DebugLine (); - } - } -} diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs b/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs index e4e0f188916..96105963689 100644 --- a/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs +++ b/build-tools/xaprepare/xaprepare/Steps/Step_GenerateFiles.cs @@ -10,10 +10,6 @@ partial class Step_GenerateFiles : Step bool atBuildStart; bool onlyRequired; - IEnumerable? gitSubmodules; - string? xaCommit; - - public Step_GenerateFiles (bool atBuildStart, bool onlyRequired = false) : base ("Generating files required by the build") { @@ -21,14 +17,8 @@ public Step_GenerateFiles (bool atBuildStart, bool onlyRequired = false) this.onlyRequired = onlyRequired; } - protected override async Task Execute (Context context) + protected override Task Execute (Context context) { - var git = new GitRunner (context); - xaCommit = git.GetTopCommitHash (workingDirectory: BuildPaths.XamarinAndroidSourceRoot, shortHash: false); - var gitSubmoduleInfo = await git.ConfigList (new[]{"--blob", "HEAD:.gitmodules"}); - var gitSubmoduleStatus = await git.SubmoduleStatus (); - gitSubmodules = GitSubmoduleInfo.GetGitSubmodules (gitSubmoduleInfo, gitSubmoduleStatus); - List? filesToGenerate = GetFilesToGenerate (context); if (filesToGenerate != null && filesToGenerate.Count > 0) { foreach (GeneratedFile gf in filesToGenerate) { @@ -46,19 +36,16 @@ protected override async Task Execute (Context context) } } - return true; + return Task.FromResult (true); } List? GetFilesToGenerate (Context context) { if (atBuildStart) { if (onlyRequired) { - return new List { - Get_SourceLink_Json (context), - }; + return null; } else { return new List { - Get_SourceLink_Json (context), Get_Configuration_OperatingSystem_props (context), Get_XABuildConfig_cs (context), }; @@ -156,17 +143,5 @@ static string GetMinor (string value) return value.Substring (dot + 1); } } - - public GeneratedFile Get_SourceLink_Json (Context context) - { - if (gitSubmodules == null || xaCommit == null) { - return new SkipGeneratedFile (); - } - return new GeneratedSourceLinkJsonFile ( - gitSubmodules!, - xaCommit!, - Path.Combine (Configurables.Paths.BuildBinDir, "SourceLink.json") - ); - } } } diff --git a/src/Microsoft.Android.Run/Microsoft.Android.Run.csproj b/src/Microsoft.Android.Run/Microsoft.Android.Run.csproj index 1f2466451e5..8835a942438 100644 --- a/src/Microsoft.Android.Run/Microsoft.Android.Run.csproj +++ b/src/Microsoft.Android.Run/Microsoft.Android.Run.csproj @@ -15,7 +15,6 @@ -