version update and fixes

This commit is contained in:
Timerix22 2023-02-08 04:41:10 +06:00
parent 563eabb6c4
commit d7de6ef4c6
12 changed files with 41 additions and 28 deletions

View File

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<!--package info--> <!--package info-->
<PackageId>DTLib.Dtsod</PackageId> <PackageId>DTLib.Dtsod</PackageId>
<Version>1.0.4</Version> <Version>1.1.0</Version>
<Authors>Timerix</Authors> <Authors>Timerix</Authors>
<Description>Definitely not json</Description> <Description>Definitely not json</Description>
<RepositoryType>GIT</RepositoryType> <RepositoryType>GIT</RepositoryType>
@ -33,7 +33,7 @@
<ProjectReference Include="..\DTLib\DTLib.csproj" /> <ProjectReference Include="..\DTLib\DTLib.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition=" '$(Configuration)' != 'Debug' "> <ItemGroup Condition=" '$(Configuration)' != 'Debug' ">
<PackageReference Include="DTLib" Version="1.0.4" /> <PackageReference Include="DTLib" Version="1.1.0" />
</ItemGroup> </ItemGroup>
<!--project files--> <!--project files-->

View File

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<!--package info--> <!--package info-->
<PackageId>DTLib.Logging</PackageId> <PackageId>DTLib.Logging</PackageId>
<Version>1.0.8</Version> <Version>1.1.0</Version>
<Authors>Timerix</Authors> <Authors>Timerix</Authors>
<Description>Loggers with dependency injection</Description> <Description>Loggers with dependency injection</Description>
<RepositoryType>GIT</RepositoryType> <RepositoryType>GIT</RepositoryType>
@ -30,7 +30,7 @@
<ProjectReference Include="..\DTLib.Ben.Demystifier\DTLib.Ben.Demystifier.csproj" /> <ProjectReference Include="..\DTLib.Ben.Demystifier\DTLib.Ben.Demystifier.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition=" '$(Configuration)' != 'Debug' "> <ItemGroup Condition=" '$(Configuration)' != 'Debug' ">
<PackageReference Include="DTLib" Version="1.0.4" /> <PackageReference Include="DTLib" Version="1.1.0" />
<PackageReference Include="DTLib.Ben.Demystifier" Version="1.0.2" /> <PackageReference Include="DTLib.Ben.Demystifier" Version="1.0.2" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<!--package info--> <!--package info-->
<PackageId>DTLib.Network</PackageId> <PackageId>DTLib.Network</PackageId>
<Version>1.0.4</Version> <Version>1.1.0</Version>
<Authors>Timerix</Authors> <Authors>Timerix</Authors>
<Description>Some sick network protocols</Description> <Description>Some sick network protocols</Description>
<RepositoryType>GIT</RepositoryType> <RepositoryType>GIT</RepositoryType>
@ -32,6 +32,6 @@
<ProjectReference Include="..\DTLib.Dtsod\DTLib.Dtsod.csproj" /> <ProjectReference Include="..\DTLib.Dtsod\DTLib.Dtsod.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition=" '$(Configuration)' != 'Debug' "> <ItemGroup Condition=" '$(Configuration)' != 'Debug' ">
<PackageReference Include="DTLib.Dtsod" Version="1.0.4" /> <PackageReference Include="DTLib.Dtsod" Version="1.1.0" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -27,10 +27,10 @@
<ProjectReference Include="..\DTLib\DTLib.csproj" /> <ProjectReference Include="..\DTLib\DTLib.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition=" '$(Configuration)' != 'Debug' "> <ItemGroup Condition=" '$(Configuration)' != 'Debug' ">
<PackageReference Include="DTLib" Version="1.0.5" /> <PackageReference Include="DTLib" Version="1.1.1" />
<PackageReference Include="DTLib.Dtsod" Version="1.0.4" /> <PackageReference Include="DTLib.Dtsod" Version="1.1.0" />
<PackageReference Include="DTLib.Network" Version="1.0.4" /> <PackageReference Include="DTLib.Network" Version="1.1.0" />
<PackageReference Include="DTLib.Logging" Version="1.0.8" /> <PackageReference Include="DTLib.Logging" Version="1.1.0" />
</ItemGroup> </ItemGroup>
<!--project files--> <!--project files-->

View File

@ -30,15 +30,6 @@ public static class Program
try try
{ {
IOPath path = "file";
IOPath path2 = "dir/"+ path + "_temp";
File.Create(path);
File.Copy(path, path2, true);
System.Console.WriteLine("{0} was copied to {1}.", path, path2);
Directory.Copy(path2.ParentDir(), "dir2/c/", true);
System.Console.WriteLine($"dir/c/:\n"+Directory.GetAllFiles("dir2\\c").MergeToString("\n\t"));
return;
new LaunchArgumentParser().WithNoExit().ParseAndHandle(args); new LaunchArgumentParser().WithNoExit().ParseAndHandle(args);
TestPInvoke.TestAll(); TestPInvoke.TestAll();
TestAutoarr.TestAll(); TestAutoarr.TestAll();

View File

@ -30,32 +30,44 @@ Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
Publish|Any CPU = Publish|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B620E5E9-800F-4B2D-B4A5-062E05DB704F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B620E5E9-800F-4B2D-B4A5-062E05DB704F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B620E5E9-800F-4B2D-B4A5-062E05DB704F}.Debug|Any CPU.Build.0 = Debug|Any CPU {B620E5E9-800F-4B2D-B4A5-062E05DB704F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B620E5E9-800F-4B2D-B4A5-062E05DB704F}.Release|Any CPU.ActiveCfg = Release|Any CPU {B620E5E9-800F-4B2D-B4A5-062E05DB704F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B620E5E9-800F-4B2D-B4A5-062E05DB704F}.Release|Any CPU.Build.0 = Release|Any CPU {B620E5E9-800F-4B2D-B4A5-062E05DB704F}.Release|Any CPU.Build.0 = Release|Any CPU
{B620E5E9-800F-4B2D-B4A5-062E05DB704F}.Publish|Any CPU.ActiveCfg = Release|Any CPU
{B620E5E9-800F-4B2D-B4A5-062E05DB704F}.Publish|Any CPU.Build.0 = Release|Any CPU
{72BA37EF-07EC-4D34-966A-20D5E83ADB32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {72BA37EF-07EC-4D34-966A-20D5E83ADB32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{72BA37EF-07EC-4D34-966A-20D5E83ADB32}.Debug|Any CPU.Build.0 = Debug|Any CPU {72BA37EF-07EC-4D34-966A-20D5E83ADB32}.Debug|Any CPU.Build.0 = Debug|Any CPU
{72BA37EF-07EC-4D34-966A-20D5E83ADB32}.Release|Any CPU.ActiveCfg = Release|Any CPU {72BA37EF-07EC-4D34-966A-20D5E83ADB32}.Release|Any CPU.ActiveCfg = Release|Any CPU
{72BA37EF-07EC-4D34-966A-20D5E83ADB32}.Release|Any CPU.Build.0 = Release|Any CPU {72BA37EF-07EC-4D34-966A-20D5E83ADB32}.Release|Any CPU.Build.0 = Release|Any CPU
{72BA37EF-07EC-4D34-966A-20D5E83ADB32}.Publish|Any CPU.ActiveCfg = Release|Any CPU
{ADE425F5-8645-47F0-9AA8-33FA748D36BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {ADE425F5-8645-47F0-9AA8-33FA748D36BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ADE425F5-8645-47F0-9AA8-33FA748D36BE}.Debug|Any CPU.Build.0 = Debug|Any CPU {ADE425F5-8645-47F0-9AA8-33FA748D36BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ADE425F5-8645-47F0-9AA8-33FA748D36BE}.Release|Any CPU.ActiveCfg = Release|Any CPU {ADE425F5-8645-47F0-9AA8-33FA748D36BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ADE425F5-8645-47F0-9AA8-33FA748D36BE}.Release|Any CPU.Build.0 = Release|Any CPU {ADE425F5-8645-47F0-9AA8-33FA748D36BE}.Release|Any CPU.Build.0 = Release|Any CPU
{ADE425F5-8645-47F0-9AA8-33FA748D36BE}.Publish|Any CPU.ActiveCfg = Release|Any CPU
{ADE425F5-8645-47F0-9AA8-33FA748D36BE}.Publish|Any CPU.Build.0 = Release|Any CPU
{24B7D0A2-0462-424D-B3F5-29A6655FE472}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {24B7D0A2-0462-424D-B3F5-29A6655FE472}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{24B7D0A2-0462-424D-B3F5-29A6655FE472}.Debug|Any CPU.Build.0 = Debug|Any CPU {24B7D0A2-0462-424D-B3F5-29A6655FE472}.Debug|Any CPU.Build.0 = Debug|Any CPU
{24B7D0A2-0462-424D-B3F5-29A6655FE472}.Release|Any CPU.ActiveCfg = Release|Any CPU {24B7D0A2-0462-424D-B3F5-29A6655FE472}.Release|Any CPU.ActiveCfg = Release|Any CPU
{24B7D0A2-0462-424D-B3F5-29A6655FE472}.Release|Any CPU.Build.0 = Release|Any CPU {24B7D0A2-0462-424D-B3F5-29A6655FE472}.Release|Any CPU.Build.0 = Release|Any CPU
{24B7D0A2-0462-424D-B3F5-29A6655FE472}.Publish|Any CPU.ActiveCfg = Release|Any CPU
{24B7D0A2-0462-424D-B3F5-29A6655FE472}.Publish|Any CPU.Build.0 = Release|Any CPU
{00B76172-32BB-4B72-9891-47FAEF63386C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {00B76172-32BB-4B72-9891-47FAEF63386C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{00B76172-32BB-4B72-9891-47FAEF63386C}.Debug|Any CPU.Build.0 = Debug|Any CPU {00B76172-32BB-4B72-9891-47FAEF63386C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{00B76172-32BB-4B72-9891-47FAEF63386C}.Release|Any CPU.ActiveCfg = Release|Any CPU {00B76172-32BB-4B72-9891-47FAEF63386C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{00B76172-32BB-4B72-9891-47FAEF63386C}.Release|Any CPU.Build.0 = Release|Any CPU {00B76172-32BB-4B72-9891-47FAEF63386C}.Release|Any CPU.Build.0 = Release|Any CPU
{00B76172-32BB-4B72-9891-47FAEF63386C}.Publish|Any CPU.ActiveCfg = Release|Any CPU
{00B76172-32BB-4B72-9891-47FAEF63386C}.Publish|Any CPU.Build.0 = Release|Any CPU
{AC7CB524-4D59-42E0-9F96-1C201A92494B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {AC7CB524-4D59-42E0-9F96-1C201A92494B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AC7CB524-4D59-42E0-9F96-1C201A92494B}.Debug|Any CPU.Build.0 = Debug|Any CPU {AC7CB524-4D59-42E0-9F96-1C201A92494B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AC7CB524-4D59-42E0-9F96-1C201A92494B}.Release|Any CPU.ActiveCfg = Release|Any CPU {AC7CB524-4D59-42E0-9F96-1C201A92494B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AC7CB524-4D59-42E0-9F96-1C201A92494B}.Release|Any CPU.Build.0 = Release|Any CPU {AC7CB524-4D59-42E0-9F96-1C201A92494B}.Release|Any CPU.Build.0 = Release|Any CPU
{AC7CB524-4D59-42E0-9F96-1C201A92494B}.Publish|Any CPU.ActiveCfg = Release|Any CPU
{AC7CB524-4D59-42E0-9F96-1C201A92494B}.Publish|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<!--package info--> <!--package info-->
<PackageId>DTLib</PackageId> <PackageId>DTLib</PackageId>
<Version>1.0.5</Version> <Version>1.1.1</Version>
<Authors>Timerix</Authors> <Authors>Timerix</Authors>
<Description>Library for all my C# projects</Description> <Description>Library for all my C# projects</Description>
<RepositoryType>GIT</RepositoryType> <RepositoryType>GIT</RepositoryType>

View File

@ -36,7 +36,7 @@ public static class DependencyResolver
Path.Concat("runtimes", $"{os}-{arch}"), Path.Concat("runtimes", $"{os}-{arch}"),
Path.Concat("runtimes", $"{os}-{arch}", "native") Path.Concat("runtimes", $"{os}-{arch}", "native")
}; };
foreach (string dir in possibleLibDirs) foreach (var dir in possibleLibDirs)
if (Directory.Exists(dir)) if (Directory.Exists(dir))
foreach (var file in Directory.GetFiles(dir)) foreach (var file in Directory.GetFiles(dir))
{ {

View File

@ -93,9 +93,8 @@ public readonly struct IOPath
public IOPath Substring(int startIndex, int count) => new(Str.Substring(startIndex, count), true); public IOPath Substring(int startIndex, int count) => new(Str.Substring(startIndex, count), true);
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public IOPath Replace(char oldChar, char newChar) => new(Str.Replace(oldChar, newChar), true); public IOPath Replace(char oldChar, char newChar) => new(Str.Replace(oldChar, newChar), true);
[Obsolete("use different replace methods")]
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public IOPath Replace(string oldStr, string newStr) => new(Str.Replace(oldStr, newStr), true); public IOPath ReplaceAnywhere(string oldStr, string newStr) => new(Str.Replace(oldStr, newStr), true);
///<inheritdoc cref="string.IndexOf(char)"/> ///<inheritdoc cref="string.IndexOf(char)"/>
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]

View File

@ -103,9 +103,12 @@ public static class Path
#endif #endif
} }
public static IOPath FileName(this IOPath path) /// returns just dir name or file name with extension
public static IOPath LastName(this IOPath path)
{ {
int i = path.LastIndexOf(Sep); int i = path.LastIndexOf(Sep);
if (i == path.Length - 1) // ends with separator
i = path.LastIndexOf(Sep, i-1);
if (i == -1) return path; if (i == -1) return path;
return path.Substring(i+1); return path.Substring(i+1);
} }
@ -113,7 +116,7 @@ public static class Path
public static IOPath Extension(this IOPath path) public static IOPath Extension(this IOPath path)
{ {
int i = path.LastIndexOf('.'); int i = path.LastIndexOf('.');
if (i == -1) return FileName(path); if (i == -1) return LastName(path);
return path.Substring(i + 1); return path.Substring(i + 1);
} }
@ -133,4 +136,12 @@ public static class Path
throw new Exception($"path <{path}> doesnt starts with <{baseDir}"); throw new Exception($"path <{path}> doesnt starts with <{baseDir}");
return Concat(otherDir, path.Substring(baseDir.Length)); return Concat(otherDir, path.Substring(baseDir.Length));
} }
public static IOPath RemoveBase(this IOPath path, IOPath baseDir)
{
if (!path.StartsWith(baseDir))
throw new Exception($"path <{path}> doesnt starts with <{baseDir}");
return path.Substring(baseDir.Length);
}
} }

View File

@ -42,7 +42,7 @@ public class Hasher
} }
// хеш файла // хеш файла
public byte[] HashFile(string filename) public byte[] HashFile(IOPath filename)
{ {
using System.IO.FileStream fileStream = File.OpenRead(filename); using System.IO.FileStream fileStream = File.OpenRead(filename);
//var then = DateTime.Now.Hour * 3600 + DateTime.Now.Minute * 60 + DateTime.Now.Second; //var then = DateTime.Now.Hour * 3600 + DateTime.Now.Minute * 60 + DateTime.Now.Second;

View File

@ -1,7 +1,7 @@
#!/usr/bin/bash #!/usr/bin/bash
set -ex set -ex
dotnet pack -c Release -o ./nuget_new/ rm -rf nuget_new
rm ./nuget_new/DTLib.Tests.* dotnet pack -c Publish -o ./nuget_new/
rm -rf nuget rm -rf nuget
mv nuget_new nuget mv nuget_new nuget
ls nuget ls nuget