Skip to content

Commit

Permalink
Merge pull request #30 from viordash/update
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
viordash authored Feb 18, 2024
2 parents c1f3364 + 5227e33 commit dede2b6
Show file tree
Hide file tree
Showing 15 changed files with 732 additions and 714 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore ./ShareClipbrd/ShareClipbrd.sln
- name: Build
Expand All @@ -28,7 +28,7 @@ jobs:

- name: Publish
run: |
dotnet publish "./ShareClipbrd\ShareClipbrdApp/ShareClipbrdApp.csproj" -c PublishRelease -r win-x64 -f net7.0-windows -p:PublishSingleFile=true --self-contained false -o "./out/win64" -p:DebugType=None
dotnet publish "./ShareClipbrd\ShareClipbrdApp/ShareClipbrdApp.csproj" -c PublishRelease -r win-x64 -f net8.0-windows -p:PublishSingleFile=true --self-contained true -o "./out/win64" -p:DebugType=None
- name: Deploy Win64
uses: actions/upload-artifact@v3
Expand All @@ -45,7 +45,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore ./ShareClipbrd/ShareClipbrd.sln
- name: Build
Expand All @@ -55,7 +55,7 @@ jobs:

- name: Publish
run: |
dotnet publish "./ShareClipbrd/ShareClipbrdApp/ShareClipbrdApp.csproj" -c PublishRelease -r linux-x64 -f net7.0 -p:PublishSingleFile=true --self-contained false -o "./out/_linux64" -p:DebugType=None
dotnet publish "./ShareClipbrd/ShareClipbrdApp/ShareClipbrdApp.csproj" -c PublishRelease -r linux-x64 -f net8.0 -p:PublishSingleFile=true --self-contained true -o "./out/_linux64" -p:DebugType=None
- name: Tar Linux64 files
run: mkdir -p ./out/linux64 && tar -cjvf ./out/linux64/ShareClipbrd.tar -C ./out/_linux64/ . && rm -rf ./out/_linux64
Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/ShareClipbrd/ShareClipbrdApp/bin/Debug/net7.0-windows/ShareClipbrdApp.dll",
"program": "${workspaceFolder}/ShareClipbrd/ShareClipbrdApp/bin/Debug/net8.0-windows/ShareClipbrdApp.dll",
"args": [],
"cwd": "${workspaceFolder}/ShareClipbrd/ShareClipbrdApp",
"console": "internalConsole",
Expand Down
54 changes: 30 additions & 24 deletions ShareClipbrd/Clipboard.Core.Tests/Clipboard.Core.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2" />
<PackageReference Include="NUnit.Analyzers" Version="3.6.1" />
<PackageReference Include="coverlet.collector" Version="3.2.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Clipboard.Core\Clipboard.Core.csproj" />
</ItemGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NUnit" Version="4.0.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Clipboard.Core\Clipboard.Core.csproj" />
</ItemGroup>

</Project>
32 changes: 16 additions & 16 deletions ShareClipbrd/Clipboard.Core/Clipboard.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup Label="InternalsVisibleTo">
<InternalsVisibleTo Include="Clipboard.Core.Tests" />
<InternalsVisibleTo Include="Clipboard.Win" />
<InternalsVisibleTo Include="Clipboard.X11" />
<InternalsVisibleTo Include="Clipboard" />
<InternalsVisibleTo Include="ShareClipbrdApp" />
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup Label="InternalsVisibleTo">
<InternalsVisibleTo Include="Clipboard.Core.Tests" />
<InternalsVisibleTo Include="Clipboard.Win" />
<InternalsVisibleTo Include="Clipboard.X11" />
<InternalsVisibleTo Include="Clipboard" />
<InternalsVisibleTo Include="ShareClipbrdApp" />
</ItemGroup>
</Project>
56 changes: 31 additions & 25 deletions ShareClipbrd/Clipboard.Tests/Clipboard.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">net7.0-windows</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('linux'))">net7.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2" />
<PackageReference Include="NUnit.Analyzers" Version="3.6.1" />
<PackageReference Include="coverlet.collector" Version="3.2.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Clipboard\Clipboard.csproj" />
</ItemGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">net8.0-windows</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('linux'))">net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NUnit" Version="4.0.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Clipboard\Clipboard.csproj" />
</ItemGroup>

</Project>
38 changes: 19 additions & 19 deletions ShareClipbrd/Clipboard.Win/Clipboard.Win.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Clipboard.Core\Clipboard.Core.csproj" />
</ItemGroup>


<ItemGroup Label="InternalsVisibleTo">
<InternalsVisibleTo Include="Clipboard" />
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Clipboard.Core\Clipboard.Core.csproj" />
</ItemGroup>


<ItemGroup Label="InternalsVisibleTo">
<InternalsVisibleTo Include="Clipboard" />
</ItemGroup>
</Project>
34 changes: 17 additions & 17 deletions ShareClipbrd/Clipboard.X11/Clipboard.X11.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Clipboard.Core\Clipboard.Core.csproj" />
</ItemGroup>

<ItemGroup Label="InternalsVisibleTo">
<InternalsVisibleTo Include="Clipboard" />
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Clipboard.Core\Clipboard.Core.csproj" />
</ItemGroup>

<ItemGroup Label="InternalsVisibleTo">
<InternalsVisibleTo Include="Clipboard" />
</ItemGroup>
</Project>
52 changes: 26 additions & 26 deletions ShareClipbrd/Clipboard/Clipboard.csproj
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">net7.0-windows</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('linux'))">net7.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Clipboard.Core\Clipboard.Core.csproj" />
</ItemGroup>

<ItemGroup Condition="$([MSBuild]::IsOSPlatform('windows'))">
<ProjectReference Include="..\Clipboard.Win\Clipboard.Win.csproj" />
</ItemGroup>

<ItemGroup Condition="$([MSBuild]::IsOSPlatform('linux'))">
<ProjectReference Include="..\Clipboard.X11\Clipboard.X11.csproj" />
</ItemGroup>

<ItemGroup Label="InternalsVisibleTo">
<InternalsVisibleTo Include="ShareClipbrdApp" />
</ItemGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">net8.0-windows</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('linux'))">net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Clipboard.Core\Clipboard.Core.csproj" />
</ItemGroup>

<ItemGroup Condition="$([MSBuild]::IsOSPlatform('windows'))">
<ProjectReference Include="..\Clipboard.Win\Clipboard.Win.csproj" />
</ItemGroup>

<ItemGroup Condition="$([MSBuild]::IsOSPlatform('linux'))">
<ProjectReference Include="..\Clipboard.X11\Clipboard.X11.csproj" />
</ItemGroup>

<ItemGroup Label="InternalsVisibleTo">
<InternalsVisibleTo Include="ShareClipbrdApp" />
</ItemGroup>

</Project>
74 changes: 37 additions & 37 deletions ShareClipbrd/ShareClipbrd.Core.Tests/Helpers/PathHelperTests.cs
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
using ShareClipbrd.Core.Helpers;

namespace ShareClipbrd.Core.Tests.Helpers {
public class PathHelperTests {
[Test]
public void IsAbsolute_Test() {
if(OperatingSystem.IsWindows()) {
Assert.True(PathHelper.IsAbsolute("C:\\ShareClipbrd\\ShareClipbrd.Core\\Clipboard\\ClipboardFile.cs"));
Assert.True(PathHelper.IsAbsolute("C:\\ShareClipbrd//ClipboardFile.cs"));
Assert.True(PathHelper.IsAbsolute("\\tsclient\\Documents.zip"));
Assert.False(PathHelper.IsAbsolute("//"));
Assert.False(PathHelper.IsAbsolute("//tsclient/Documents.zip"));
Assert.False(PathHelper.IsAbsolute("//file/1"));
Assert.False(PathHelper.IsAbsolute("//file"));
}

if(OperatingSystem.IsLinux()) {
Assert.True(PathHelper.IsAbsolute("/ShareClipbrd/ShareClipbrd.Core/Clipboard/ClipboardFile.cs"));
Assert.True(PathHelper.IsAbsolute("/ShareClipbrd//ClipboardFile.cs"));
Assert.True(PathHelper.IsAbsolute("/tsclient/Documents.zip"));
Assert.True(PathHelper.IsAbsolute("//"));
Assert.True(PathHelper.IsAbsolute("//tsclient/Documents.zip"));
Assert.True(PathHelper.IsAbsolute("//file/1"));
Assert.True(PathHelper.IsAbsolute("//file"));
}
Assert.True(PathHelper.IsAbsolute("/home/Documents.zip"));

Assert.False(PathHelper.IsAbsolute("ShareClipbrd\\ShareClipbrd.Core\\Clipboard\\ClipboardFile.cs"));
Assert.False(PathHelper.IsAbsolute("ShareClipbrd/ShareClipbrd.Core/Clipboard/ClipboardFile.cs"));
Assert.False(PathHelper.IsAbsolute("Documents"));
Assert.False(PathHelper.IsAbsolute(" "));
Assert.False(PathHelper.IsAbsolute("/"));
Assert.False(PathHelper.IsAbsolute("\\"));
Assert.False(PathHelper.IsAbsolute("\\\\"));
}
}
}
using ShareClipbrd.Core.Helpers;

namespace ShareClipbrd.Core.Tests.Helpers {
public class PathHelperTests {
[Test]
public void IsAbsolute_Test() {
if(OperatingSystem.IsWindows()) {
Assert.That(PathHelper.IsAbsolute("C:\\ShareClipbrd\\ShareClipbrd.Core\\Clipboard\\ClipboardFile.cs"), Is.True);
Assert.That(PathHelper.IsAbsolute("C:\\ShareClipbrd//ClipboardFile.cs"), Is.True);
Assert.That(PathHelper.IsAbsolute("\\tsclient\\Documents.zip"), Is.True);
Assert.That(PathHelper.IsAbsolute("//"), Is.False);
Assert.That(PathHelper.IsAbsolute("//tsclient/Documents.zip"), Is.False);
Assert.That(PathHelper.IsAbsolute("//file/1"), Is.False);
Assert.That(PathHelper.IsAbsolute("//file"), Is.False);
}

if(OperatingSystem.IsLinux()) {
Assert.That(PathHelper.IsAbsolute("/ShareClipbrd/ShareClipbrd.Core/Clipboard/ClipboardFile.cs"), Is.True);
Assert.That(PathHelper.IsAbsolute("/ShareClipbrd//ClipboardFile.cs"), Is.True);
Assert.That(PathHelper.IsAbsolute("/tsclient/Documents.zip"), Is.True);
Assert.That(PathHelper.IsAbsolute("//"), Is.True);
Assert.That(PathHelper.IsAbsolute("//tsclient/Documents.zip"), Is.True);
Assert.That(PathHelper.IsAbsolute("//file/1"), Is.True);
Assert.That(PathHelper.IsAbsolute("//file"), Is.True);
}
Assert.That(PathHelper.IsAbsolute("/home/Documents.zip"), Is.True);

Assert.That(PathHelper.IsAbsolute("ShareClipbrd\\ShareClipbrd.Core\\Clipboard\\ClipboardFile.cs"), Is.False);
Assert.That(PathHelper.IsAbsolute("ShareClipbrd/ShareClipbrd.Core/Clipboard/ClipboardFile.cs"), Is.False);
Assert.That(PathHelper.IsAbsolute("Documents"), Is.False);
Assert.That(PathHelper.IsAbsolute(" "), Is.False);
Assert.That(PathHelper.IsAbsolute("/"), Is.False);
Assert.That(PathHelper.IsAbsolute("\\"), Is.False);
Assert.That(PathHelper.IsAbsolute("\\\\"), Is.False);
}
}
}
Loading

0 comments on commit dede2b6

Please sign in to comment.