Skip to content

Commit

Permalink
Merge pull request #23 from Miista/22-release-v20-to-nuget
Browse files Browse the repository at this point in the history
Release v2.0 to NuGet

Version 2.0 supports the following targets:
* .NET Standard 2.0
* .NET Core 2.0
* .NET Core 3.0
* .NET Framework 4.8
* .NET 7
* .NET 8

Version 2.0 fixes the following issues:
* tonerdo/pose#17
* tonerdo/pose#37
* tonerdo/pose#38
* tonerdo/pose#41
* tonerdo/pose#47
* tonerdo/pose#49
* tonerdo/pose#60
* tonerdo/pose#67
* tonerdo/pose#68
* tonerdo/pose#70
* tonerdo/pose#71
* tonerdo/pose#72
* tonerdo/pose#75
* tonerdo/pose#79
  • Loading branch information
Miista authored Jan 25, 2024
2 parents 9c227df + e8ff766 commit 2504e79
Show file tree
Hide file tree
Showing 7 changed files with 144 additions and 13 deletions.
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"cake.tool": {
"version": "0.38.5",
"commands": [
"dotnet-cake"
]
}
}
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2017 Toni Solarin-Sodara
Copyright (c) Søren Guldmund

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 8 additions & 0 deletions Pose.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pose.Tests", "test\Pose.Tes
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sandbox", "src\Sandbox\Sandbox.csproj", "{46827F5F-E0FD-428B-960C-9EFFFA3D7D9D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "0. Solution", "0. Solution", "{970BBCC3-BC34-424B-B171-7ACC67C7BDC6}"
ProjectSection(SolutionItems) = preProject
LICENSE = LICENSE
README.md = README.md
nuget\Poser.nuspec = nuget\Poser.nuspec
build.cake = build.cake
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Windows build status](https://ci.appveyor.com/api/projects/status/github/tonerdo/pose?branch=master&svg=true)](https://ci.appveyor.com/project/tonerdo/pose)
[![Build status](https://dev.azure.com/palmund/Pose/_apis/build/status/Pose-CI?branchName=master)](https://dev.azure.com/palmund/Pose/_build/latest?definitionId=12)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![NuGet version](https://badge.fury.io/nu/Pose.svg)](https://www.nuget.org/packages/Pose)
[![NuGet version](https://badge.fury.io/nu/Poser.svg)](https://www.nuget.org/packages/Poser)
# Pose

Pose allows you to replace any .NET method (including static and non-virtual) with a delegate. It is similar to [Microsoft Fakes](https://msdn.microsoft.com/en-us/library/hh549175.aspx) but unlike it Pose is implemented _entirely_ in managed code (Reflection Emit API). Everything occurs at runtime and in-memory, no unmanaged Profiling APIs and no file system pollution with re-written assemblies.
Expand All @@ -9,7 +9,7 @@ Pose is cross platform and runs anywhere .NET is supported. It targets .NET Stan

## Installation

Available on [NuGet](https://www.nuget.org/packages/Pose/)
Available on [NuGet](https://www.nuget.org/packages/Poser/)

Visual Studio:

Expand Down
63 changes: 63 additions & 0 deletions build.cake
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
var target = Argument("target", "Default");

var solutionFile = "./Pose.sln";
var nuspecFileName = "Poser";

Task("Build")
.Does(() =>
{
var buildSettings = new DotNetCoreBuildSettings
{
Configuration = "Release",
Verbosity = DotNetCoreVerbosity.Minimal
};

DotNetCoreBuild(solutionFile, buildSettings);

});

Task("Test")
.Does(() =>
{
var settings = new DotNetCoreTestSettings
{
Verbosity = DotNetCoreVerbosity.Minimal
};

DotNetCoreTest(solutionFile, settings);
})
;

Task("Default")
.IsDependentOn("Build")
.IsDependentOn("Test")
;

Task("Pack")
//.IsDependentOn("Build")
//.IsDependentOn("Test")
.Does(() =>
{
Pack("Pose", new [] { "netstandard2.0" });
})
;

RunTarget(target);

public void Pack(string projectName, string[] targets)
{
var buildSettings = new DotNetCoreMSBuildSettings()
.WithProperty("NuspecFile", $"../../nuget/{nuspecFileName}.nuspec")
.WithProperty("NuspecBasePath", "bin/Release");
var settings = new DotNetCorePackSettings
{
MSBuildSettings = buildSettings,
Verbosity = DotNetCoreVerbosity.Minimal,
Configuration = "Release",
IncludeSource = true,
IncludeSymbols = true,
OutputDirectory = "./nuget"
};

DotNetCorePack($"./src/{projectName}/{projectName}.csproj", settings);
}
56 changes: 56 additions & 0 deletions nuget/Poser.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Poser</id>
<version>2.0.0</version>
<title>Pose</title>
<authors>Søren Guldmund</authors>
<owners>Søren Guldmund</owners>
<projectUrl>https://github.com/Miista/Pose</projectUrl>
<repository type="git" url="https://github.com/Miista/Pose.git" />
<license type="expression">MIT</license>
<!-- <licenseUrl>https://github.com/Miista/pose/blob/master/LICENSE</licenseUrl>-->
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<tags>pose;mocking;testing;unit-test;isolation-framework;test-framework</tags>
<description>Replace any .NET method (including static and non-virtual) with a delegate</description>
<copyright>Copyright 2024</copyright>
<readme>docs\README.md</readme>
<releaseNotes>
Provide better exception message when we cannot create instance.
</releaseNotes>

<dependencies>
<dependency id="Mono.Reflection.Core" version="1.1.1" />
<dependency id="System.Reflection.Emit.Lightweight" version="4.3.0" />
<dependency id="System.Runtime.CompilerServices.Unsafe" version="5.0.0" />
</dependencies>
</metadata>

<files>
<!-- .NET Standard 2.0 -->
<file src="netstandard2.0\*.dll" target="lib\netstandard2.0" />
<file src="netstandard2.0\*.xml" target="lib\netstandard2.0" />

<!-- .NET Core 2.0 -->
<file src="netcoreapp2.0\*.dll" target="lib\netcoreapp2.0" />
<file src="netcoreapp2.0\*.xml" target="lib\netcoreapp2.0" />

<!-- .NET Core 3.0 -->
<file src="netcoreapp3.0\*.dll" target="lib\netcoreapp3.0" />
<file src="netcoreapp3.0\*.xml" target="lib\netcoreapp3.0" />

<!-- .NET Framework 4.8 -->
<file src="net48\*.dll" target="lib\net48" />
<file src="net48\*.xml" target="lib\net48" />

<!-- .NET 7 -->
<file src="net7.0\*.dll" target="lib\net7.0" />
<file src="net7.0\*.xml" target="lib\net7.0" />

<!-- .NET 8 -->
<file src="net8.0\*.dll" target="lib\net8.0" />
<file src="net8.0\*.xml" target="lib\net8.0" />

<file src="..\..\..\..\README.md" target="docs\" />
</files>
</package>
10 changes: 1 addition & 9 deletions src/Pose/Pose.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Title>Pose</Title>
<Description>Replace any .NET method (including static and non-virtual) with a delegate</Description>
<PackageVersion>1.2.1</PackageVersion>
<TargetFrameworks>netstandard2.0;netcoreapp2.0;netcoreapp3.0;net48;net7.0;net8.0</TargetFrameworks>
<DebugType>portable</DebugType>
<AssemblyName>Pose</AssemblyName>
<PackageId>Pose</PackageId>
<PackageTags>pose;mocking;testing;unit-test;isolation-framework;test-framework</PackageTags>
<PackageProjectUrl>https://github.com/tonerdo/pose</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/tonerdo/pose/blob/master/LICENSE</PackageLicenseUrl>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/tonerdo/pose</RepositoryUrl>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Mono.Reflection.Core" Version="1.1.1" />
Expand Down

0 comments on commit 2504e79

Please sign in to comment.