From 43f7d6b335ac7ed97e4e4425c2d544d1f925850c Mon Sep 17 00:00:00 2001 From: Jerome Laban Date: Sun, 11 Dec 2022 23:15:39 -0500 Subject: [PATCH 1/2] fix: Adjust for IntermediateOutputPath requiring a sub-path of the current project --- src/Uno.Wasm.Bootstrap/ShellTask.cs | 9 +++++++-- src/Uno.Wasm.Bootstrap/build/Uno.Wasm.Bootstrap.targets | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Uno.Wasm.Bootstrap/ShellTask.cs b/src/Uno.Wasm.Bootstrap/ShellTask.cs index e0b0b2e22..fc84ca47d 100644 --- a/src/Uno.Wasm.Bootstrap/ShellTask.cs +++ b/src/Uno.Wasm.Bootstrap/ShellTask.cs @@ -87,7 +87,7 @@ public partial class ShellTask_v0 : Microsoft.Build.Utilities.Task [Microsoft.Build.Framework.Required] public string IntermediateOutputPath { get; set; } = ""; [Microsoft.Build.Framework.Required] - public string BaseIntermediateOutputPath { get; set; } = ""; + public string ProjectDir { get; set; } = ""; [Microsoft.Build.Framework.Required] public string MonoWasmSDKPath { get; set; } = ""; @@ -318,7 +318,12 @@ private void TryEnableLongPathAware() } IntermediateOutputPath = TryConvertLongPath(IntermediateOutputPath); - BaseIntermediateOutputPath = TryConvertLongPath(Path.GetFullPath(BaseIntermediateOutputPath)); + + if (!Path.IsPathRooted(IntermediateOutputPath)) + { + IntermediateOutputPath = TryConvertLongPath(Path.Combine(ProjectDir, IntermediateOutputPath)); + } + DistPath = TryConvertLongPath(DistPath); CurrentProjectPath = TryConvertLongPath(CurrentProjectPath); CustomDebuggerPath = TryConvertLongPath(CustomDebuggerPath!); diff --git a/src/Uno.Wasm.Bootstrap/build/Uno.Wasm.Bootstrap.targets b/src/Uno.Wasm.Bootstrap/build/Uno.Wasm.Bootstrap.targets index 6cd7ad476..569b03813 100644 --- a/src/Uno.Wasm.Bootstrap/build/Uno.Wasm.Bootstrap.targets +++ b/src/Uno.Wasm.Bootstrap/build/Uno.Wasm.Bootstrap.targets @@ -211,7 +211,6 @@ AOTProfileExcludedMethods="$(WasmShellAOTProfileExcludedMethods)" Assembly="$(IntermediateOutputPath)$(TargetFileName)" Assets="@(Content)" - BaseIntermediateOutputPath="$(BaseIntermediateOutputPath)" BrotliCompressionQuality="$(WasmShellBrotliCompressionQuality)" BuildTaskBasePath="$(MSBuildThisFileDirectory)" CompressedExtensions="@(WasmShellCompressedExtension)" @@ -241,7 +240,7 @@ GenerateCompressedFiles="$(WasmShellGenerateCompressedFiles)" GeneratePrefetchHeaders="$(WashShellGeneratePrefetchHeaders)" IndexHtmlPath="$(WasmShellIndexHtmlPath)" - IntermediateOutputPath="$(ProjectDir)$(IntermediateOutputPath)" + IntermediateOutputPath="$(IntermediateOutputPath)" LogProfilerOptions="$(WasmShellLogProfilerOptions)" MixedModeExcludedAssembly="@(MonoRuntimeMixedModeExcludedAssembly)" MonoEnvironment="@(WasmShellMonoEnvironment)" @@ -253,6 +252,7 @@ ObfuscateAssemblies="$(WasmShellObfuscateAssemblies)" AssembliesFileExtension="$(WasmShellAssembliesExtension)" PackagerBinPath="$(_UnoMonoPackagerBinPath)" + ProjectDir="$(ProjectDir)" PThreadsPoolSize="$(WasmShellPThreadsPoolSize)" PWAManifestFile="$(WasmPWAManifestFile)" ReferencePath="@(_UnoWasmBootstrapAssembliesForReferenceCopyLocalPaths)" From 9e0ba031bfa1757ce80ae5607e98a57420d00e10 Mon Sep 17 00:00:00 2001 From: Jerome Laban Date: Tue, 13 Dec 2022 08:24:53 -0500 Subject: [PATCH 2/2] chore: Add IntermediateOutputPath change validation --- src/Uno.Wasm.Bootstrap-netcore-only.slnf | 1 + src/Uno.Wasm.Bootstrap.sln | 15 ++++++++--- .../Directory.Build.props | 12 +++++++++ .../Program.cs | 14 +++++++++++ ...Uno.Wasm.Tests.AbsoluteIntermediate.csproj | 25 +++++++++++++++++++ 5 files changed, 63 insertions(+), 4 deletions(-) create mode 100644 src/Uno.Wasm.Tests.AbsoluteIntermediate/Directory.Build.props create mode 100644 src/Uno.Wasm.Tests.AbsoluteIntermediate/Program.cs create mode 100644 src/Uno.Wasm.Tests.AbsoluteIntermediate/Uno.Wasm.Tests.AbsoluteIntermediate.csproj diff --git a/src/Uno.Wasm.Bootstrap-netcore-only.slnf b/src/Uno.Wasm.Bootstrap-netcore-only.slnf index 219a5b377..4ba06289d 100644 --- a/src/Uno.Wasm.Bootstrap-netcore-only.slnf +++ b/src/Uno.Wasm.Bootstrap-netcore-only.slnf @@ -30,6 +30,7 @@ "Uno.Wasm.Tests.Electron\\Uno.Wasm.Tests.Electron.csproj", "Uno.Wasm.Tests.Empty\\Uno.Wasm.Test.Empty.csproj", "Uno.Wasm.Tests.Shared\\Uno.Wasm.Tests.Shared.shproj", + "Uno.Wasm.Tests.AbsoluteIntermediate\\Uno.Wasm.Tests.AbsoluteIntermediate.csproj", "Uno.Wasm.Tests.TypeScript\\Uno.Wasm.Tests.TypeScript.csproj", "Uno.Wasm.Threads.Aot\\Uno.Wasm.Threads.Aot.csproj", "Uno.Wasm.Threads.Shared\\Uno.Wasm.Threads.Shared.shproj", diff --git a/src/Uno.Wasm.Bootstrap.sln b/src/Uno.Wasm.Bootstrap.sln index b6fecc3e4..4f3ec7892 100644 --- a/src/Uno.Wasm.Bootstrap.sln +++ b/src/Uno.Wasm.Bootstrap.sln @@ -131,6 +131,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Root", "_Root", "{70AAFC96 ..\Readme.md = ..\Readme.md EndProjectSection EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Uno.Wasm.Tests.AbsoluteIntermediate", "Uno.Wasm.Tests.AbsoluteIntermediate\Uno.Wasm.Tests.AbsoluteIntermediate.csproj", "{6584CC1B-2628-4872-851A-E85C0E572D39}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -309,14 +311,18 @@ Global {227B4962-4978-4712-8C52-630E2371A869}.Debug|Any CPU.Build.0 = Debug|Any CPU {227B4962-4978-4712-8C52-630E2371A869}.Release|Any CPU.ActiveCfg = Release|Any CPU {227B4962-4978-4712-8C52-630E2371A869}.Release|Any CPU.Build.0 = Release|Any CPU - {A7F3B4BF-A73D-4769-A78D-5F3CAC362AAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A7F3B4BF-A73D-4769-A78D-5F3CAC362AAF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A7F3B4BF-A73D-4769-A78D-5F3CAC362AAF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A7F3B4BF-A73D-4769-A78D-5F3CAC362AAF}.Release|Any CPU.Build.0 = Release|Any CPU {0527B6ED-6050-4B55-A602-31DD46CF5999}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0527B6ED-6050-4B55-A602-31DD46CF5999}.Debug|Any CPU.Build.0 = Debug|Any CPU {0527B6ED-6050-4B55-A602-31DD46CF5999}.Release|Any CPU.ActiveCfg = Release|Any CPU {0527B6ED-6050-4B55-A602-31DD46CF5999}.Release|Any CPU.Build.0 = Release|Any CPU + {A7F3B4BF-A73D-4769-A78D-5F3CAC362AAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A7F3B4BF-A73D-4769-A78D-5F3CAC362AAF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A7F3B4BF-A73D-4769-A78D-5F3CAC362AAF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A7F3B4BF-A73D-4769-A78D-5F3CAC362AAF}.Release|Any CPU.Build.0 = Release|Any CPU + {6584CC1B-2628-4872-851A-E85C0E572D39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6584CC1B-2628-4872-851A-E85C0E572D39}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6584CC1B-2628-4872-851A-E85C0E572D39}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6584CC1B-2628-4872-851A-E85C0E572D39}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -365,6 +371,7 @@ Global {2829B1BF-47C7-4284-9EAF-DEB48C4A0209} = {00F3A4D2-5534-44AF-B655-6209355E32A9} {227B4962-4978-4712-8C52-630E2371A869} = {5F914B7D-AFA2-4145-9548-B1B3A16D77AE} {A7F3B4BF-A73D-4769-A78D-5F3CAC362AAF} = {84D19B91-8728-4EBD-A6B2-D51F3B0EAB31} + {6584CC1B-2628-4872-851A-E85C0E572D39} = {35E84E5F-1C9B-4168-8333-216B456C12DF} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {FA350FE9-9316-4846-8145-356F9A0ACBC7} diff --git a/src/Uno.Wasm.Tests.AbsoluteIntermediate/Directory.Build.props b/src/Uno.Wasm.Tests.AbsoluteIntermediate/Directory.Build.props new file mode 100644 index 000000000..a01b7353e --- /dev/null +++ b/src/Uno.Wasm.Tests.AbsoluteIntermediate/Directory.Build.props @@ -0,0 +1,12 @@ + + + + $([System.IO.Path]::GetDirectoryName($([MSBuild]::GetPathOfFileAbove('.gitignore', '$(MSBuildThisFileDirectory)'))))\ + $(RepoRoot)\artifacts\bin\$(Configuration)\$(Platform)\ + $(BaseOutputPath)$(MSBuildProjectName)\ + $(RepoRoot)\artifacts\obj\$(Platform)\$(MSBuildProjectName)\ + $(BaseIntermediateOutputPath)\$(Configuration) + $(BaseIntermediateOutputPath)Generated Files\ + $(RepoRoot)packages\ + + diff --git a/src/Uno.Wasm.Tests.AbsoluteIntermediate/Program.cs b/src/Uno.Wasm.Tests.AbsoluteIntermediate/Program.cs new file mode 100644 index 000000000..4a9411459 --- /dev/null +++ b/src/Uno.Wasm.Tests.AbsoluteIntermediate/Program.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Uno.Wasm.Test.Empty +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Main"); + } + } +} diff --git a/src/Uno.Wasm.Tests.AbsoluteIntermediate/Uno.Wasm.Tests.AbsoluteIntermediate.csproj b/src/Uno.Wasm.Tests.AbsoluteIntermediate/Uno.Wasm.Tests.AbsoluteIntermediate.csproj new file mode 100644 index 000000000..35ecab804 --- /dev/null +++ b/src/Uno.Wasm.Tests.AbsoluteIntermediate/Uno.Wasm.Tests.AbsoluteIntermediate.csproj @@ -0,0 +1,25 @@ + + + + net5.0 + Exe + false + + InterpreterAndAOT + + + + + + + + + + + + false + true + TargetFramework + + +