Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moderize repo 2024 #59

Merged
merged 6 commits into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
dotnet: [ '6.0.x' ]
os: [ubuntu-latest, windows-latest, macOS-latest]
dotnet: [ '8.0.x' ]
os: [ubuntu-latest, macOS-latest]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Build with dotnet core
run: dotnet build --configuration Release
- name: Tests
run: dotnet test Tests/UnitTestImpromptuInterface/UnitTestImpromptuInterface.csproj --configuration Release --no-build --no-restore --filter=TestCategory!=Performance
run: dotnet test Tests/UnitTestImpromptuInterface/UnitTestImpromptuInterface.csproj --configuration Release --no-build --no-restore --filter=TestCategory!=Performance
30 changes: 15 additions & 15 deletions .github/workflows/dotnet48.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
name: Build CrossComple .net core/.net framework Windows
name: .net framework Windows

on: [push]

jobs:
build:
name: Test Windows .net Framework Only
runs-on: windows-2019
runs-on: windows-2022
steps:

- uses: actions/checkout@v2

- name: Setup NuGet
uses: NuGet/[email protected]

- name: setup-msbuild
uses: microsoft/[email protected]

- name: Restore Packages
- uses: actions/checkout@v4
- uses: NuGet/setup-nuget@v2
- uses: microsoft/setup-msbuild@v2
with:
dotnet-version: 4.7.2

- name: Restore
run: nuget restore ImpromptuInterface.sln
- name: Build solution
- name: Build
run: msbuild ImpromptuInterface.sln -t:rebuild -property:Configuration=Release
- name: Run vstests
uses: microsoft/vstest-action@v1.0.0
- name: Test
uses: josepho0918/vstest-action@0e887de8dcfab5ce3eecaf4ad6320bb9b3ecf633
with:
testAssembly: UnitTestImpromptuInterface.dll
searchFolder: .\Tests\UnitTestImpromptuInterface\bin\Release\*\
runInParallel: true
otherConsoleOptions: /TestCaseFilter:"(TestCategory!=Performance)"
platform: x64
- name: Publish
run:
dotnet nuget push '${{ github.workspace }}\publish\*.nupkg' --source https://nuget.pkg.github.com/ekonbenefits/index.json --api-key ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions ImpromptuInterface.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{87291621-4395-4EFE-A070-9A007B26EF6D}"
ProjectSection(SolutionItems) = preProject
Version.props = Version.props
Readme.md = Readme.md
EndProjectSection
EndProject
Global
Expand Down
14 changes: 12 additions & 2 deletions ImpromptuInterface/ImpromptuInterface.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@
<Authors> jbtule </Authors>
<Copyright>Copyright © Contributors 2010-2017</Copyright>
<PackageProjectUrl>https://github.com/ekonbenefits/impromptu-interface</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/ekonbenefits/impromptu-interface/blob/master/License.txt</PackageLicenseUrl>
<PackageIconUrl>https://raw.githubusercontent.com/ekonbenefits/impromptu-interface/master/graphics/ImpromptuInterface-Icon.png</PackageIconUrl>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageIcon>ImpromptuInterface-Icon.png</PackageIcon>
<PackageTags>ducktyping duckcasting dynamic .net40 Silverlight proxy impromptu interface reflection dlr currying</PackageTags>
<IncludeSymbols>True</IncludeSymbols>
<IncludeSource>True</IncludeSource>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
</PropertyGroup>
<Import Project="..\Version.props" />

<ItemGroup>
<PackageReference Include="Dynamitey" Version="3.0.3" />
</ItemGroup>
Expand All @@ -27,4 +28,13 @@
<PackageReference Include="System.Reflection.Emit" Version="4.*" />
<PackageReference Include="Microsoft.CSharp" Version="4.*" />
</ItemGroup>
<ItemGroup>
<None Include="../graphics/ImpromptuInterface-Icon.png" Pack="true" PackagePath="\"/>
</ItemGroup>
<Target Name="CopyPackage" AfterTargets="Pack">
<Copy
SourceFiles="$(OutputPath)$(PackageId).$(PackageVersion).nupkg"
DestinationFolder="$(SolutionDir)\publish"
/>
</Target>
</Project>
4 changes: 2 additions & 2 deletions ImpromptuInterface/src/EmitProxy/ActLikeMaker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
namespace ImpromptuInterface.Build
{

#if NET40
#if NETFRAMEWORK
public class SaveableActLikeMaker : ActLikeMaker
{
public SaveableActLikeMaker(AssemblyBuilderAccess access, string assemblyName = null) : base(access, assemblyName)
Expand Down Expand Up @@ -1775,7 +1775,7 @@ private static void GenerateAssembly(string name, AssemblyBuilderAccess access,

mb =

#if NET40
#if NETFRAMEWORK
access.HasFlag(AssemblyBuilderAccess.Save)
? ab.DefineDynamicModule("MainModule", $"{tName.Name}.dll") :
#endif
Expand Down
4 changes: 2 additions & 2 deletions ImpromptuInterface/src/EmitProxy/BuildProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace ImpromptuInterface.Build
using System.Reflection.Emit;


#if NET40
#if NETFRAMEWORK
internal static class CompatHelper
{
public static Type GetTypeInfo(this Type type) => type;
Expand Down Expand Up @@ -50,7 +50,7 @@ public static class BuildProxy

public static ActLikeMaker CollectableProxyMaker() => new ActLikeMaker(AssemblyBuilderAccess.RunAndCollect);

#if NET40
#if NETFRAMEWORK
public static SaveableActLikeMaker SaveableProxyMaker(string assemblyName = null) => new SaveableActLikeMaker(AssemblyBuilderAccess.RunAndSave, assemblyName);
#endif
}
Expand Down
5 changes: 4 additions & 1 deletion Tests/UnitTestImpromptuInterface/Support/Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ public void WriteLine(string format, params object[] args)
Console.WriteLine(format,args);
}
}


//Not rewriting test for no good reason
#pragma warning disable CS0618 // Type or member is obsolete
public class Helper:AssertionHelper
#pragma warning restore CS0618 // Type or member is obsolete
{
public WriteLineContext TestContext
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6;net47</TargetFrameworks>
<TargetFrameworks>net8.0;net47</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
3 changes: 2 additions & 1 deletion Version.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project>
<PropertyGroup>
<VersionPrefix>8.0.4</VersionPrefix>
<VersionPrefix>8.0.6</VersionPrefix>
<VersionSuffix Condition=" '$(GITHUB_RUN_NUMBER)' != '' ">preview$(GITHUB_RUN_NUMBER)</VersionSuffix>
</PropertyGroup>
</Project>
Loading