From c646cbd7f91e3c563b558d06f86dd1adb804c447 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Laban?= Date: Thu, 7 Apr 2022 09:22:07 -0400 Subject: [PATCH] feat: Add support for multiple output merged files (#50) --- README.md | 18 ++ .../{mergedpages.xaml => mergedpages01.xaml} | 0 .../TestLibrary/Generated/mergedpages02.xaml | 1 + src/UWP/TestLibrary/TestLibrary.csproj | 80 +++---- .../Generated/mergedpages.xaml | 38 ++++ .../TestLibrarySingleFile/Inner1/Colors.xaml | 8 + .../Inner1/ImplicitConflict.xaml | 16 ++ .../Inner1/ResourceDictionary2.xaml | 42 ++++ .../TestLibrarySingleFile/Inner1/_test.xaml | 10 + .../ResourceDictionary1.xaml | 8 + .../TestLibrarySingleFile.csproj | 61 +++++ .../TestLibrarySingleFile/Themes/Generic.xaml | 12 + src/Uno.XamlMerge.Task.sln | 77 ++++++- src/Uno.XamlMerge.Task/BatchMergeXaml.cs | 215 +++++++++++------- src/Uno.XamlMerge.Task/CustomTask.cs | 12 +- src/Uno.XamlMerge.Task/FullPathComparer.cs | 20 ++ src/Uno.XamlMerge.Task/GeneratePageList_v0.cs | 35 +++ .../Utilities/FileUtilities.cs | 97 ++++++++ .../build/Uno.XamlMerge.Task.targets | 51 ++--- .../Given_BatchMergeXaml.cs | 79 ++++++- .../Input_1.Output1.xml | 8 + .../Input_1.Output2.xml | 8 + .../Input_1.Output3.xml | 8 + .../Input_2.Output1.xml | 8 + .../Input_2.Output2.xml | 8 + .../Input_2.Output3.xml | 8 + .../expected.Output1.xml | 6 + .../expected.Output2.xml | 6 + .../expected.Output3.xml | 6 + .../Input_1.Output1.xml | 8 + .../Input_1.Output2.xml | 8 + .../Input_2.Output1.xml | 8 + .../Input_2.Output2.xml | 8 + .../expected.Output1.xml | 6 + .../expected.Output2.xml | 6 + 35 files changed, 814 insertions(+), 176 deletions(-) rename src/UWP/TestLibrary/Generated/{mergedpages.xaml => mergedpages01.xaml} (100%) create mode 100644 src/UWP/TestLibrary/Generated/mergedpages02.xaml create mode 100644 src/UWP/TestLibrarySingleFile/Generated/mergedpages.xaml create mode 100644 src/UWP/TestLibrarySingleFile/Inner1/Colors.xaml create mode 100644 src/UWP/TestLibrarySingleFile/Inner1/ImplicitConflict.xaml create mode 100644 src/UWP/TestLibrarySingleFile/Inner1/ResourceDictionary2.xaml create mode 100644 src/UWP/TestLibrarySingleFile/Inner1/_test.xaml create mode 100644 src/UWP/TestLibrarySingleFile/ResourceDictionary1.xaml create mode 100644 src/UWP/TestLibrarySingleFile/TestLibrarySingleFile.csproj create mode 100644 src/UWP/TestLibrarySingleFile/Themes/Generic.xaml create mode 100644 src/Uno.XamlMerge.Task/FullPathComparer.cs create mode 100644 src/Uno.XamlMerge.Task/GeneratePageList_v0.cs create mode 100644 src/Uno.XamlMerge.Task/Utilities/FileUtilities.cs create mode 100644 src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/Input_1.Output1.xml create mode 100644 src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/Input_1.Output2.xml create mode 100644 src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/Input_1.Output3.xml create mode 100644 src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/Input_2.Output1.xml create mode 100644 src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/Input_2.Output2.xml create mode 100644 src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/Input_2.Output3.xml create mode 100644 src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/expected.Output1.xml create mode 100644 src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/expected.Output2.xml create mode 100644 src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/expected.Output3.xml create mode 100644 src/Uno.XamlMerge.Tests/Scenarios/When_Two_MergeFiles_Single_Input/Input_1.Output1.xml create mode 100644 src/Uno.XamlMerge.Tests/Scenarios/When_Two_MergeFiles_Single_Input/Input_1.Output2.xml create mode 100644 src/Uno.XamlMerge.Tests/Scenarios/When_Two_MergeFiles_Single_Input/Input_2.Output1.xml create mode 100644 src/Uno.XamlMerge.Tests/Scenarios/When_Two_MergeFiles_Single_Input/Input_2.Output2.xml create mode 100644 src/Uno.XamlMerge.Tests/Scenarios/When_Two_MergeFiles_Single_Input/expected.Output1.xml create mode 100644 src/Uno.XamlMerge.Tests/Scenarios/When_Two_MergeFiles_Single_Input/expected.Output2.xml diff --git a/README.md b/README.md index 7c600cf..371b588 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,24 @@ Otherwise, the generated file can be referenced as follows: ``` +## Multiple generated files +There are scenarios where placing groups of XAML files in separate merged file are useful, particularly when IL Linking must be used. + +In this case, the project file must be defined as follows: +```xml + + + + + + + + + +``` + +In this case, the `XamlMergeOutputFile` cannot be used, as the `XamlMergeOutputFiles` is defined. + ## Troubleshooting - Make sure that all namespaces definitions across files are of the same values. (e.g. `xlmns:ns1="http://site1"` and `xlmns:ns1="http://site2"` in two different files will fail) - If you include the same resource dictionary (e.g. Colors.xaml) file in multiple merged files (generally used to have a file for custom brushes and colors), you can remove those multiple inclusions. diff --git a/src/UWP/TestLibrary/Generated/mergedpages.xaml b/src/UWP/TestLibrary/Generated/mergedpages01.xaml similarity index 100% rename from src/UWP/TestLibrary/Generated/mergedpages.xaml rename to src/UWP/TestLibrary/Generated/mergedpages01.xaml diff --git a/src/UWP/TestLibrary/Generated/mergedpages02.xaml b/src/UWP/TestLibrary/Generated/mergedpages02.xaml new file mode 100644 index 0000000..26507bf --- /dev/null +++ b/src/UWP/TestLibrary/Generated/mergedpages02.xaml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/UWP/TestLibrary/TestLibrary.csproj b/src/UWP/TestLibrary/TestLibrary.csproj index 84abbb7..efb6c52 100644 --- a/src/UWP/TestLibrary/TestLibrary.csproj +++ b/src/UWP/TestLibrary/TestLibrary.csproj @@ -1,48 +1,50 @@  - - - uap10.0.19041;netstandard2.0;net6.0-ios;net6.0-macos;net6.0-maccatalyst;net6.0-android - - true - - - - - - - - %(Filename) - - - - - - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - - Designer - - + + uap10.0.19041;netstandard2.0;net6.0-ios;net6.0-macos;net6.0-maccatalyst;net6.0-android + + true + + + + + + + + %(Filename) + + + + + + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + - + + + diff --git a/src/UWP/TestLibrarySingleFile/Generated/mergedpages.xaml b/src/UWP/TestLibrarySingleFile/Generated/mergedpages.xaml new file mode 100644 index 0000000..67fb040 --- /dev/null +++ b/src/UWP/TestLibrarySingleFile/Generated/mergedpages.xaml @@ -0,0 +1,38 @@ + + + + + + + #FF3399FF + Symbols + Symbols + Symbols + ms-appx:///Assets/Fonts/uno-fluentui-assets.ttf#Symbols + ms-appx:///Assets/Fonts/uno-fluentui-assets.ttf#Symbols + + + + TestLibrary String 02 + + + + + + + + + + + + + + TestLibrary String 02 + + + TestLibrary String + \ No newline at end of file diff --git a/src/UWP/TestLibrarySingleFile/Inner1/Colors.xaml b/src/UWP/TestLibrarySingleFile/Inner1/Colors.xaml new file mode 100644 index 0000000..998eeb2 --- /dev/null +++ b/src/UWP/TestLibrarySingleFile/Inner1/Colors.xaml @@ -0,0 +1,8 @@ + + + TestLibrary String 02 + + diff --git a/src/UWP/TestLibrarySingleFile/Inner1/ImplicitConflict.xaml b/src/UWP/TestLibrarySingleFile/Inner1/ImplicitConflict.xaml new file mode 100644 index 0000000..c37ee8d --- /dev/null +++ b/src/UWP/TestLibrarySingleFile/Inner1/ImplicitConflict.xaml @@ -0,0 +1,16 @@ + + + + + + diff --git a/src/UWP/TestLibrarySingleFile/Inner1/ResourceDictionary2.xaml b/src/UWP/TestLibrarySingleFile/Inner1/ResourceDictionary2.xaml new file mode 100644 index 0000000..61a0bf7 --- /dev/null +++ b/src/UWP/TestLibrarySingleFile/Inner1/ResourceDictionary2.xaml @@ -0,0 +1,42 @@ + + + + + + #FF3399FF + + Symbols + Symbols + Symbols + ms-appx:///Assets/Fonts/uno-fluentui-assets.ttf#Symbols + ms-appx:///Assets/Fonts/uno-fluentui-assets.ttf#Symbols + + + + TestLibrary String 02 + + + + + + + + + + + + + TestLibrary String 02 + + diff --git a/src/UWP/TestLibrarySingleFile/Inner1/_test.xaml b/src/UWP/TestLibrarySingleFile/Inner1/_test.xaml new file mode 100644 index 0000000..ba1d5fa --- /dev/null +++ b/src/UWP/TestLibrarySingleFile/Inner1/_test.xaml @@ -0,0 +1,10 @@ + + + + + + + diff --git a/src/UWP/TestLibrarySingleFile/ResourceDictionary1.xaml b/src/UWP/TestLibrarySingleFile/ResourceDictionary1.xaml new file mode 100644 index 0000000..05b9edf --- /dev/null +++ b/src/UWP/TestLibrarySingleFile/ResourceDictionary1.xaml @@ -0,0 +1,8 @@ + + + TestLibrary String + + diff --git a/src/UWP/TestLibrarySingleFile/TestLibrarySingleFile.csproj b/src/UWP/TestLibrarySingleFile/TestLibrarySingleFile.csproj new file mode 100644 index 0000000..fcbfc0b --- /dev/null +++ b/src/UWP/TestLibrarySingleFile/TestLibrarySingleFile.csproj @@ -0,0 +1,61 @@ + + + + uap10.0.19041;netstandard2.0;net6.0-ios;net6.0-macos;net6.0-maccatalyst;net6.0-android + + true + + + + + + + + %(Filename) + + + + + + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + + + + + + + + + + false + true + TargetFramework + + + + + + + \ No newline at end of file diff --git a/src/UWP/TestLibrarySingleFile/Themes/Generic.xaml b/src/UWP/TestLibrarySingleFile/Themes/Generic.xaml new file mode 100644 index 0000000..ec083d2 --- /dev/null +++ b/src/UWP/TestLibrarySingleFile/Themes/Generic.xaml @@ -0,0 +1,12 @@ + + + + + + + + test01 + diff --git a/src/Uno.XamlMerge.Task.sln b/src/Uno.XamlMerge.Task.sln index b21573f..27dd0d1 100644 --- a/src/Uno.XamlMerge.Task.sln +++ b/src/Uno.XamlMerge.Task.sln @@ -25,17 +25,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XamlMergeUWPTest.Wasm", "UW EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XamlMergeUWPTest.Skia.Gtk", "UWP\XamlMergeUWPTest\XamlMergeUWPTest.Skia.Gtk\XamlMergeUWPTest.Skia.Gtk.csproj", "{78CF883B-CACB-412F-9571-96211E2E7F7E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Uno.XamlMerge.Tests", "Uno.XamlMerge.Tests\Uno.XamlMerge.Tests.csproj", "{4D530D82-BD72-4D58-969C-2A8BDCD876F2}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Uno.XamlMerge.Tests", "Uno.XamlMerge.Tests\Uno.XamlMerge.Tests.csproj", "{4D530D82-BD72-4D58-969C-2A8BDCD876F2}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestLibrarySingleFile", "UWP\TestLibrarySingleFile\TestLibrarySingleFile.csproj", "{394950DC-7CDF-42FF-AAF0-03BBAB41953A}" EndProject Global - GlobalSection(SharedMSBuildProjectFiles) = preSolution - UWP\XamlMergeUWPTest\XamlMergeUWPTest.Shared\XamlMergeUWPTest.Shared.projitems*{2e9e4fc0-ef26-46ef-bfcf-20a2da4a748b}*SharedItemsImports = 4 - UWP\XamlMergeUWPTest\XamlMergeUWPTest.Shared\XamlMergeUWPTest.Shared.projitems*{6279c845-92f8-4333-ab99-3d213163593c}*SharedItemsImports = 13 - UWP\XamlMergeUWPTest\XamlMergeUWPTest.Shared\XamlMergeUWPTest.Shared.projitems*{78cf883b-cacb-412f-9571-96211e2e7f7e}*SharedItemsImports = 5 - UWP\XamlMergeUWPTest\XamlMergeUWPTest.Shared\XamlMergeUWPTest.Shared.projitems*{ae79650a-b18b-4229-b167-adbcac2b9679}*SharedItemsImports = 5 - UWP\XamlMergeUWPTest\XamlMergeUWPTest.Shared\XamlMergeUWPTest.Shared.projitems*{f3adab09-f459-407b-8920-45ec1cfc7040}*SharedItemsImports = 4 - UWP\XamlMergeUWPTest\XamlMergeUWPTest.Shared\XamlMergeUWPTest.Shared.projitems*{f9497365-f492-4027-be58-61521ee747ac}*SharedItemsImports = 4 - EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Ad-Hoc|Any CPU = Ad-Hoc|Any CPU Ad-Hoc|ARM = Ad-Hoc|ARM @@ -571,6 +565,62 @@ Global {4D530D82-BD72-4D58-969C-2A8BDCD876F2}.Release|x64.Build.0 = Release|Any CPU {4D530D82-BD72-4D58-969C-2A8BDCD876F2}.Release|x86.ActiveCfg = Release|Any CPU {4D530D82-BD72-4D58-969C-2A8BDCD876F2}.Release|x86.Build.0 = Release|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Ad-Hoc|ARM64.ActiveCfg = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Ad-Hoc|ARM64.Build.0 = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Ad-Hoc|x64.Build.0 = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Ad-Hoc|x86.Build.0 = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.AppStore|Any CPU.Build.0 = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.AppStore|ARM.ActiveCfg = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.AppStore|ARM.Build.0 = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.AppStore|ARM64.ActiveCfg = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.AppStore|ARM64.Build.0 = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.AppStore|iPhone.ActiveCfg = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.AppStore|iPhone.Build.0 = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.AppStore|x64.ActiveCfg = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.AppStore|x64.Build.0 = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.AppStore|x86.ActiveCfg = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.AppStore|x86.Build.0 = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Debug|ARM.ActiveCfg = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Debug|ARM.Build.0 = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Debug|ARM64.Build.0 = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Debug|iPhone.Build.0 = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Debug|x64.ActiveCfg = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Debug|x64.Build.0 = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Debug|x86.ActiveCfg = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Debug|x86.Build.0 = Debug|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Release|Any CPU.Build.0 = Release|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Release|ARM.ActiveCfg = Release|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Release|ARM.Build.0 = Release|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Release|ARM64.ActiveCfg = Release|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Release|ARM64.Build.0 = Release|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Release|iPhone.ActiveCfg = Release|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Release|iPhone.Build.0 = Release|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Release|x64.ActiveCfg = Release|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Release|x64.Build.0 = Release|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Release|x86.ActiveCfg = Release|Any CPU + {394950DC-7CDF-42FF-AAF0-03BBAB41953A}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -586,8 +636,17 @@ Global {AE79650A-B18B-4229-B167-ADBCAC2B9679} = {4741C651-A1E7-44C5-9A91-A6D59D1248F1} {78CF883B-CACB-412F-9571-96211E2E7F7E} = {4741C651-A1E7-44C5-9A91-A6D59D1248F1} {4D530D82-BD72-4D58-969C-2A8BDCD876F2} = {F435E472-6EF0-4739-9D92-A058FA5B039B} + {394950DC-7CDF-42FF-AAF0-03BBAB41953A} = {B9F3AD0C-1F50-445A-A6F1-88B6892EE9CC} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {F5304432-D676-40D8-AAB5-9F1CC1904CF2} EndGlobalSection + GlobalSection(SharedMSBuildProjectFiles) = preSolution + UWP\XamlMergeUWPTest\XamlMergeUWPTest.Shared\XamlMergeUWPTest.Shared.projitems*{2e9e4fc0-ef26-46ef-bfcf-20a2da4a748b}*SharedItemsImports = 4 + UWP\XamlMergeUWPTest\XamlMergeUWPTest.Shared\XamlMergeUWPTest.Shared.projitems*{6279c845-92f8-4333-ab99-3d213163593c}*SharedItemsImports = 13 + UWP\XamlMergeUWPTest\XamlMergeUWPTest.Shared\XamlMergeUWPTest.Shared.projitems*{78cf883b-cacb-412f-9571-96211e2e7f7e}*SharedItemsImports = 5 + UWP\XamlMergeUWPTest\XamlMergeUWPTest.Shared\XamlMergeUWPTest.Shared.projitems*{ae79650a-b18b-4229-b167-adbcac2b9679}*SharedItemsImports = 5 + UWP\XamlMergeUWPTest\XamlMergeUWPTest.Shared\XamlMergeUWPTest.Shared.projitems*{f3adab09-f459-407b-8920-45ec1cfc7040}*SharedItemsImports = 4 + UWP\XamlMergeUWPTest\XamlMergeUWPTest.Shared\XamlMergeUWPTest.Shared.projitems*{f9497365-f492-4027-be58-61521ee747ac}*SharedItemsImports = 4 + EndGlobalSection EndGlobal diff --git a/src/Uno.XamlMerge.Task/BatchMergeXaml.cs b/src/Uno.XamlMerge.Task/BatchMergeXaml.cs index 92f91eb..d46b849 100644 --- a/src/Uno.XamlMerge.Task/BatchMergeXaml.cs +++ b/src/Uno.XamlMerge.Task/BatchMergeXaml.cs @@ -14,89 +14,134 @@ namespace Uno.UI.Tasks.BatchMerge { - public class BatchMergeXaml_v0 : CustomTask - { - [Required] - public ITaskItem[] Pages { get; set; } - - [Required] - public string MergedXamlFile { get; set; } - - [Required] - public string ProjectFullPath { get; set; } - - [Required] - public string TlogReadFilesOutputPath { get; set; } - - [Required] - public string TlogWriteFilesOutputPath { get; set; } - - [Output] - public string[] FilesWritten - { - get { return filesWritten.ToArray(); } - } - - private List filesWritten = new List(); - - public override bool Execute() - { - MergedDictionary mergedDictionary = MergedDictionary.CreateMergedDicionary(); - List pages = new List(); - - if (Pages != null) - { - foreach (ITaskItem pageItem in Pages) - { - string page = pageItem.ItemSpec; - if (File.Exists(page)) - { - pages.Add(page); - } - else - { - LogError($"Can't find page {page}!"); - } - } - } - - if (HasLoggedErrors) - { - return false; - } - - LogMessage($"Merging XAML files into {MergedXamlFile}..."); - - var projectBasePath = Path.GetDirectoryName(Path.GetFullPath(ProjectFullPath)); - - foreach (string page in pages) - { - try - { - mergedDictionary.MergeContent( - content: File.ReadAllText(page), - filePath: Path.GetFullPath(page) - .Replace(projectBasePath, "") - .TrimStart(Path.DirectorySeparatorChar)); - } - catch (Exception) - { - LogError($"Exception found when merging page {page}!"); - throw; - } - } - - Directory.CreateDirectory(Path.GetDirectoryName(MergedXamlFile)); - Directory.CreateDirectory(Path.GetDirectoryName(TlogReadFilesOutputPath)); - Directory.CreateDirectory(Path.GetDirectoryName(TlogWriteFilesOutputPath)); - - mergedDictionary.FinalizeXaml(); - filesWritten.Add(Utils.RewriteFileIfNecessary(MergedXamlFile, mergedDictionary.ToString())); - - File.WriteAllLines(TlogReadFilesOutputPath, Pages.Select(page => page.ItemSpec)); - File.WriteAllLines(TlogWriteFilesOutputPath, FilesWritten); - - return !HasLoggedErrors; - } - } + public class BatchMergeXaml_v0 : CustomTask + { + private List _filesWritten = new(); + + [Required] + public ITaskItem[] Pages { get; set; } + + [Required] + public ITaskItem[] MergedXamlFiles { get; set; } + + [Required] + public string ProjectFullPath { get; set; } + + [Output] + public string[] FilesWritten + => _filesWritten.ToArray(); + + public override bool Execute() + { + ValidatePageMergeFileMetadata(); + + if (HasLoggedErrors) + { + return false; + } + + var filteredPages = Pages + .Except(MergedXamlFiles, FullPathComparer.Default) + .ToArray(); + + if (MergedXamlFiles.Length > 1) + { + foreach (var mergedXamlFile in MergedXamlFiles) + { + var mergeFileName = Path.GetFileName(mergedXamlFile.ItemSpec); + + BatchMerger.Merge(this, + mergedXamlFile.ItemSpec, + ProjectFullPath, + filteredPages.Where(p => string.Equals(p.GetMetadata("MergeFile"), mergeFileName, StringComparison.OrdinalIgnoreCase)).ToArray()); + } + } + else if (MergedXamlFiles.Length == 1) + { + // Single target file, without "MergeFile" attribution + + BatchMerger.Merge(this, + MergedXamlFiles[0].ItemSpec, + ProjectFullPath, + filteredPages); + } + + return !HasLoggedErrors; + } + + private void ValidatePageMergeFileMetadata() + { + if (MergedXamlFiles.Length > 1) + { + foreach (var page in Pages) + { + if (string.IsNullOrEmpty(page.GetMetadata("MergeFile"))) + { + LogError($"The page {page.ItemSpec} does not define a `MergeFile` metadata, when multiple `MergedXamlFiles` are specified."); + } + } + } + } + + class BatchMerger + { + internal static void Merge( + CustomTask owner, + string mergedXamlFile, + string projectFullPath, + ITaskItem[] pageItems) + { + var mergedDictionary = MergedDictionary.CreateMergedDicionary(); + List pages = new(); + + if (pageItems != null) + { + foreach (var pageItem in pageItems) + { + var page = pageItem.ItemSpec; + + if (File.Exists(page)) + { + pages.Add(page); + } + else + { + owner.LogError($"Can't find page {page}!"); + } + } + } + + if (owner.HasLoggedErrors) + { + return; + } + + owner.LogMessage($"Merging XAML files into {mergedXamlFile}..."); + + var projectBasePath = Path.GetDirectoryName(Path.GetFullPath(projectFullPath)); + + foreach (string page in pages) + { + try + { + mergedDictionary.MergeContent( + content: File.ReadAllText(page), + filePath: Path.GetFullPath(page) + .Replace(projectBasePath, "") + .TrimStart(Path.DirectorySeparatorChar)); + } + catch (Exception) + { + owner.LogError($"Exception found when merging page {page}!"); + throw; + } + } + + mergedDictionary.FinalizeXaml(); + + Directory.CreateDirectory(Path.GetDirectoryName(mergedXamlFile)); + Utils.RewriteFileIfNecessary(mergedXamlFile, mergedDictionary.ToString()); + } + } + } } diff --git a/src/Uno.XamlMerge.Task/CustomTask.cs b/src/Uno.XamlMerge.Task/CustomTask.cs index 6dd9dce..bfabf26 100644 --- a/src/Uno.XamlMerge.Task/CustomTask.cs +++ b/src/Uno.XamlMerge.Task/CustomTask.cs @@ -15,7 +15,7 @@ namespace Uno.UI.Tasks.BatchMerge { public abstract class CustomTask : Microsoft.Build.Utilities.Task { - protected bool HasLoggedErrors + internal protected bool HasLoggedErrors { get { @@ -32,7 +32,7 @@ protected bool HasLoggedErrors private bool hasLoggedErrors = false; - protected void LogMessage(string message) + internal protected void LogMessage(string message) { if (BuildEngine != null) { @@ -44,12 +44,12 @@ protected void LogMessage(string message) } } - protected void LogWarning(string message) + internal protected void LogWarning(string message) { LogWarning(string.Empty, string.Empty, string.Empty, string.Empty, -1, -1, message); } - protected void LogWarning(string subcategory, string code, string helpKeyword, string file, int lineNumber, int columnNumber, string message) + internal protected void LogWarning(string subcategory, string code, string helpKeyword, string file, int lineNumber, int columnNumber, string message) { if (BuildEngine != null) { @@ -61,12 +61,12 @@ protected void LogWarning(string subcategory, string code, string helpKeyword, s } } - protected void LogError(string message) + internal protected void LogError(string message) { LogError(string.Empty, string.Empty, string.Empty, string.Empty, -1, -1, message); } - protected void LogError(string subcategory, string code, string helpKeyword, string file, int lineNumber, int columnNumber, string message) + internal protected void LogError(string subcategory, string code, string helpKeyword, string file, int lineNumber, int columnNumber, string message) { if (BuildEngine != null) { diff --git a/src/Uno.XamlMerge.Task/FullPathComparer.cs b/src/Uno.XamlMerge.Task/FullPathComparer.cs new file mode 100644 index 0000000..a52d74e --- /dev/null +++ b/src/Uno.XamlMerge.Task/FullPathComparer.cs @@ -0,0 +1,20 @@ +#nullable enable + +using Microsoft.Build.Framework; + +namespace Uno.UI.Tasks.BatchMerge; + +internal class FullPathComparer : IEqualityComparer +{ + public static IEqualityComparer Default { get; } = new FullPathComparer(); + + public bool Equals(ITaskItem x, ITaskItem y) + { + return x.GetMetadata("FullPath") == y.GetMetadata("Fullpath"); + } + + public int GetHashCode(ITaskItem obj) + { + return obj.GetHashCode(); + } +} diff --git a/src/Uno.XamlMerge.Task/GeneratePageList_v0.cs b/src/Uno.XamlMerge.Task/GeneratePageList_v0.cs new file mode 100644 index 0000000..46a1de6 --- /dev/null +++ b/src/Uno.XamlMerge.Task/GeneratePageList_v0.cs @@ -0,0 +1,35 @@ +#nullable enable + +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Uno.UI.Tasks.BatchMerge; + +public class GeneratePageList_v0 : Microsoft.Build.Utilities.Task +{ + [Required] + public ITaskItem[]? Pages { get; set; } + + [Required] + public ITaskItem[]? MergedXamlFiles { get; set; } + + [Required] + public string ProjectDirectory { get; set; } = ""; + + [Output] + public ITaskItem[]? OutputPages { get; set; } + + public override bool Execute() + { + OutputPages = MergedXamlFiles + .Select(f => new TaskItem(XamlMerge.Task.Utilities.FileUtilities.MakeRelative(ProjectDirectory, f.ItemSpec))) + .Except(Pages, FullPathComparer.Default) + .Distinct(FullPathComparer.Default) + .ToArray(); + + return true; + } +} diff --git a/src/Uno.XamlMerge.Task/Utilities/FileUtilities.cs b/src/Uno.XamlMerge.Task/Utilities/FileUtilities.cs new file mode 100644 index 0000000..7b6530f --- /dev/null +++ b/src/Uno.XamlMerge.Task/Utilities/FileUtilities.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +// Extract from https://github.com/dotnet/msbuild/blob/9bcc06cbe19ae2482ab18eab90a82fd079b26897/src/Deprecated/Engine/Shared/FileUtilities.cs#L791 + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Uno.XamlMerge.Task.Utilities +{ + internal class FileUtilities + { + internal static string MakeRelative(string basePath, string path) + { + if (basePath.Length == 0) + { + return path; + } + + Uri baseUri = new Uri(FileUtilities.EnsureTrailingSlash(basePath), UriKind.Absolute); // May throw UriFormatException + + Uri pathUri = CreateUriFromPath(path); + + if (!pathUri.IsAbsoluteUri) + { + // the path is already a relative url, we will just normalize it... + pathUri = new Uri(baseUri, pathUri); + } + + Uri relativeUri = baseUri.MakeRelativeUri(pathUri); + string relativePath = Uri.UnescapeDataString(relativeUri.IsAbsoluteUri ? relativeUri.LocalPath : relativeUri.ToString()); + + string result = relativePath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); + + return result; + } + + /// + /// If the given path doesn't have a trailing slash then add one. + /// + /// The path to check. + /// A path with a slash. + internal static string EnsureTrailingSlash(string fileSpec) + { + if (!EndsWithSlash(fileSpec)) + { + fileSpec += Path.DirectorySeparatorChar; + } + + return fileSpec; + } + + /// + /// Helper function to create an Uri object from path. + /// + /// path string + /// uri object + private static Uri CreateUriFromPath(string path) + { + Uri pathUri; + + // Try absolute first, then fall back on relative, otherwise it + // makes some absolute UNC paths like (\\foo\bar) relative ... + if (!Uri.TryCreate(path, UriKind.Absolute, out pathUri)) + { + pathUri = new Uri(path, UriKind.Relative); + } + + return pathUri; + } + + /// + /// Indicates if the given file-spec ends with a slash. + /// + /// SumedhK + /// The file spec. + /// true, if file-spec has trailing slash + internal static bool EndsWithSlash(string fileSpec) + { + return (fileSpec.Length > 0) + ? IsSlash(fileSpec[fileSpec.Length - 1]) + : false; + } + + /// + /// Indicates if the given character is a slash. + /// + /// SumedhK + /// + /// true, if slash + internal static bool IsSlash(char c) + { + return (c == Path.DirectorySeparatorChar) || (c == Path.AltDirectorySeparatorChar); + } + } +} diff --git a/src/Uno.XamlMerge.Task/build/Uno.XamlMerge.Task.targets b/src/Uno.XamlMerge.Task/build/Uno.XamlMerge.Task.targets index ea36fdf..f954501 100644 --- a/src/Uno.XamlMerge.Task/build/Uno.XamlMerge.Task.targets +++ b/src/Uno.XamlMerge.Task/build/Uno.XamlMerge.Task.targets @@ -4,24 +4,27 @@ - - $(MSBuildProjectDirectory)\Generated\mergedpages.xaml - + + - - <_FilteredXamlMergeInput - Include="@(XamlMergeInput)" - Condition="'%(XamlMergeInput.FullPath)'!='$(XamlMergeOutputFile)'" /> + BeforeTargets="_ComputeTargetFrameworkItems;BeforeBuild" Condition="('$(TargetFramework)' == '' or '$(TargetFrameworks)'=='') and ('$(BuildingProject)' == 'true' or '$(DesignTimeBuild)' != 'true')"> + + + $(MSBuildProjectDirectory)\Generated\mergedpages.xaml + + + + + + + Pages="@(XamlMergeInput)" + MergedXamlFiles="@(XamlMergeOutputFiles)" /> @@ -32,24 +35,14 @@ - - - <_additionalPages Include="@(Page)" - Condition="'%(Page.FullPath)'!=$([System.IO.Path]::GetFullPath('$(XamlMergeOutputFile)'))" - KeepDuplicates="False" /> - - <_mergeOutputInluded Include="@(Page)" - Condition="'%(Page.FullPath)'==$([System.IO.Path]::GetFullPath('$(XamlMergeOutputFile)'))" /> - - - + + + + diff --git a/src/Uno.XamlMerge.Tests/Given_BatchMergeXaml.cs b/src/Uno.XamlMerge.Tests/Given_BatchMergeXaml.cs index 1d4bbc2..b7063de 100644 --- a/src/Uno.XamlMerge.Tests/Given_BatchMergeXaml.cs +++ b/src/Uno.XamlMerge.Tests/Given_BatchMergeXaml.cs @@ -1,8 +1,12 @@ using Microsoft.Build.Utilities; using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.CompilerServices; +using System.Text.RegularExpressions; using Uno.UI.Tasks.BatchMerge; namespace Uno.XamlMerge.Tests @@ -10,6 +14,9 @@ namespace Uno.XamlMerge.Tests [TestClass] public class Given_BatchMergeXaml { + static Regex _inputMetadataFilter = new Regex(@"Input_.*?\.(?.*?)\.xml"); + static Regex _expectedMetadataFilter = new Regex(@"merged.*?\.(?.*?)\.xaml"); + [TestMethod] public void When_Empty() { @@ -60,14 +67,56 @@ public void When_Duplicate_Keys_on_Theme_Resources_And_Comments_As_FirstNode() ValidateOutput(task); } + [TestMethod] + public void When_Two_MergeFiles_Single_Input() + { + var task = CreateMerger(); + + Assert.IsTrue(task.Execute()); + + ValidateOutput(task); + } + + [TestMethod] + public void When_Three_MergeFiles_Single_Input() + { + var task = CreateMerger(); + + Assert.IsTrue(task.Execute()); + + ValidateOutput(task); + } + private void ValidateOutput(BatchMergeXaml_v0 task, [CallerMemberName] string testName = "") { var basePath = GetBasePath(testName); - Assert.AreEqual( - File.ReadAllText(Path.Combine(basePath, "expected.xml")).Replace("\t", " ").Trim(), - File.ReadAllText(task.MergedXamlFile).Replace("\t", " ").Trim() - ); + if (task.MergedXamlFiles.Length == 1) + { + Assert.AreEqual( + File.ReadAllText(Path.Combine(basePath, "expected.xml")).Replace("\t", " ").Trim(), + File.ReadAllText(task.MergedXamlFiles[0].ItemSpec).Replace("\t", " ").Trim() + ); + } + else + { + foreach(var file in task.MergedXamlFiles) + { + if(_expectedMetadataFilter.Match(file.ItemSpec) is { Success: true } result) + { + var assemblyName = result.Groups[1].ToString(); + + Assert.AreEqual( + File.ReadAllText(Path.Combine(basePath, $"expected.{assemblyName}.xml")).Replace("\t", " ").Trim(), + File.ReadAllText(file.ItemSpec).Replace("\t", " ").Trim() + ); + } + else + { + throw new InvalidOperationException($"Unable to find merge target in file name {file.ItemSpec}"); + } + } + } } private BatchMergeXaml_v0 CreateMerger([CallerMemberName] string testName = "") @@ -75,15 +124,29 @@ private BatchMergeXaml_v0 CreateMerger([CallerMemberName] string testName = "") var basePath = GetBasePath(testName); BatchMergeXaml_v0 task = new(); - task.Pages = Directory.GetFiles(basePath, "Input_*.xml").Select(f => new TaskItem(f)).ToArray(); + task.Pages = Directory.GetFiles(basePath, "Input_*.xml").Select(f => new TaskItem(f, GetMergefileMetadata(f))).ToArray(); task.ProjectFullPath = basePath; - task.MergedXamlFile = Path.Combine(basePath, "Output", "merged.xaml"); - task.TlogReadFilesOutputPath = Path.Combine(basePath, "Output", "readlog.txt"); - task.TlogWriteFilesOutputPath = Path.Combine(basePath, "Output", "writelog.txt"); + task.MergedXamlFiles = task.Pages + .Select(p => p.GetMetadata("MergeFile") is { Length: > 0} m ? m : "merged.xaml" ) + .Distinct() + .Select(f => new TaskItem(Path.Combine(basePath, "Output", f))) + .ToArray(); return task; } + private IDictionary? GetMergefileMetadata(string f) + { + if(_inputMetadataFilter.Match(Path.GetFileName(f)) is { Success: true } result) + { + return new Dictionary() { + ["MergeFile"] = $"merged.{result.Groups[1]}.xaml", + }; + } + + return new Dictionary(); + } + private string GetBasePath(string name) { return Path.Combine(Path.GetDirectoryName(this.GetType().Assembly.Location)!, "Scenarios", name); diff --git a/src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/Input_1.Output1.xml b/src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/Input_1.Output1.xml new file mode 100644 index 0000000..3977590 --- /dev/null +++ b/src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/Input_1.Output1.xml @@ -0,0 +1,8 @@ + + + 8 + + diff --git a/src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/Input_1.Output2.xml b/src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/Input_1.Output2.xml new file mode 100644 index 0000000..4ed946b --- /dev/null +++ b/src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/Input_1.Output2.xml @@ -0,0 +1,8 @@ + + + 8 + + diff --git a/src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/Input_1.Output3.xml b/src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/Input_1.Output3.xml new file mode 100644 index 0000000..22305f6 --- /dev/null +++ b/src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/Input_1.Output3.xml @@ -0,0 +1,8 @@ + + + 8 + + diff --git a/src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/Input_2.Output1.xml b/src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/Input_2.Output1.xml new file mode 100644 index 0000000..17b1dd4 --- /dev/null +++ b/src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/Input_2.Output1.xml @@ -0,0 +1,8 @@ + + + 8 + + diff --git a/src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/Input_2.Output2.xml b/src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/Input_2.Output2.xml new file mode 100644 index 0000000..eb67a9c --- /dev/null +++ b/src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/Input_2.Output2.xml @@ -0,0 +1,8 @@ + + + 8 + + diff --git a/src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/Input_2.Output3.xml b/src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/Input_2.Output3.xml new file mode 100644 index 0000000..24e3da1 --- /dev/null +++ b/src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/Input_2.Output3.xml @@ -0,0 +1,8 @@ + + + 8 + + diff --git a/src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/expected.Output1.xml b/src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/expected.Output1.xml new file mode 100644 index 0000000..cfb0e43 --- /dev/null +++ b/src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/expected.Output1.xml @@ -0,0 +1,6 @@ + + + 8 + + 8 + \ No newline at end of file diff --git a/src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/expected.Output2.xml b/src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/expected.Output2.xml new file mode 100644 index 0000000..e2974ed --- /dev/null +++ b/src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/expected.Output2.xml @@ -0,0 +1,6 @@ + + + 8 + + 8 + \ No newline at end of file diff --git a/src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/expected.Output3.xml b/src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/expected.Output3.xml new file mode 100644 index 0000000..509e952 --- /dev/null +++ b/src/Uno.XamlMerge.Tests/Scenarios/When_Three_MergeFiles_Single_Input/expected.Output3.xml @@ -0,0 +1,6 @@ + + + 8 + + 8 + \ No newline at end of file diff --git a/src/Uno.XamlMerge.Tests/Scenarios/When_Two_MergeFiles_Single_Input/Input_1.Output1.xml b/src/Uno.XamlMerge.Tests/Scenarios/When_Two_MergeFiles_Single_Input/Input_1.Output1.xml new file mode 100644 index 0000000..3977590 --- /dev/null +++ b/src/Uno.XamlMerge.Tests/Scenarios/When_Two_MergeFiles_Single_Input/Input_1.Output1.xml @@ -0,0 +1,8 @@ + + + 8 + + diff --git a/src/Uno.XamlMerge.Tests/Scenarios/When_Two_MergeFiles_Single_Input/Input_1.Output2.xml b/src/Uno.XamlMerge.Tests/Scenarios/When_Two_MergeFiles_Single_Input/Input_1.Output2.xml new file mode 100644 index 0000000..4ed946b --- /dev/null +++ b/src/Uno.XamlMerge.Tests/Scenarios/When_Two_MergeFiles_Single_Input/Input_1.Output2.xml @@ -0,0 +1,8 @@ + + + 8 + + diff --git a/src/Uno.XamlMerge.Tests/Scenarios/When_Two_MergeFiles_Single_Input/Input_2.Output1.xml b/src/Uno.XamlMerge.Tests/Scenarios/When_Two_MergeFiles_Single_Input/Input_2.Output1.xml new file mode 100644 index 0000000..17b1dd4 --- /dev/null +++ b/src/Uno.XamlMerge.Tests/Scenarios/When_Two_MergeFiles_Single_Input/Input_2.Output1.xml @@ -0,0 +1,8 @@ + + + 8 + + diff --git a/src/Uno.XamlMerge.Tests/Scenarios/When_Two_MergeFiles_Single_Input/Input_2.Output2.xml b/src/Uno.XamlMerge.Tests/Scenarios/When_Two_MergeFiles_Single_Input/Input_2.Output2.xml new file mode 100644 index 0000000..eb67a9c --- /dev/null +++ b/src/Uno.XamlMerge.Tests/Scenarios/When_Two_MergeFiles_Single_Input/Input_2.Output2.xml @@ -0,0 +1,8 @@ + + + 8 + + diff --git a/src/Uno.XamlMerge.Tests/Scenarios/When_Two_MergeFiles_Single_Input/expected.Output1.xml b/src/Uno.XamlMerge.Tests/Scenarios/When_Two_MergeFiles_Single_Input/expected.Output1.xml new file mode 100644 index 0000000..470dbef --- /dev/null +++ b/src/Uno.XamlMerge.Tests/Scenarios/When_Two_MergeFiles_Single_Input/expected.Output1.xml @@ -0,0 +1,6 @@ + + + 8 + + 8 + \ No newline at end of file diff --git a/src/Uno.XamlMerge.Tests/Scenarios/When_Two_MergeFiles_Single_Input/expected.Output2.xml b/src/Uno.XamlMerge.Tests/Scenarios/When_Two_MergeFiles_Single_Input/expected.Output2.xml new file mode 100644 index 0000000..dbd4d36 --- /dev/null +++ b/src/Uno.XamlMerge.Tests/Scenarios/When_Two_MergeFiles_Single_Input/expected.Output2.xml @@ -0,0 +1,6 @@ + + + 8 + + 8 + \ No newline at end of file