mirror of
https://github.com/nsnail/ns-ext.git
synced 2025-04-19 00:02:50 +08:00
1.0.4
This commit is contained in:
parent
fdaf7518c6
commit
5e17e20aab
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -60,4 +60,4 @@
|
|||||||
#*.pdf diff=astextplain
|
#*.pdf diff=astextplain
|
||||||
#*.PDF diff=astextplain
|
#*.PDF diff=astextplain
|
||||||
#*.rtf diff=astextplain
|
#*.rtf diff=astextplain
|
||||||
#*.RTF diff=astextplain
|
#*.RTF diff=astextplain
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,8 +1,9 @@
|
|||||||
|
pkg
|
||||||
build
|
build
|
||||||
bin
|
bin
|
||||||
obj
|
obj
|
||||||
bin\log
|
|
||||||
packages
|
packages
|
||||||
|
Migrations
|
||||||
_gsdata_
|
_gsdata_
|
||||||
_ReSharper*
|
_ReSharper*
|
||||||
TestResults
|
TestResults
|
||||||
|
4
.tgitconfig
Normal file
4
.tgitconfig
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[hook "startcommit"]
|
||||||
|
cmdline = code-format.cmd
|
||||||
|
wait = true
|
||||||
|
show = true
|
7
Directory.Build.props
Normal file
7
Directory.Build.props
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<BaseOutputPath>../build/temp/bin</BaseOutputPath>
|
||||||
|
<BaseIntermediateOutputPath>../build/temp/obj</BaseIntermediateOutputPath>
|
||||||
|
<MSBuildProjectExtensionsPath>../build/temp/obj</MSBuildProjectExtensionsPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
3
code-format.cmd
Normal file
3
code-format.cmd
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
do.exe trim-utf8-bom
|
||||||
|
do.exe remove-whitespace
|
||||||
|
do.exe convert-lf
|
1
git-clean.ps1
Normal file
1
git-clean.ps1
Normal file
@ -0,0 +1 @@
|
|||||||
|
git reset --hard | git clean -d -fx .
|
@ -1,4 +1,3 @@
|
|||||||
# 定义参数
|
|
||||||
Param(
|
Param(
|
||||||
# Nuget APIKey
|
# Nuget APIKey
|
||||||
[string] $apikey
|
[string] $apikey
|
||||||
@ -6,18 +5,18 @@ Param(
|
|||||||
|
|
||||||
if ($apikey -eq $null -or $apikey -eq "")
|
if ($apikey -eq $null -or $apikey -eq "")
|
||||||
{
|
{
|
||||||
Write-Error "必须指定apiKey";
|
Write-Error "require apiKey";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
rm -r ../build/nupkgs/
|
rm -r ./build/nupkgs
|
||||||
dotnet build -c Release ../src/NSExt.sln
|
dotnet build -c Release ./src/NSExt.sln
|
||||||
$files = Get-ChildItem -Path ../build/nupkgs/ -Filter *.nupkg
|
$files = Get-ChildItem -Path ./build/nupkgs/ -Filter *.nupkg
|
||||||
foreach($file in $files)
|
foreach($file in $files)
|
||||||
{
|
{
|
||||||
dotnet nuget push $file.fullName --skip-duplicate --api-key $apikey --source https://api.nuget.org/v3/index.json
|
dotnet nuget push $file.fullName --skip-duplicate --api-key $apikey --source https://api.nuget.org/v3/index.json
|
||||||
}
|
}
|
||||||
$files = Get-ChildItem -Path ../build/nupkgs/ -Filter *.snupkg
|
$files = Get-ChildItem -Path ./build/nupkgs/ -Filter *.snupkg
|
||||||
foreach($file in $files)
|
foreach($file in $files)
|
||||||
{
|
{
|
||||||
dotnet nuget push $file.fullName --skip-duplicate --api-key $apikey --source https://api.nuget.org/v3/index.json
|
dotnet nuget push $file.fullName --skip-duplicate --api-key $apikey --source https://api.nuget.org/v3/index.json
|
File diff suppressed because one or more lines are too long
@ -10,7 +10,7 @@ public static class LoggerExtensions
|
|||||||
int callerLineNumber)
|
int callerLineNumber)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
$"{message} <s:{Thread.CurrentThread.ManagedThreadId}#{callerName}@{Path.GetFileName(callerFilePath)}:{callerLineNumber}>";
|
$"{message} <s:{Environment.CurrentManagedThreadId}#{callerName}@{Path.GetFileName(callerFilePath)}:{callerLineNumber}>";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Debug(this ILogger me,
|
public static void Debug(this ILogger me,
|
||||||
|
@ -8,7 +8,7 @@ namespace NSExt.Extensions;
|
|||||||
|
|
||||||
public static class StringExtensions
|
public static class StringExtensions
|
||||||
{
|
{
|
||||||
private static readonly JsonSerializerOptions _DEFAULT_JSON_SERIALIZER_OPTIONS =
|
private static readonly JsonSerializerOptions _defaultJsonSerializerOptions =
|
||||||
default(JsonSerializerOptions).NewJsonSerializerOptions();
|
default(JsonSerializerOptions).NewJsonSerializerOptions();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -300,6 +300,16 @@ public static class StringExtensions
|
|||||||
.ToLower(CultureInfo.CurrentCulture);
|
.ToLower(CultureInfo.CurrentCulture);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// html编码
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="me"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string Html(this string me)
|
||||||
|
{
|
||||||
|
return HttpUtility.HtmlEncode(me);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 解码html编码
|
/// 解码html编码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -450,7 +460,7 @@ public static class StringExtensions
|
|||||||
/// <returns>反序列化后生成的对象</returns>
|
/// <returns>反序列化后生成的对象</returns>
|
||||||
public static T Object<T>(this string me, JsonSerializerOptions options = null)
|
public static T Object<T>(this string me, JsonSerializerOptions options = null)
|
||||||
{
|
{
|
||||||
return JsonSerializer.Deserialize<T>(me, options ?? _DEFAULT_JSON_SERIALIZER_OPTIONS);
|
return JsonSerializer.Deserialize<T>(me, options ?? _defaultJsonSerializerOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -463,7 +473,7 @@ public static class StringExtensions
|
|||||||
/// <returns>反序列化后生成的对象</returns>
|
/// <returns>反序列化后生成的对象</returns>
|
||||||
public static object Object(this string me, Type type, JsonSerializerOptions options = null)
|
public static object Object(this string me, Type type, JsonSerializerOptions options = null)
|
||||||
{
|
{
|
||||||
return JsonSerializer.Deserialize(me, type, options ?? _DEFAULT_JSON_SERIALIZER_OPTIONS);
|
return JsonSerializer.Deserialize(me, type, options ?? _defaultJsonSerializerOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
|
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<VersionPrefix>1.0.3</VersionPrefix>
|
<Version>1.0.4</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user