From 148c707f7bd7805144b99eefd67eb46e7d5cc2fb Mon Sep 17 00:00:00 2001 From: Beakona Date: Sun, 28 Jan 2024 09:22:50 +0100 Subject: [PATCH] Actions --- .github/workflows/codeql-analysis.yml | 8 +++--- .github/workflows/dotnet-core.yml | 4 +-- .github/workflows/nuget.yml | 10 ++++---- AutoInterfaceSample/Program.cs | 35 +++++++++++---------------- 4 files changed, 25 insertions(+), 32 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 79d3548..bb3642d 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -47,11 +47,11 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -64,7 +64,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 # ℹī¸ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -81,6 +81,6 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 with: category: "/language:${{matrix.language}}" diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml index 6abed5e..730040f 100644 --- a/.github/workflows/dotnet-core.yml +++ b/.github/workflows/dotnet-core.yml @@ -18,9 +18,9 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup dotnet - uses: actions/setup-dotnet@v2 + uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ env.DOTNET_VERSION }} - name: Install dependencies diff --git a/.github/workflows/nuget.yml b/.github/workflows/nuget.yml index 998f686..3d9c681 100644 --- a/.github/workflows/nuget.yml +++ b/.github/workflows/nuget.yml @@ -20,9 +20,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup dotnet - uses: actions/setup-dotnet@v2 + uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ env.DOTNET_VERSION }} - name: Install dependencies @@ -37,9 +37,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup dotnet - uses: actions/setup-dotnet@v2 + uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ env.DOTNET_VERSION }} - name: Pack @@ -61,7 +61,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Setup dotnet - uses: actions/setup-dotnet@v2 + uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ env.DOTNET_VERSION }} - name: Download Artifact diff --git a/AutoInterfaceSample/Program.cs b/AutoInterfaceSample/Program.cs index d299b4c..081c39b 100644 --- a/AutoInterfaceSample/Program.cs +++ b/AutoInterfaceSample/Program.cs @@ -12,35 +12,28 @@ public static void Main() //int g = 1; //p.Method(1, out f, ref g, "t", 1, 2, 3); - IPrintableComplex p = new Person2(); + IPrintable p = new MyPrinter(); //var c = p.Count; - p.Count = 3; - //p.Print(); + //Count = 3; + p.Print(); //p.PrintComplex(); } } - interface IPrintableComplex + public interface IPrintable { - void Print(); - void PrintComplex(); - int Count { set; } + public void Print(); } - public class SimplePrinter // : IPrintableComplex + public class SimplePrinter : IPrintable { public void Print() { Console.WriteLine("OK"); } - public void PrintComplex() { Console.WriteLine("OKC"); } - public int Count - { - get - { - return 0; - } - set - { - } - } + } + + public partial class MyPrinter : IPrintable + { + [BeaKona.AutoInterface] + private readonly IPrintable _simplePrinter = new SimplePrinter(); } public partial class Person2 /*: IPrintableComplex*/ @@ -51,8 +44,8 @@ public partial class Person2 /*: IPrintableComplex*/ //[BeaKona.AutoInterface(typeof(IPrintableComplex), AllowMissingMembers = true, MemberMatch = BeaKona.MemberMatchTypes.Explicit)] //private readonly SimplePrinter aspect2 = new SimplePrinter(); - [BeaKona.AutoInterface(typeof(IPrintableComplex), AllowMissingMembers = true)] - private readonly SimplePrinter aspect3 = new SimplePrinter(); + //[BeaKona.AutoInterface(typeof(IPrintableComplex), AllowMissingMembers = true)] + //private readonly SimplePrinter aspect3 = new SimplePrinter(); //[BeaKona.AutoInterface(typeof(IPrintableComplex), AllowMissingMembers = true, MemberMatch = BeaKona.MemberMatchTypes.Any)] //private readonly SimplePrinter aspect4 = new SimplePrinter();