diff --git a/.github/project.yml b/.github/project.yml index bb69b3bb..b37d1484 100644 --- a/.github/project.yml +++ b/.github/project.yml @@ -237,6 +237,16 @@ src: project_folder: src/Natasha.CSharp/Extension/HotExecutor/Natasha.CSharp.HotExecutor.SG labels: dependency_config: + - using_output: + id: 8B5F2626-8EB0-44FF-9F1F-A1EFBCF8E030 + is_ignored: false + is_folded: false + relative_path: src/Natasha.CSharp/Extension/HotExecutor/Natasha.CSharp.HotExecutor.Wrapper/Natasha.CSharp.HotExecutor.Wrapper.csproj + project_name: Natasha.CSharp.HotExecutor.Wrapper + package_name: DotNetCore.Natasha.CSharp.HotExecutor.Wrapper + project_folder: src/Natasha.CSharp/Extension/HotExecutor/Natasha.CSharp.HotExecutor.Wrapper + labels: + dependency_config: test: folded_projects: [] global_labels: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 046d1226..f930d7b6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -109,3 +109,45 @@ jobs: - name: 📶 Push to Nuget if: ${{ needs.prepare_check.outputs.hasNugetKey == 'true' }} run: dotnet nuget push *.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate + + release: + + runs-on: ubuntu-latest + needs: prepare_check + env: + RELEASE_VERSION: ${{needs.prepare_check.outputs.releaseVersion}} + PACK_STRING: ${{needs.prepare_check.outputs.releasePackString}} + + steps: + - uses: actions/checkout@v4 + - name: 🎉 Release + run: | + RELEASE_ID=$(gh api graphql -H "X-Github-Next-Global-ID: 1" -f query=' + query{ + repository(owner:"${{github.repository_owner}}",name:"${{github.event.repository.name}}"){ + release(tagName:"v${{env.RELEASE_VERSION}}"){ + id + } + } + }' --jq '.data.repository.release.id') + + RESULT=0 + if [ "$RELEASE_ID" != "" ]; then + if [ "$RELEASE_ID" != "null" ]; then + RESULT=1 + fi + fi + if [ $RESULT == 0 ]; then + + echo "::debug::no release package" + echo "不存在 Id ,开始创建 Release v${{env.RELEASE_VERSION}} 包!" + gh release create v${{env.RELEASE_VERSION}} -F CHANGELOG.md + + else + + + echo "::debug::exist release package" + echo "该 Release v${{env.RELEASE_VERSION}} 包已存在!" + gh release edit v${{env.RELEASE_VERSION}} --notes-file CHANGELOG.md + + fi \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index efe69733..27d86444 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,18 +65,57 @@ Example: --> -## [9.0.0.0] - 2024-11-13 +## [9.0.0.1] - 2024-11-13 -### DotNetCore.Natasha.CSharp.HotExecutor _ v9.0.0.0: +### DotNetCore.Natasha.CSharp.HotExecutor _ v9.0.0.1: - 基于 Natasha 的热执行,允许程序在运行时更改代码,并输出新的结果. - 跟随其他扩展库版本号发布. -### DotNetCore.Natasha.CSharp.HotExecutor.SG _ v9.0.0.0: +### DotNetCore.Natasha.CSharp.HotExecutor.SG _ v9.0.0.1: - 热执行的 SG 扩展库. - 跟随其他扩展库版本号发布. -### DotNetCore.Natasha.CSharp.HotExecutor.Wrapper _ v8.9.0.0: +### DotNetCore.Natasha.CSharp.HotExecutor.Wrapper _ v9.0.0.1: - 热执行 + SG 封装库. - 跟随其他扩展库版本号发布. +### DotNetCore.Natasha.CSharp.Compiler _ v9.0.0.1: +- 增加私有操作系列 API. +- 升级 Roslyn 依赖. +- 优化异常报告,增加 GetException API 以便在编译周期外获取异常. +- 增加复用系列 API. +- 增加重复编译时文件命名策略. +- 优化 API 注释. +- "Domain" 系列 API 重命名为 "LoadContext". +- 优化 编译级别 API, 使用编译级别是更容易看懂. +- 增加链式初始化器. + +### DotNetCore.Natasha.CSharp.Template.Core _ v9.0.0.1: +- 跟随 Compiler 升级依赖. + +### DotNetCore.Natasha.CSharp.Extension.Codecov _ v9.0.0.1: +- 跟随 Compiler 升级依赖. + +### DotNetCore.Natasha.CSharp.Extension.Ambiguity _ v9.0.0.1: +- 跟随 Compiler 升级依赖. + +### DotNetCore.Natasha.CSharp.Extension.MethodCreator _ v9.0.0.1: +- 发布 便捷动态方法编译模板. +- 跟随其他扩展库版本号发布. + +### DotNetCore.Natasha.CSharp.Extension.CompileDirector _ v9.0.0.1: +- 编译导演,每次编译学习并保留有用的 using code. +- 跟随其他扩展库版本号发布. + +### DotNetCore.Natasha.CSharp.Compiler.Domain _ v9.0.0.1: +- 跟随其他扩展库版本号发布. + +### DotNetCore.Natasha.Domain _ v9.0.0.1: +- 跟随其他扩展库版本号发布. + +### DotNetCore.Natasha.DynamicLoad.Base _ v9.0.0.1: +- 跟随其他扩展库版本号发布. + + + diff --git a/samples/ExtensionSample/Class7.cs b/samples/ExtensionSample/Class7.cs new file mode 100644 index 00000000..b29b33ce --- /dev/null +++ b/samples/ExtensionSample/Class7.cs @@ -0,0 +1,33 @@ + +//#if DEBUG +using System.IO; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using Natasha.CSharp.HotExecutor.Component; +using Natasha.CSharp.Extension.HotExecutor; +using ExtensionSample; +namespace System +{ + + + class InterceptMain1 + { + + [ModuleInitializer] + internal static void PreMain() + { + + HEProxy.SetProjectKind(HEProjectKind.Console); + HEProxy.SetCompileInitAction(() => { + + NatashaManagement.RegistDomainCreator(); + NatashaManagement.Preheating((asmName, @namespace) => !string.IsNullOrWhiteSpace(@namespace) && (@namespace.StartsWith("Microsoft.VisualBasic") || HEProxy.IsExcluded(@namespace)), true, true); + + }); + HEProxy.Run(); + + } + + } +} +//#endif diff --git a/samples/ExtensionSample/ExtensionSample.csproj b/samples/ExtensionSample/ExtensionSample.csproj index 9164b63d..b0b95708 100644 --- a/samples/ExtensionSample/ExtensionSample.csproj +++ b/samples/ExtensionSample/ExtensionSample.csproj @@ -5,7 +5,7 @@ net8.0 preview enable - enable + true @@ -14,14 +14,14 @@ - + + + - - - - diff --git a/samples/ExtensionSample/Program.cs b/samples/ExtensionSample/Program.cs index cda13d22..d2eec1e6 100644 --- a/samples/ExtensionSample/Program.cs +++ b/samples/ExtensionSample/Program.cs @@ -61,8 +61,6 @@ static void Main(string[] args) //{ // Console.WriteLine("无法获取父进程信息。错误代码: " + status); //} - - HEProxyState.Value += 1; for (int i = 0; i < args.Length; i++) { @@ -160,7 +158,7 @@ public static void ProxyMainArguments() HEProxy.AppendArgs("参数3"); HEProxy.AppendArgs("参数4"); } - + /* private static void RunAssemblyBuilder(CompileDirector director) { var builder = director.CreateBuilder(); @@ -176,7 +174,7 @@ public static void Show() asm.GetDelegateFromShortName("A", "Show")!(); } - /* + public static async void TestPage() { GithubQueryData query = new() diff --git a/src/Directory.Build.props b/src/Directory.Build.props index d0555ea5..1176719e 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -10,7 +10,7 @@ true true .NET Core Community - NMSAzulx + NMSAzulx;LanX;ncc; preview enable true diff --git a/src/Natasha.CSharp/Extension/HotExecutor/Natasha.CSharp.HotExecutor/Natasha.CSharp.HotExecutor.csproj b/src/Natasha.CSharp/Extension/HotExecutor/Natasha.CSharp.HotExecutor/Natasha.CSharp.HotExecutor.csproj index 22ff5a5a..3b394b3d 100644 --- a/src/Natasha.CSharp/Extension/HotExecutor/Natasha.CSharp.HotExecutor/Natasha.CSharp.HotExecutor.csproj +++ b/src/Natasha.CSharp/Extension/HotExecutor/Natasha.CSharp.HotExecutor/Natasha.CSharp.HotExecutor.csproj @@ -19,8 +19,8 @@ - - - + + + diff --git a/src/Natasha.CSharp/Natasha.CSharp.Compiler/Targets/Project.Usings.targets b/src/Natasha.CSharp/Natasha.CSharp.Compiler/Targets/Project.Usings.targets index b6e310d0..4f982b14 100644 --- a/src/Natasha.CSharp/Natasha.CSharp.Compiler/Targets/Project.Usings.targets +++ b/src/Natasha.CSharp/Natasha.CSharp.Compiler/Targets/Project.Usings.targets @@ -3,8 +3,6 @@ - diff --git a/test/workflow/Workflow.Initialization/Core/ConfigRunner.cs b/test/workflow/Workflow.Initialization/Core/ConfigRunner.cs index f68b7a23..6af71460 100644 --- a/test/workflow/Workflow.Initialization/Core/ConfigRunner.cs +++ b/test/workflow/Workflow.Initialization/Core/ConfigRunner.cs @@ -310,7 +310,7 @@ internal static void GenUsings(SolutionConfiguration solutionInfo) } var collection = SolutionInfo.GetCSProjectsByStartFolder("src"); var projectMapper = collection.Projects.ToDictionary(item => item.Id, item => item); - Regex usingReg = new Regex("namespace (?.*?)[;{].*?public[^\\r\\n]*?(class|struct|enum|interface|record).*?{", RegexOptions.Singleline | RegexOptions.Compiled); + Regex usingReg = new Regex("namespace (?.*?)[ ;{\\r\\n].*?public[^\\r\\n]*?(class|struct|enum|interface|record).*?{", RegexOptions.Singleline | RegexOptions.Compiled); Regex buildReg = new Regex("[\\s]*?", RegexOptions.Singleline | RegexOptions.Compiled); foreach (var project in solutionInfo.Src.Projects)