Skip to content

Commit ec06c66

Browse files
Merge pull request #4 from ShawnLaMountain/main
Now supporting .Net Standard v1.0 - v2.1
2 parents b9980c9 + 74f780a commit ec06c66

8 files changed

Lines changed: 56 additions & 8 deletions

File tree

.github/workflows/CD.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
env:
88
TITLE: ".NET Development ToolBox"
99
DESCRIPTION: "A set of core methods and classes to ease every days .NET development tasks."
10-
TAGS: "thunderdesign net csharp"
10+
TAGS: "thunderdesign toolbox visual%2Dstudio c%2Dsharp dotnet%2Dstandard dotnet%2Dframework dotnet%2Dcore cross%2Dplatform pcl%2Dlibrary mono xamarin%2Dforms xamarin%2Dandroid xamarin%2Dios xamarin%2Dmac xamarin%2Duwp unity csharp net dotnet"
1111
#FILE_NAME: ex: "ThunderDesign.Net-PCL.ToolBox"
1212
FILE_NAME: "${{ github.event.repository.name }}"
1313
#REPOSITORY_NAME: ex: "ThunderDesign.Net-PCL.ToolBox"
@@ -16,7 +16,7 @@ env:
1616
REPOSITORY_OWNER: ${{ github.repository_owner }}
1717
#GITHUB_URL: ex: "https://github.com/ThunderDesign"
1818
GITHUB_URL: ${{ github.server_url }}/${{ github.repository_owner }}
19-
#REPOSITORY_URL: ex: "https://github.com/ThunderDesign/ThunderDesign.Net-PCL.Threading"
19+
#REPOSITORY_URL: ex: "https://github.com/ThunderDesign/ThunderDesign.Net-PCL.ToolBox"
2020
REPOSITORY_URL: ${{ github.server_url }}/${{ github.repository_owner }}/${{ github.event.repository.name }}
2121

2222
PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}\output
@@ -45,7 +45,7 @@ jobs:
4545
run: nuget restore ./src/${{ env.FILE_NAME}}.sln
4646

4747
- name: Create NuGet Package
48-
run: msbuild ./src/${{ env.FILE_NAME}}.sln -t:pack /p:VersionPrefix=${{ github.event.release.tag_name }} /p:Configuration=Release /p:Title="${{ env.TITLE }}" /p:Description="${{ env.DESCRIPTION }}" /p:PackageTags="${{ env.TAGS }}" /p:Authors=ThunderDesign /p:PackageProjectUrl=${{ env.GITHUB_URL }} /p:PackageLicenseExpression=MIT /p:RepositoryType=git /p:RepositoryUrl=${{ env.REPOSITORY_URL }} /p:PackageReleaseNotes="See ${{ env.REPOSITORY_URL }}/releases/tag/${{ github.event.release.tag_name }}" /p:PackageOutputPath=${{ env.PACKAGE_OUTPUT_DIRECTORY}}
48+
run: msbuild ./src/${{ env.FILE_NAME}}.sln -t:pack /p:VersionPrefix=${{ github.event.release.tag_name }} /p:Configuration=Release /p:Title="${{ env.TITLE }}" /p:Description="${{ env.DESCRIPTION }}" /p:PackageTags="${{ env.TAGS }}" /p:Authors=ThunderDesign /p:PackageProjectUrl=${{ env.GITHUB_URL }} /p:PackageLicenseExpression=MIT /p:RepositoryType=git /p:RepositoryUrl=${{ env.REPOSITORY_URL }} /p:PackageReleaseNotes="See ${{ env.REPOSITORY_URL }}/releases/tag/${{ github.event.release.tag_name }}" /p:PackageReadmeFile="README.md" /p:PackageOutputPath=${{ env.PACKAGE_OUTPUT_DIRECTORY}}
4949

5050
- name: Archive NuGet Package
5151
uses: actions/upload-artifact@v2.3.1

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ env:
1414
jobs:
1515
build:
1616

17-
runs-on: [windows-latest]
17+
runs-on: [windows-2019]
1818

1919
steps:
2020
- name: Checkout

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,35 @@
33
[![CD](https://github.com/ThunderDesign/ThunderDesign.Net-PCL.ToolBox/actions/workflows/CD.yml/badge.svg)](https://github.com/ThunderDesign/ThunderDesign.Net-PCL.ToolBox/actions/workflows/CD.yml)
44
[![Nuget](https://img.shields.io/nuget/v/ThunderDesign.Net-PCL.ToolBox)](https://www.nuget.org/packages/ThunderDesign.Net-PCL.ToolBox)
55
[![License](https://img.shields.io/github/license/ThunderDesign/ThunderDesign.Net-PCL.ToolBox)](https://github.com/ThunderDesign/ThunderDesign.Net-PCL.ToolBox/blob/main/LICENSE)
6+
[![Net](https://img.shields.io/badge/.net%20standard-v1.0%20--%20v2.1-blue)](https://github.com/ThunderDesign/ThunderDesign.Net-PCL.ToolBox/blob/main/README.md)
67

78
A set of core methods and classes to ease every days .NET development tasks.
9+
10+
----
11+
12+
### Highlights include:
13+
14+
- Extentions
15+
- BytesExtentions
16+
- EnumExtentions
17+
- GenericExtentions
18+
- ObjectExtentions
19+
- PropertyInfoExtentions
20+
- StreamExtensions
21+
- StringExtentions
22+
- TypeExtentions
23+
24+
----
25+
26+
## Installation
27+
28+
Grab the latest [ThunderDesign.Net-PCL.ToolBox NuGet](https://www.nuget.org/packages/ThunderDesign.Net-PCL.ToolBox) package and install in your solution.
29+
30+
> Install-Package ThunderDesign.Net-PCL.ToolBox
31+
32+
Use the `-version` option to specify an [older version](https://www.nuget.org/packages/ThunderDesign.Net-PCL.ToolBox#versions-tab) to install.
33+
34+
## Please Contribute!
35+
36+
This is an open source project that welcomes contributions/suggestions/bug reports from those who use it. If you have any ideas on how to improve the library, please [post an issue here on GitHub](https://github.com/ThunderDesign/ThunderDesign.Net-PCL.ToolBox/issues). Please check out the [How to Contribute](https://github.com/ThunderDesign/ThunderDesign.Net-PCL.ToolBox/blob/main/.github/CONTRIBUTING.md).
37+

src/ThunderDesign.Net-PCL.ToolBox/Extentions/EnumExtentions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ namespace ThunderDesign.Net.ToolBox.Extentions
66
{
77
public static class EnumExtentions
88
{
9+
#if NETSTANDARD2_0 || NETSTANDARD2_1
910
public static string GetDescription(this Enum en)
1011
{
1112
Type type = en.GetType();
@@ -20,6 +21,7 @@ public static string GetDescription(this Enum en)
2021
}
2122
return en.ToString();
2223
}
24+
#endif
2325

2426
public static int AsIndex(this Enum value)
2527
{

src/ThunderDesign.Net-PCL.ToolBox/Extentions/GenericExtentions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ namespace ThunderDesign.Net.ToolBox.Extentions
55
{
66
public static class GenericExtentions
77
{
8+
#if NETSTANDARD2_0 || NETSTANDARD2_1
89
public static void Mirror<T>(this T target, T source)
910
{
1011
foreach (PropertyInfo propertyInfo in typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(p => p.CanRead && p.CanWrite))// && !ignoreList.Contains(p.Name)))
1112
{
1213
target.Copy(source, propertyInfo.Name);
1314
}
1415
}
16+
#endif
1517
}
1618
}

src/ThunderDesign.Net-PCL.ToolBox/Extentions/ObjectExtentions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ namespace ThunderDesign.Net.ToolBox.Extentions
55
{
66
public static class ObjectExtentions
77
{
8+
#if NETSTANDARD2_0 || NETSTANDARD2_1
89
public static bool Copy(this object self, object source, string property)
910
{
1011
if (source == null || self == null || string.IsNullOrEmpty(property))
@@ -21,6 +22,7 @@ public static bool Copy(this object self, object source, string property)
2122
}
2223
return false;
2324
}
25+
#endif
2426

2527
public static bool IsEqual(this object self, object value)
2628
{

src/ThunderDesign.Net-PCL.ToolBox/Extentions/TypeExtentions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ public static string AsShortClassName(this Type self)
1616
return className;
1717
}
1818

19+
#if NETSTANDARD2_0 || NETSTANDARD2_1
1920
public static bool CanDirectlyCompare(this Type self)
2021
{
2122
return typeof(IComparable).IsAssignableFrom(self) || self.IsPrimitive || self.IsValueType || self is IEnumerable;
2223
}
24+
#endif
2325
}
2426
}
Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFramework>netstandard2.0</TargetFramework>
5-
<RootNamespace>ThunderDesign.Net_PCL.ToolBox</RootNamespace>
6-
</PropertyGroup>
3+
<PropertyGroup>
4+
<TargetFrameworks>netstandard1.0;netstandard2.0;net461</TargetFrameworks>
5+
<RootNamespace>ThunderDesign.Net_PCL.ToolBox</RootNamespace>
6+
<PackageReadmeFile>README.md</PackageReadmeFile>
7+
</PropertyGroup>
8+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net461' ">
9+
<DefineConstants>NETSTANDARD1_4</DefineConstants>
10+
</PropertyGroup>
11+
<ItemGroup>
12+
<None Include="..\..\README.md">
13+
<Pack>True</Pack>
14+
<PackagePath>\</PackagePath>
15+
</None>
16+
</ItemGroup>
717

818
</Project>

0 commit comments

Comments
 (0)