Skip to content

Commit

Permalink
Merge pull request #59 from ekonbenefits/moderize-repo
Browse files Browse the repository at this point in the history
Moderize repo 2024
  • Loading branch information
jbtule authored Nov 16, 2024
2 parents 1ca458a + a1bf9e8 commit 174a6d5
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 29 deletions.
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>

0 comments on commit 174a6d5

Please sign in to comment.