diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index f4e91b0fedf..655389b92f9 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -9,17 +9,22 @@ jobs: steps: - uses: actions/checkout@v1 - # - name: Install Nuget - # uses: nuget/setup-nuget@v1 - # with: - # nuget-version: '5.x' - - name: Build - run: .\build.cmd -pack -ci -configuration Debug -prepareMachine /p:Platform=x86 - - name: Push - uses: actions/upload-artifact@v1 + - name: Setup .NET + uses: actions/setup-dotnet@v1 with: - name: WPF_Debug - path: ./artifacts/packages/Debug/NonShipping + dotnet-version: | + 3.1.x + 5.0.x + 6.0.101 + - name: Build WPF + run: .\build.cmd -pack -ci -configuration Debug -prepareMachine /p:Platform=x86 + - name: Build CustomWPF + run: dotnet build CustomWpf + # - name: Push + # uses: actions/upload-artifact@v1 + # with: + # name: WPF_Debug + # path: ./artifacts/packages/Debug/NonShipping BuildRelease: @@ -27,14 +32,19 @@ jobs: steps: - uses: actions/checkout@v1 - # - name: Install Nuget - # uses: nuget/setup-nuget@v1 - # with: - # nuget-version: '5.x' - - name: Build - run: .\build.cmd -pack -ci -configuration Release -prepareMachine /p:Platform=x86 - - name: Push - uses: actions/upload-artifact@v1 + - name: Setup .NET + uses: actions/setup-dotnet@v1 with: - name: WPF_Release - path: ./artifacts/packages/Release/NonShipping \ No newline at end of file + dotnet-version: | + 3.1.x + 5.0.x + 6.0.101 + - name: Build WPF + run: .\build.cmd -pack -ci -configuration Release -prepareMachine /p:Platform=x86 + - name: Build CustomWPF + run: dotnet build CustomWpf -c Release + # - name: Push + # uses: actions/upload-artifact@v1 + # with: + # name: WPF_Release + # path: ./artifacts/packages/Release/NonShipping \ No newline at end of file diff --git a/.github/workflows/NuGet-Tag-Publish.yml b/.github/workflows/NuGet-Tag-Publish.yml new file mode 100644 index 00000000000..7de16267ed3 --- /dev/null +++ b/.github/workflows/NuGet-Tag-Publish.yml @@ -0,0 +1,65 @@ +name: Publish Custom WPF + +on: + push: + tags: + - '*' + +jobs: + # BuildDebug: + + # runs-on: windows-latest + + # steps: + # - uses: actions/checkout@v1 + # # - name: Install Nuget + # # uses: nuget/setup-nuget@v1 + # # with: + # # nuget-version: '5.x' + # - name: Build + # run: .\build.cmd -pack -ci -configuration Debug -prepareMachine /p:Platform=x86 + # - name: Push + # uses: actions/upload-artifact@v1 + # with: + # name: WPF_Debug + # path: ./artifacts/packages/Debug/NonShipping + + Build: + + runs-on: windows-latest + + steps: + - uses: actions/checkout@v1 + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: | + 3.1.x + 5.0.x + 6.0.101 + - name: Install Tools + run: dotnet tool install -g dotnetCampus.TagToVersion --add-source https://api.nuget.org/v3/index.json + - name: Set Package TagToVersion + run: dotnet tagtoversion -t ${{ github.ref }} -f CustomWpf\build\Version.props + - name: Build WPF + run: .\build.cmd -pack -ci -configuration Release -prepareMachine /p:Platform=x86 + - name: Pack NuGet + run: dotnet pack CustomWpf -c release + + - name: Install Nuget + uses: nuget/setup-nuget@v1 + with: + nuget-version: '5.x' + - name: Add private GitHub registry to NuGet + run: | + nuget sources add -name github -Source https://nuget.pkg.github.com/dotnet-campus/index.json -Username dotnet-campus -Password ${{ secrets.GITHUB_TOKEN }} + - name: Push NuGet Package + run: | + nuget push .\CustomWpf\bin\Release\*.nupkg -Source github -SkipDuplicate + nuget push .\CustomWpf\bin\Release\*.nupkg -Source https://api.nuget.org/v3/index.json -SkipDuplicate -ApiKey ${{ secrets.NugetKey }} + + # - name: Push + # uses: actions/upload-artifact@v1 + # with: + # name: WPF_Release + # path: ./artifacts/packages/Release/NonShipping \ No newline at end of file diff --git a/CustomWpf/CustomWpf.sln b/CustomWpf/CustomWpf.sln new file mode 100644 index 00000000000..5be3cf3aedd --- /dev/null +++ b/CustomWpf/CustomWpf.sln @@ -0,0 +1,58 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.32014.148 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnetCampus.WPF", "Lib\dotnetCampus.CustomWpf.Lib\dotnetCampus.WPF.csproj", "{39764FE3-C2F9-4772-9BF6-B66923ABEC4C}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Lib", "Lib", "{FE032A91-A790-4274-A194-02E161D1F14B}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Packaging", "Packaging", "{27886E90-E328-4AE9-86DA-1F596554D26B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dotnetCampus.WPF.NuGet", "Packaging\dotnetCampus.WPF.NuGet\dotnetCampus.WPF.NuGet.csproj", "{FDC9151F-3544-4C68-9D05-D8E4935F1A9F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnetCampus.WPF.Resource", "Lib\dotnetCampus.CustomWpf.Resource\dotnetCampus.WPF.Resource.csproj", "{D73CB485-6290-4E37-B441-8068E60CBF7E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{315B416C-6CDA-4CD5-9666-69C8272CD80E}" + ProjectSection(SolutionItems) = preProject + build\Version.props = build\Version.props + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dotnetCampus.WPF.Dependencies", "Lib\dotnetCampus.CustomWpf.Dependencies\dotnetCampus.WPF.Dependencies.csproj", "{39E01A9E-C352-4B7E-96CA-612A07937470}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {39764FE3-C2F9-4772-9BF6-B66923ABEC4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {39764FE3-C2F9-4772-9BF6-B66923ABEC4C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {39764FE3-C2F9-4772-9BF6-B66923ABEC4C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {39764FE3-C2F9-4772-9BF6-B66923ABEC4C}.Release|Any CPU.Build.0 = Release|Any CPU + {FDC9151F-3544-4C68-9D05-D8E4935F1A9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FDC9151F-3544-4C68-9D05-D8E4935F1A9F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FDC9151F-3544-4C68-9D05-D8E4935F1A9F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FDC9151F-3544-4C68-9D05-D8E4935F1A9F}.Release|Any CPU.Build.0 = Release|Any CPU + {D73CB485-6290-4E37-B441-8068E60CBF7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D73CB485-6290-4E37-B441-8068E60CBF7E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D73CB485-6290-4E37-B441-8068E60CBF7E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D73CB485-6290-4E37-B441-8068E60CBF7E}.Release|Any CPU.Build.0 = Release|Any CPU + {39E01A9E-C352-4B7E-96CA-612A07937470}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {39E01A9E-C352-4B7E-96CA-612A07937470}.Debug|Any CPU.Build.0 = Debug|Any CPU + {39E01A9E-C352-4B7E-96CA-612A07937470}.Release|Any CPU.ActiveCfg = Release|Any CPU + {39E01A9E-C352-4B7E-96CA-612A07937470}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {39764FE3-C2F9-4772-9BF6-B66923ABEC4C} = {FE032A91-A790-4274-A194-02E161D1F14B} + {FDC9151F-3544-4C68-9D05-D8E4935F1A9F} = {27886E90-E328-4AE9-86DA-1F596554D26B} + {D73CB485-6290-4E37-B441-8068E60CBF7E} = {FE032A91-A790-4274-A194-02E161D1F14B} + {39E01A9E-C352-4B7E-96CA-612A07937470} = {FE032A91-A790-4274-A194-02E161D1F14B} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {C25E6016-F278-457B-87D6-39EC0E0A6849} + EndGlobalSection +EndGlobal diff --git a/CustomWpf/Directory.Build.props b/CustomWpf/Directory.Build.props new file mode 100644 index 00000000000..961a10f9fc0 --- /dev/null +++ b/CustomWpf/Directory.Build.props @@ -0,0 +1,18 @@ + + + + latest + $(MSBuildThisFileDirectory)bin\$(Configuration) + dotnet campus(.NET 职业技术学院) + + dotnet-campus + https://github.com/dotnet-campus/dotnetCampus.Ipc + https://github.com/dotnet-campus/dotnetCampus.Ipc + 包含定制的 WPF 版本 + + git + Copyright © 2020-2022 dotnet campus, All Rights Reserved. + + + + diff --git a/CustomWpf/Directory.Build.targets b/CustomWpf/Directory.Build.targets new file mode 100644 index 00000000000..faf2349bae2 --- /dev/null +++ b/CustomWpf/Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/CustomWpf/Lib/dotnetCampus.CustomWpf.Dependencies/Build/Package.targets b/CustomWpf/Lib/dotnetCampus.CustomWpf.Dependencies/Build/Package.targets new file mode 100644 index 00000000000..c99690af8b8 --- /dev/null +++ b/CustomWpf/Lib/dotnetCampus.CustomWpf.Dependencies/Build/Package.targets @@ -0,0 +1,13 @@ + + + + $(RuntimeIdentifier) + win-x86 + + + + + + + diff --git a/CustomWpf/Lib/dotnetCampus.CustomWpf.Dependencies/dotnetCampus.WPF.Dependencies.csproj b/CustomWpf/Lib/dotnetCampus.CustomWpf.Dependencies/dotnetCampus.WPF.Dependencies.csproj new file mode 100644 index 00000000000..63906a8bab0 --- /dev/null +++ b/CustomWpf/Lib/dotnetCampus.CustomWpf.Dependencies/dotnetCampus.WPF.Dependencies.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + + false + true + + + + + + + + + + diff --git a/CustomWpf/Lib/dotnetCampus.CustomWpf.Lib/Program.cs b/CustomWpf/Lib/dotnetCampus.CustomWpf.Lib/Program.cs new file mode 100644 index 00000000000..edfa89a0b31 --- /dev/null +++ b/CustomWpf/Lib/dotnetCampus.CustomWpf.Lib/Program.cs @@ -0,0 +1,18 @@ +using System; +using System.Runtime.CompilerServices; +using System.Windows; +using System.Windows.Media; +using System.Windows.Media.Composition; +using System.Windows.Navigation; + +namespace dotnetCampus.WPF +{ + class Program + { + static void Main(string[] args) + { + Application application = new Application(); + //NavigationService applicationNavService = application.NavService; + } + } +} diff --git a/CustomWpf/Lib/dotnetCampus.CustomWpf.Lib/dotnet-campus.PublicKey.snk b/CustomWpf/Lib/dotnetCampus.CustomWpf.Lib/dotnet-campus.PublicKey.snk new file mode 100644 index 00000000000..a21f243aa1b Binary files /dev/null and b/CustomWpf/Lib/dotnetCampus.CustomWpf.Lib/dotnet-campus.PublicKey.snk differ diff --git a/CustomWpf/Lib/dotnetCampus.CustomWpf.Lib/dotnet-campus.snk b/CustomWpf/Lib/dotnetCampus.CustomWpf.Lib/dotnet-campus.snk new file mode 100644 index 00000000000..8251708e309 Binary files /dev/null and b/CustomWpf/Lib/dotnetCampus.CustomWpf.Lib/dotnet-campus.snk differ diff --git a/CustomWpf/Lib/dotnetCampus.CustomWpf.Lib/dotnetCampus.WPF.csproj b/CustomWpf/Lib/dotnetCampus.CustomWpf.Lib/dotnetCampus.WPF.csproj new file mode 100644 index 00000000000..5f667bfc3ed --- /dev/null +++ b/CustomWpf/Lib/dotnetCampus.CustomWpf.Lib/dotnetCampus.WPF.csproj @@ -0,0 +1,28 @@ + + + + net6.0-windows + true + True + dotnet-campus.snk + + ..\..\..\ + + + $(Configuration) + + Microsoft.DotNet.Wpf.GitHub.Debug + Microsoft.DotNet.Wpf.GitHub + + + + true + + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb + + + + + + + diff --git a/CustomWpf/Lib/dotnetCampus.CustomWpf.Resource/Build/Package.props b/CustomWpf/Lib/dotnetCampus.CustomWpf.Resource/Build/Package.props new file mode 100644 index 00000000000..ca9ef88448a --- /dev/null +++ b/CustomWpf/Lib/dotnetCampus.CustomWpf.Resource/Build/Package.props @@ -0,0 +1,5 @@ + + + $(MSBuildThisFileDirectory)..\Assets\ + + diff --git a/CustomWpf/Lib/dotnetCampus.CustomWpf.Resource/dotnetCampus.WPF.Resource.csproj b/CustomWpf/Lib/dotnetCampus.CustomWpf.Resource/dotnetCampus.WPF.Resource.csproj new file mode 100644 index 00000000000..092ccde4276 --- /dev/null +++ b/CustomWpf/Lib/dotnetCampus.CustomWpf.Resource/dotnetCampus.WPF.Resource.csproj @@ -0,0 +1,23 @@ + + + + net6.0 + false + true + + ..\..\..\ + + + $(Configuration) + + Microsoft.DotNet.Wpf.GitHub.Debug + Microsoft.DotNet.Wpf.GitHub + + $(WpfRepoRoot)\artifacts\packaging\$(WpfConfig)\$(WpfOuputFolder) + + + + + + + diff --git a/CustomWpf/NuGet.config b/CustomWpf/NuGet.config new file mode 100644 index 00000000000..f578cf96933 --- /dev/null +++ b/CustomWpf/NuGet.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/CustomWpf/Packaging/dotnetCampus.WPF.NuGet/MainTask.cs b/CustomWpf/Packaging/dotnetCampus.WPF.NuGet/MainTask.cs new file mode 100644 index 00000000000..a528545072c --- /dev/null +++ b/CustomWpf/Packaging/dotnetCampus.WPF.NuGet/MainTask.cs @@ -0,0 +1,64 @@ +using System.Reflection; + +using dotnetCampus.Configurations; +using dotnetCampus.DotNETBuild.Context; +using dotnetCampus.DotNETBuild.Utils; +using dotnetCampus.GitCommand; + +namespace dotnetCampus.WPF.NuGet; + +class MainTask +{ + public void Run() + { + var appConfigurator = AppConfigurator.GetAppConfigurator(); + + var commandLineArgs = Environment.GetCommandLineArgs(); + appConfigurator.AddCommandLine(commandLineArgs, new Dictionary() + { + {"t","Tag" } + }); + + var tagVersion = appConfigurator.Default["Tag"]; + + FileSniff fileSniff = new FileSniff(appConfigurator); + fileSniff.Sniff(); + + // 重新寻找 CustomWpf.sln 所在文件夹 + var slnFolder = FindDirectoryByFile(new DirectoryInfo(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!), "CustomWpf.sln")!; + + var compileConfiguration = appConfigurator.Of(); + + Git git = new Git(new DirectoryInfo(compileConfiguration.CodeDirectory)); + var currentCommit = git.GetCurrentCommit(); + + // 找到 Version 版本号文件 + var versionFile = Path.Combine(slnFolder.FullName, @"build\Version.props"); + + } + + /// + /// 向上寻找到存在某个文件名的文件夹 + /// + /// + /// + /// + private static DirectoryInfo FindDirectoryByFile(DirectoryInfo currentDirectory, string fileName) + { + var directory = currentDirectory; + while (directory != null) + { + var file = Path.Combine(directory.FullName, fileName); + if (File.Exists(file)) + { + return directory; + } + else + { + directory = directory.Parent; + } + } + + throw new ArgumentException($"Can not find any Directory. CurrentDirectory =\"{currentDirectory}\";FileName=\"{fileName}\""); + } +} diff --git a/CustomWpf/Packaging/dotnetCampus.WPF.NuGet/Program.cs b/CustomWpf/Packaging/dotnetCampus.WPF.NuGet/Program.cs new file mode 100644 index 00000000000..d59d2ba2a93 --- /dev/null +++ b/CustomWpf/Packaging/dotnetCampus.WPF.NuGet/Program.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using dotnetCampus.Configurations; +using dotnetCampus.DotNETBuild.Utils; + +namespace dotnetCampus.WPF.NuGet; + +// 这个项目现在完全没有被用上 +// 不删除,后续需要再发布 x64 版本 +internal class Program +{ + public static void Main(string[] args) + { + MainTask mainTask = new MainTask(); + mainTask.Run(); + } +} diff --git a/CustomWpf/Packaging/dotnetCampus.WPF.NuGet/dotnetCampus.WPF.NuGet.csproj b/CustomWpf/Packaging/dotnetCampus.WPF.NuGet/dotnetCampus.WPF.NuGet.csproj new file mode 100644 index 00000000000..8b5a0a04d35 --- /dev/null +++ b/CustomWpf/Packaging/dotnetCampus.WPF.NuGet/dotnetCampus.WPF.NuGet.csproj @@ -0,0 +1,15 @@ + + + + Exe + net6.0 + enable + enable + false + + + + + + + diff --git a/CustomWpf/README.md b/CustomWpf/README.md new file mode 100644 index 00000000000..9864e635efd --- /dev/null +++ b/CustomWpf/README.md @@ -0,0 +1,7 @@ +# 私有发布的 WPF 仓库 + +这个仓库包含了官方没有合入的功能 + +## 给开发者 + +本仓库当前固定 dotnet 版本号,用来解决引用依赖问题。如有升级 dotnet runtime 版本,请同步更改 global.json 的 sdk 版本号,以及 `.github\workflows\` 里面的构建代码的安装版本号 \ No newline at end of file diff --git a/CustomWpf/build/Version.props b/CustomWpf/build/Version.props new file mode 100644 index 00000000000..0fd74ea58ea --- /dev/null +++ b/CustomWpf/build/Version.props @@ -0,0 +1,5 @@ + + + 6.0.4-alpha01-202205a6c7dca6 + + diff --git a/README.md b/README.md index abfa3e03b2a..d5103b5ebb8 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,34 @@ +# The Custom Windows Presentation Foundation (WPF) + +This repository fork from [WPF](https://github.com/dotnet/wpf), but contains code that is not officially merged. + +The reason for creating this repo is that we can't wait for some fascinating features. + +![](https://github.com/dotnet-campus/dotnetCampus.CustomWpf/workflows/Build%20WPF/badge.svg) + +| NuGet | Version | +|--|--| +|dotnetCampus.WPF|[![](https://img.shields.io/nuget/v/dotnetCampus.WPF.svg)](https://www.nuget.org/packages/dotnetCampus.WPF)| +|dotnetCampus.WPF.Dependencies|[![](https://img.shields.io/nuget/v/dotnetCampus.WPF.Resource.svg)](https://www.nuget.org/packages/dotnetCampus.WPF.Resource)| +|dotnetCampus.WPF.Resource|[![](https://img.shields.io/nuget/v/dotnetCampus.WPF.Dependencies.svg)](https://www.nuget.org/packages/dotnetCampus.WPF.Dependencies)| + +## What version are we on? + +[v6.0.4](https://github.com/dotnet/wpf/releases/tag/v6.0.4) + +[fcb07d637abf53791e2c55c63d9207fc3232fe83](https://github.com/dotnet/wpf/commit/fcb07d637abf53791e2c55c63d9207fc3232fe83) + +## Features + +- [ToolTip closes immediately in high DPI by SamBent · Pull Request #6332 · dotnet/wpf](https://github.com/dotnet/wpf/pull/6332) +- [Try fix the first point in StylusPlugin in high DPI by lindexi · Pull Request #6428 · dotnet/wpf](https://github.com/dotnet/wpf/pull/6428) + +## Contribution + +We recommend that you submit the Pull Request to the official [WPF](https://github.com/dotnet/wpf) repository and then you can ask we to pick the commit to this repository. This repository does not accept commit. + +----- + # Windows Presentation Foundation (WPF) [![.NET Foundation](https://img.shields.io/badge/.NET%20Foundation-blueviolet.svg)](https://www.dotnetfoundation.org/) [![Build Status](https://dnceng.visualstudio.com/public/_apis/build/status/dotnet/wpf/dotnet-wpf%20CI)](https://dnceng.visualstudio.com/public/_build/latest?definitionId=270) diff --git a/src/Microsoft.DotNet.Wpf/src/Common/src/System/SR.cs b/src/Microsoft.DotNet.Wpf/src/Common/src/System/SR.cs index 0ecaad06f94..5b2b5db760a 100644 --- a/src/Microsoft.DotNet.Wpf/src/Common/src/System/SR.cs +++ b/src/Microsoft.DotNet.Wpf/src/Common/src/System/SR.cs @@ -6,6 +6,8 @@ using System.Resources; using System.Runtime.CompilerServices; +[assembly:InternalsVisibleTo("dotnetCampus.WPF, PublicKey=0024000004800000940000000602000000240000525341310004000001000100256f5cb79140dbc25623807d6823ca4b5b602209eaaf71f064e5926a7039c24351c1e2ad3130e194631307ed36a76ad4b832e237a467fefbd693428c7ecc5d4cc26796f6f8b705311948e00f2be5fa2db52ddff50a5b3eb0acc715b45618c1a92532ae2326529fb9e0f58a44abf31e9b5701994464186d3b9f52169b6e0f80b9")] + #if WINDOWS_BASE namespace MS.Internal.WindowsBase #elif PRESENTATION_CORE