Skip to content

Commit

Permalink
FTP: Upgrade package references [STUD-71020] (#434)
Browse files Browse the repository at this point in the history
Upgrade SSH.NET to 2024.0.0
Upgrade FluentFTP to 50.1.0
Small refactoring due to FtpClient being split into synd and async classes, see https://github.com/robinrodricks/FluentFTP/wiki/v40-Migration-Guide
For now use the sync version of FtpClient (we can check if we need to switch to AsyncFtpClient)
Update target framework to net6.0 and net6.0-windows
Update yml file to build with net6 on the CI
  • Loading branch information
viogroza authored Jul 18, 2024
1 parent 4818fc6 commit b787429
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 121 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop" ToolsVersion="Current">
<Import Project="..\FTP.build.props" />
<PropertyGroup>
<TargetFrameworks>net461;net5.0-windows</TargetFrameworks>
<TargetFrameworks>net461;net6.0-windows</TargetFrameworks>
<OutputPath>$(ProjectDir)..\..\Output\Activities\FTP\</OutputPath>
<UseWPF>true</UseWPF>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0-windows' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0-windows' ">
<PackageReference Include="UiPath.Workflow" />
<PackageReference Include="System.Activities.Core.Presentation" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\FTP.build.props" />
<PropertyGroup>
<TargetFrameworks>net461;net5.0-windows;net5.0</TargetFrameworks>
<TargetFrameworks>net461;net6.0-windows;net6.0</TargetFrameworks>
<OutputPath>..\..\Output\Activities\FTP\</OutputPath>
<!--leave empty for ci to replace with prelease tag-->
<VersionSuffix></VersionSuffix>
Expand Down Expand Up @@ -31,8 +31,8 @@
</Target>

<ItemGroup>
<PackageReference Include="FluentFTP" Version="37.1.0" />
<PackageReference Include="SSH.NET" Version="2020.0.2" />
<PackageReference Include="FluentFTP" Version="50.1.0" />
<PackageReference Include="SSH.NET" Version="2024.0.0" />
</ItemGroup>

<Target Name="AddDlls">
Expand Down Expand Up @@ -72,7 +72,7 @@
<BuildOutputInPackage Include="$(OutputPath)zh-TW\UiPath.FTP.Activities.resources.dll" TargetPath="zh-TW\UiPath.FTP.Activities.resources.dll" />

</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' != 'net5.0' ">
<ItemGroup Condition=" '$(TargetFramework)' != 'net6.0' ">
<BuildOutputInPackage Include="$(OutputPath)UiPath.FTP.Activities.Design.dll" />
</ItemGroup>
</Target>
Expand All @@ -84,12 +84,12 @@
<Delete Files="@(PackageFilesToDelete)" ContinueOnError="WarnAndContinue" />
</Target>

<ItemGroup Condition=" '$(TargetFramework)' != 'net5.0' ">
<ItemGroup Condition=" '$(TargetFramework)' != 'net6.0' ">
<ProjectReference Include="..\..\FTP\UiPath.FTP.Activities.Design\UiPath.FTP.Activities.Design.csproj">
<PrivateAssets>All</PrivateAssets>
</ProjectReference>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<ProjectReference Include="..\..\FTP\UiPath.FTP.Activities\UiPath.FTP.Activities.csproj">
<PrivateAssets>All</PrivateAssets>
</ProjectReference>
Expand Down
1 change: 1 addition & 0 deletions Activities/FTP/UiPath.FTP.Activities/DownloadFiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Threading.Tasks;
using UiPath.FTP.Activities.Properties;
using UiPath.Shared.Activities;
using UiPath.FTP;

namespace UiPath.FTP.Activities
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Import Project="..\FTP.build.props" />
<PropertyGroup>
<PackageId>.noconflict</PackageId>
<TargetFrameworks>net461;net5.0;net5.0-windows</TargetFrameworks>
<TargetFrameworks>net461;net6.0;net6.0-windows</TargetFrameworks>
<OutputPath>..\..\Output\Activities\FTP\</OutputPath>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
Expand All @@ -13,11 +13,11 @@
<Reference Include="System.Activities" />
<Reference Include="System.Net.Http" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="UiPath.Workflow" />
<PackageReference Include="System.Activities.ViewModels" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0-windows' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0-windows' ">
<PackageReference Include="System.Activities.Core.Presentation" />
<PackageReference Include="UiPath.Workflow" />
<PackageReference Include="System.Activities.ViewModels" />
Expand Down Expand Up @@ -56,6 +56,6 @@
<Folder Include="Resources\" />
</ItemGroup>
<ItemGroup>
<Compile Condition="'$(TargetFramework)' != 'net5.0'" Remove="NetCore/**" />
<Compile Condition="'$(TargetFramework)' != 'net6.0'" Remove="NetCore/**" />
</ItemGroup>
</Project>
24 changes: 12 additions & 12 deletions Activities/FTP/UiPath.FTP/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static FtpObjectInfo ToFtpObjectInfo(this FtpListItem ftpListItem)
return ftpObjectInfo;
}

public static FtpObjectInfo ToFtpObjectInfo(this SftpFile sftpFile)
public static FtpObjectInfo ToFtpObjectInfo(this ISftpFile sftpFile)
{
FtpObjectInfo ftpObjectInfo = new FtpObjectInfo();

Expand All @@ -41,22 +41,22 @@ public static FtpObjectInfo ToFtpObjectInfo(this SftpFile sftpFile)
return ftpObjectInfo;
}

public static FtpObjectType ToFtpObjectType(this FtpFileSystemObjectType ftpFileSystemObjectType)
public static UiPath.FTP.FtpObjectType ToFtpObjectType(this FluentFTP.FtpObjectType ftpFileSystemObjectType)
{
switch (ftpFileSystemObjectType)
{
case FtpFileSystemObjectType.File:
return FtpObjectType.File;
case FtpFileSystemObjectType.Directory:
return FtpObjectType.Directory;
case FtpFileSystemObjectType.Link:
return FtpObjectType.Link;
case FluentFTP.FtpObjectType.File:
return UiPath.FTP.FtpObjectType.File;
case FluentFTP.FtpObjectType.Directory:
return UiPath.FTP.FtpObjectType.Directory;
case FluentFTP.FtpObjectType.Link:
return UiPath.FTP.FtpObjectType.Link;
default:
throw new NotSupportedException(Resources.UnsupportedObjectTypeException);
}
}

public static FtpObjectType GetFtpObjectType(this SftpFile sftpFile)
public static UiPath.FTP.FtpObjectType GetFtpObjectType(this ISftpFile sftpFile)
{
if (sftpFile == null)
{
Expand All @@ -65,15 +65,15 @@ public static FtpObjectType GetFtpObjectType(this SftpFile sftpFile)

if (sftpFile.IsRegularFile)
{
return FtpObjectType.File;
return UiPath.FTP.FtpObjectType.File;
}
if (sftpFile.IsDirectory)
{
return FtpObjectType.Directory;
return UiPath.FTP.FtpObjectType.Directory;
}
if (sftpFile.IsSymbolicLink)
{
return FtpObjectType.Link;
return UiPath.FTP.FtpObjectType.Link;
}

throw new NotSupportedException(Resources.UnsupportedObjectTypeException);
Expand Down
Loading

0 comments on commit b787429

Please sign in to comment.