Skip to content

Commit

Permalink
Modernize build
Browse files Browse the repository at this point in the history
  • Loading branch information
jbtule committed Nov 16, 2024
1 parent 38fcb82 commit 9202ef3
Show file tree
Hide file tree
Showing 18 changed files with 59 additions and 41 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ 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
Expand Down
25 changes: 12 additions & 13 deletions .github/workflows/dotnet48.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,26 @@ on: [push]

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

- uses: actions/checkout@v2

- name: Setup NuGet
uses: NuGet/setup-nuget@v1.2.0

- name: setup-msbuild
uses: microsoft/setup-msbuild@v1.1

- uses: actions/checkout@v4
- uses: NuGet/setup-nuget@v2
- uses: microsoft/setup-msbuild@v2
with:
dotnet-version: 4.8
- name: Restore Packages
run: nuget restore Dynamitey.sln
- name: Build solution
run: msbuild Dynamitey.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: Tests.dll
searchFolder: .\Tests\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 }}
2 changes: 1 addition & 1 deletion Dynamitey/DynamicObjects/BaseObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public bool TryTypeForName(string binderName, out Type type)
return m.ReturnType;
case EventInfo e:
return e.EventHandlerType;
#if NET40 || PROFILE158
#if NETFRAMEWORK || PROFILE158
case Type t:
return t;
#else
Expand Down
12 changes: 6 additions & 6 deletions Dynamitey/DynamicObjects/Builder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -291,15 +291,15 @@ public dynamic ObjectSetup(Func<object[]> constructorArgsFactory)
///<summary>
/// Trampoline for builder
///</summary>
public class BuilderTrampoline<TObjectProtoType> : DynamicObject
public class BuilderTrampoline<TInnerObjectProtoType> : DynamicObject
{
Builder<TObjectProtoType> _buider;
Builder<TInnerObjectProtoType> _buider;

/// <summary>
/// Initializes a new instance of the <see cref="Builder{TObjectProtoType}.BuilderTrampoline"/> class.
/// </summary>
/// <param name="builder">The builder.</param>
public BuilderTrampoline(Builder<TObjectProtoType> builder)
public BuilderTrampoline(Builder<TInnerObjectProtoType> builder)
{
_buider = builder;
}
Expand All @@ -324,15 +324,15 @@ public override bool TryInvoke(InvokeBinder binder, object[] args, out object re
/// <summary>
/// Trampoline for setup builder
/// </summary>
public class SetupTrampoline<TObjectProtoType> : DynamicObject
public class SetupTrampoline<TInnerObjectProtoType> : DynamicObject
{
Builder<TObjectProtoType> _buider;
Builder<TInnerObjectProtoType> _buider;

/// <summary>
/// Initializes a new instance of the <see cref="Builder{TObjectProtoType}.SetupTrampoline"/> class.
/// </summary>
/// <param name="builder">The builder.</param>
public SetupTrampoline(Builder<TObjectProtoType> builder){
public SetupTrampoline(Builder<TInnerObjectProtoType> builder){
_buider = builder;
}

Expand Down
10 changes: 8 additions & 2 deletions Dynamitey/Dynamitey.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Authors />
<Copyright>Copyright 2017 Ekon Benefits</Copyright>
<PackageProjectUrl>https://github.com/ekonbenefits/dynamitey</PackageProjectUrl>
<PackageLicenseUrl>http://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageTags>dynamic metaprogramming dlr reflection currying tuples expando latetypes</PackageTags>
<IncludeSymbols>True</IncludeSymbols>
<IncludeSource>True</IncludeSource>
Expand Down Expand Up @@ -66,5 +66,11 @@
</Compile>
</ItemGroup>


<Target Name="CopyPackage" AfterTargets="Pack">
<Copy
SourceFiles="$(OutputPath)$(PackageId).$(PackageVersion).nupkg"
DestinationFolder="$(SolutionDir)\publish"
/>
</Target>

</Project>
2 changes: 1 addition & 1 deletion Dynamitey/Internal/Compat/Net40.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Dynamitey.Internal.Compat

public static class Net40
{
#if NET40 || PROFILE158
#if NETFRAMEWORK || PROFILE158

public static Type GetTypeInfo(this Type type)
{
Expand Down
1 change: 0 additions & 1 deletion NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
</config>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="Dynamitey.myget" value="https://www.myget.org/F/dynamitey-ci/api/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
2 changes: 1 addition & 1 deletion Tests/Curry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace Dynamitey.Tests
{
[TestFixture]
public class Curry : AssertionHelper
public class Curry : Helper
{
[Test]
public void TestBasicDelegateCurry()
Expand Down
4 changes: 2 additions & 2 deletions Tests/DynamicObjects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
namespace Dynamitey.Tests
{
[TestFixture]
public class DynamicObjs : AssertionHelper
public class DynamicObjs : Helper
{


Expand Down Expand Up @@ -573,7 +573,7 @@ public void TestRecorder()
}


#if !NET6_0_OR_GREATER
#if NETFRAMEWORK

[Test]
public void TestCodeDomLateTypeBind()
Expand Down
2 changes: 1 addition & 1 deletion Tests/ExpandoObjs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Dynamitey.Tests
{
[TestFixture]
public class ExpandoObjs : AssertionHelper
public class ExpandoObjs : Helper
{
[Test]
public void TestExpando()
Expand Down
11 changes: 11 additions & 0 deletions Tests/Helper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using NUnit.Framework;

namespace Dynamitey.Tests
{
#pragma warning disable CS0618 // Type or member is obsolete
public class Helper:AssertionHelper
#pragma warning restore CS0618 // Type or member is obsolete
{

}
}
2 changes: 1 addition & 1 deletion Tests/Impromptu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
namespace Dynamitey.Tests
{
[TestFixture(Category = "Impromptu")]
public class Impromptu:AssertionHelper
public class Impromptu:Helper
{

public static readonly dynamic Interfacing
Expand Down
4 changes: 3 additions & 1 deletion Tests/Invoke.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace Dynamitey.Tests
{
public class Invoke:AssertionHelper
public class Invoke:Helper
{
[OneTimeTearDown]
public void DestroyCaches()
Expand Down Expand Up @@ -1416,7 +1416,9 @@ private void RunBinaryMockTests(ExpressionType type){

private void RunUnaryMockTests(ExpressionType type){
var mock = new OperatorTestDynObject(type);
#pragma warning disable CS0618 // Type or member is obsolete
Dynamic.InvokeUnaryOpartor(type,mock);
#pragma warning restore CS0618 // Type or member is obsolete
}

[Test]
Expand Down
2 changes: 1 addition & 1 deletion Tests/Linq.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace Dynamitey.Tests
{
[TestFixture]
public class Linq : AssertionHelper
public class Linq : Helper
{


Expand Down
2 changes: 1 addition & 1 deletion Tests/PrivateTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace Dynamitey.Tests
{
[TestFixture]
public class PrivateTest : AssertionHelper
public class PrivateTest : Helper
{

[Test]
Expand Down
2 changes: 1 addition & 1 deletion Tests/SpeedTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Dynamitey.Tests
{
[TestFixture]
[Category("Performance")]
public class SpeedTest:AssertionHelper
public class SpeedTest:Helper
{
[OneTimeSetUp]
public void WarmUpDlr()
Expand Down
6 changes: 3 additions & 3 deletions Tests/Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6;net48</TargetFrameworks>
<TargetFrameworks>net8.0;net48</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ImpromptuInterface" Version="8.0.4" />
<PackageReference Include="ImpromptuInterface" Version="8.0.*" />
<PackageReference Include="Microsoft.CSharp" Version="4.*" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="FSharp.Core" Version="4.7.2" />
<PackageReference Include="Moq" Version="4.20.69" />
<PackageReference Include="NUnit.Console" Version="3.16.3" />
<PackageReference Include="IronPython" Version="2.7.12" />
<PackageReference Include="System.Drawing.Common" Version="8.0.11"/>

</ItemGroup>

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>3.0.3</VersionPrefix>
<VersionPrefix>3.0.4</VersionPrefix>
<VersionSuffix Condition=" '$(GITHUB_RUN_NUMBER)' != '' ">preview$(GITHUB_RUN_NUMBER)</VersionSuffix>
</PropertyGroup>
</Project>

0 comments on commit 9202ef3

Please sign in to comment.