Skip to content

Commit

Permalink
Dual-Target net472 and net8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AliveDevil committed Aug 13, 2024
1 parent 27eebb0 commit 6b552fe
Show file tree
Hide file tree
Showing 44 changed files with 612 additions and 454 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ insert_final_newline = true
charset = utf-8-bom

# XML project files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj,wixproj}]
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj,wixproj,msbuildproj}]
indent_size = 2

# XML config files
Expand Down
244 changes: 122 additions & 122 deletions Cyberduck.sln

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
<PropertyGroup>
<CyberduckDir>$(MSBuildThisFileDirectory)</CyberduckDir>
<TargetBuildDir>$(ModulePath)target\</TargetBuildDir>
<LibDir>$(TargetBuildDir)lib\</LibDir>

<BaseIntermediateOutputPath>$(TargetBuildDir)obj\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
<BaseOutputPath>$(TargetBuildDir)</BaseOutputPath>
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\</IntermediateOutputPath>
<OutputPath>$(BaseOutputPath)</OutputPath>

<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<LangVersion>12</LangVersion>
</PropertyGroup>
Expand Down
115 changes: 60 additions & 55 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -16,66 +16,71 @@

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<Sdk Name="Microsoft.Build.CentralPackageVersions" Version="2.0.41" />
<Sdk Name="Microsoft.Build.CentralPackageVersions" Version="2.0.41" />

<ItemGroup>
<CyberduckReference Update="Bonjour">
<ProjectPath>$(CyberduckDir)bonjour\dll\Cyberduck.Bonjour.msbuildproj</ProjectPath>
</CyberduckReference>
<CyberduckReference Update="Bonjour.Native">
<ProjectPath>$(CyberduckDir)bonjour\src\main\csharp\Cyberduck.Bonjour.Native.csproj</ProjectPath>
</CyberduckReference>
<CyberduckReference Update="Cli">
<ProjectPath>$(CyberduckDir)cli\dll\Cyberduck.Cli.msbuildproj</ProjectPath>
</CyberduckReference>
<CyberduckReference Update="Core">
<ProjectPath>$(CyberduckDir)core\dll\Cyberduck.Core.msbuildproj</ProjectPath>
</CyberduckReference>
<CyberduckReference Update="Core.Native">
<ProjectPath>$(CyberduckDir)core\src\main\csharp\Cyberduck.Core.Native.csproj</ProjectPath>
</CyberduckReference>
<CyberduckReference Update="Core.Refresh">
<ProjectPath>$(CyberduckDir)core\native\refresh\src\main\csharp\Cyberduck.Core.Refresh.csproj</ProjectPath>
</CyberduckReference>
<CyberduckReference Update="Cryptomator">
<ProjectPath>$(CyberduckDir)cryptomator\dll\Cyberduck.Cryptomator.msbuildproj</ProjectPath>
</CyberduckReference>
<CyberduckReference Update="Importer">
<ProjectPath>$(CyberduckDir)importer\dll\Cyberduck.Importer.msbuildproj</ProjectPath>
</CyberduckReference>
<CyberduckReference Update="Protocols">
<ProjectPath>$(CyberduckDir)protocols\dll\Cyberduck.Protocols.msbuildproj</ProjectPath>
</CyberduckReference>
</ItemGroup>
<PropertyGroup>
<AssemblySearchPaths>$(LibDir);$(AssemblySearchPaths)</AssemblySearchPaths>
</PropertyGroup>

<ItemGroup>
<CyberduckProjectReferences Include="@(CyberduckReference->HasMetadata('ProjectPath'))" Condition=" '$(BuildingInsideVisualStudio)'=='True' " />
<CyberduckLibraryReferences Include="@(CyberduckReference)" Exclude="@(CyberduckProjectReferences)" />
<PropertyGroup Condition=" '$(TargetFramework)' != '' ">
<LibDirFramework Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net472'))">net472</LibDirFramework>
<LibDirFramework Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">net8.0</LibDirFramework>
<AssemblySearchPaths Condition=" '$(LibDirFramework)' != '' ">$(LibDir)$(LibDirFramework)\;$(AssemblySearchPaths)</AssemblySearchPaths>
</PropertyGroup>

<ProjectReference Include="@(CyberduckProjectReferences->'%(ProjectPath)')">
<Name>Cyberduck.%(Identity)</Name>
</ProjectReference>
<Reference Include="@(CyberduckLibraryReferences->'Cyberduck.%(Identity)')">
<HintPath>$(TargetBuildDir)%(Identity).dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<CyberduckReference Update="Bonjour">
<ProjectPath>$(CyberduckDir)bonjour\dll\Cyberduck.Bonjour.msbuildproj</ProjectPath>
</CyberduckReference>
<CyberduckReference Update="Bonjour.Native">
<ProjectPath>$(CyberduckDir)bonjour\src\main\csharp\Cyberduck.Bonjour.Native.csproj</ProjectPath>
</CyberduckReference>
<CyberduckReference Update="Cli">
<ProjectPath>$(CyberduckDir)cli\dll\Cyberduck.Cli.msbuildproj</ProjectPath>
</CyberduckReference>
<CyberduckReference Update="Core">
<ProjectPath>$(CyberduckDir)core\dll\Cyberduck.Core.msbuildproj</ProjectPath>
</CyberduckReference>
<CyberduckReference Update="Core.Native">
<ProjectPath>$(CyberduckDir)core\src\main\csharp\Cyberduck.Core.Native.csproj</ProjectPath>
</CyberduckReference>
<CyberduckReference Update="Core.Refresh">
<ProjectPath>$(CyberduckDir)core\native\refresh\src\main\csharp\Cyberduck.Core.Refresh.csproj</ProjectPath>
</CyberduckReference>
<CyberduckReference Update="Cryptomator">
<ProjectPath>$(CyberduckDir)cryptomator\dll\Cyberduck.Cryptomator.msbuildproj</ProjectPath>
</CyberduckReference>
<CyberduckReference Update="Importer">
<ProjectPath>$(CyberduckDir)importer\dll\Cyberduck.Importer.msbuildproj</ProjectPath>
</CyberduckReference>
<CyberduckReference Update="Protocols">
<ProjectPath>$(CyberduckDir)protocols\dll\Cyberduck.Protocols.msbuildproj</ProjectPath>
</CyberduckReference>

<PropertyGroup Condition=" '$(NETCoreSdkVersion)'!='' ">
<!-- Treat SDK 6.0.301 as last known to work. -->
<NETSDKBeforeFeature>$([MSBuild]::VersionLessThanOrEquals('$(NETCoreSdkVersion)', '6.0.301'))</NETSDKBeforeFeature>
<NETSDKAfterFix>$([MSBuild]::VersionGreaterThanOrEquals('$(NETCoreSdkVersion)', '6.0.401'))</NETSDKAfterFix>
<CoreCompileDependsOn Condition="!($(NETSDKBeforeFeature) or $(NETSDKAfterFix))">SDKFix_RemoveDuplicateAnalyzers;$(CoreCompileDependsOn)</CoreCompileDependsOn>
</PropertyGroup>
<CyberduckProjectReferences Include="@(CyberduckReference->HasMetadata('ProjectPath'))" Condition=" '$(BuildingInsideVisualStudio)'=='True' " />
<CyberduckLibraryReferences Include="@(CyberduckReference->'Cyberduck.%(Identity)')" Exclude="@(CyberduckProjectReferences)" />
<ProjectReference Include="@(CyberduckProjectReferences->'%(ProjectPath)')">
<Name>Cyberduck.%(Identity)</Name>
</ProjectReference>
<Reference Include="@(CyberduckLibraryReferences)" />
</ItemGroup>

<Target Name="SDKFix_RemoveDuplicateAnalyzers">
<ItemGroup>
<FilteredAnalyzer Include="@(Analyzer-&gt;Distinct())" />
<Analyzer Remove="@(Analyzer)" />
<Analyzer Include="@(FilteredAnalyzer)" />
<FilteredAnalyzer Remove="@(FilteredAnalyzer)" />
</ItemGroup>
<PropertyGroup Condition=" '$(NETCoreSdkVersion)'!='' ">
<!-- Treat SDK 6.0.301 as last known to work. -->
<NETSDKBeforeFeature>$([MSBuild]::VersionLessThanOrEquals('$(NETCoreSdkVersion)', '6.0.301'))</NETSDKBeforeFeature>
<NETSDKAfterFix>$([MSBuild]::VersionGreaterThanOrEquals('$(NETCoreSdkVersion)', '6.0.401'))</NETSDKAfterFix>
<CoreCompileDependsOn Condition="!($(NETSDKBeforeFeature) or $(NETSDKAfterFix))">SDKFix_RemoveDuplicateAnalyzers;$(CoreCompileDependsOn)</CoreCompileDependsOn>
</PropertyGroup>

<Target Name="SDKFix_RemoveDuplicateAnalyzers">
<ItemGroup>
<FilteredAnalyzer Include="@(Analyzer-&gt;Distinct())" />
<Analyzer Remove="@(Analyzer)" />
<Analyzer Include="@(FilteredAnalyzer)" />
<FilteredAnalyzer Remove="@(FilteredAnalyzer)" />
</ItemGroup>
</Target>

<Target Name="_ExportReference" />

</Project>
</Project>
2 changes: 2 additions & 0 deletions Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
<PackageReference Update="ReactiveUI" Version="17.1.50" />
<PackageReference Update="ReactiveUI.WPF" Version="17.1.50" />
<PackageReference Update="StructureMap" Version="2.6.4.1" />
<PackageReference Update="System.Configuration.ConfigurationManager" Version="8.0.0" />
<PackageReference Update="System.Memory" Version="4.5.5" />
<PackageReference Update="System.Runtime.Caching" Version="8.0.0" />

<GlobalPackageReference Include="MSBuildTasks" Version="1.5.0.235" GeneratePathProperty="true" />
</ItemGroup>
Expand Down
23 changes: 13 additions & 10 deletions bonjour/dll/Cyberduck.Bonjour.msbuildproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<Project Sdk="IKVM.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<!--
Only really used in Cyberduck.
-->
<TargetFramework>net472</TargetFramework>
</PropertyGroup>

<ItemGroup>
<CyberduckReference Include="Core" />
<Convert Include="$(TargetBuildDir)ch.cyberduck.bonjour.jar" />
<Convert Include="$(TargetBuildDir)com.apple.dnssd.jar" />
</ItemGroup>
</Project>
<ItemGroup>
<CyberduckReference Include="Core" />

<Convert Include="$(TargetBuildDir)ch.cyberduck.bonjour.jar" />
<Convert Include="$(TargetBuildDir)com.apple.dnssd.jar" />
</ItemGroup>
</Project>
4 changes: 3 additions & 1 deletion bonjour/dll/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@
<configuration>
<artifacts>
<artifact>
<classifier>net472</classifier>
<type>dll</type>
<file>${project.build.directory}/Cyberduck.Bonjour.dll</file>
<file>${project.build.directory}/net472/Cyberduck.Bonjour.dll</file>
</artifact>
</artifacts>
</configuration>
Expand All @@ -75,6 +76,7 @@
<dependency>
<groupId>ch.cyberduck</groupId>
<artifactId>Cyberduck.Core</artifactId>
<classifier>net472</classifier>
<version>${project.version}</version>
<type>dll</type>
</dependency>
Expand Down
4 changes: 3 additions & 1 deletion bonjour/native/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@
<configuration>
<artifacts>
<artifact>
<classifier>net472</classifier>
<type>dll</type>
<file>${project.build.directory}/Cyberduck.Bonjour.Native.dll</file>
<file>${project.build.directory}/net472/Cyberduck.Bonjour.Native.dll</file>
</artifact>
</artifacts>
</configuration>
Expand Down Expand Up @@ -83,6 +84,7 @@
<dependency>
<groupId>ch.cyberduck</groupId>
<artifactId>Cyberduck.Bonjour</artifactId>
<classifier>net472</classifier>
<type>dll</type>
<version>${project.version}</version>
<scope>runtime</scope>
Expand Down
1 change: 1 addition & 0 deletions bonjour/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
<dependency>
<groupId>ch.cyberduck</groupId>
<artifactId>Cyberduck.Core</artifactId>
<classifier>net472</classifier>
<type>dll</type>
<version>${project.version}</version>
<scope>runtime</scope>
Expand Down
9 changes: 3 additions & 6 deletions bonjour/src/main/csharp/Cyberduck.Bonjour.Native.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<!--
Only really used in Cyberduck.
-->
<TargetFramework>net472</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
Expand All @@ -13,12 +16,6 @@
<PackageReference Include="IKVM" />
</ItemGroup>

<ItemGroup>
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>

<ItemGroup>
<COMReference Include="Bonjour">
<Guid>{18FBED6D-F2B7-4EC8-A4A4-46282E635308}</Guid>
Expand Down
5 changes: 0 additions & 5 deletions bonjour/src/main/csharp/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,4 @@
</PropertyGroup>
<Import Project="$(_BonjourBasePath)native/Directory.Build.props" />

<PropertyGroup>
<Platforms>x64</Platforms>
<Platform Condition=" '$(Platform)'=='' ">x64</Platform>
</PropertyGroup>

</Project>
20 changes: 10 additions & 10 deletions cli/dll/Cyberduck.Cli.msbuildproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="IKVM.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
</PropertyGroup>

<ItemGroup>
<CyberduckReference Include="Core;Bonjour;Protocols;Cryptomator" />
<ItemGroup>
<CyberduckReference Include="Core;Bonjour;Protocols;Cryptomator" />

<Convert Include="$(TargetBuildDir)ch.cyberduck.cli.jar" />
<Convert Include="$(TargetBuildDir)commons-cli.commons-cli.jar" />
<Convert Include="$(TargetBuildDir)org.fusesource.jansi.jansi.jar" />
</ItemGroup>
</Project>
<Convert Include="$(TargetBuildDir)ch.cyberduck.cli.jar" />
<Convert Include="$(TargetBuildDir)commons-cli.commons-cli.jar" />
<Convert Include="$(TargetBuildDir)org.fusesource.jansi.jansi.jar" />
</ItemGroup>
</Project>
7 changes: 6 additions & 1 deletion cli/dll/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@
<configuration>
<artifacts>
<artifact>
<classifier>net472</classifier>
<type>dll</type>
<file>${project.build.directory}/Cyberduck.Cli.dll</file>
<file>${project.build.directory}/net472/Cyberduck.Cli.dll</file>
</artifact>
</artifacts>
</configuration>
Expand All @@ -90,26 +91,30 @@
<dependency>
<groupId>ch.cyberduck</groupId>
<artifactId>Cyberduck.Core</artifactId>
<classifier>net472</classifier>
<type>dll</type>
<version>${project.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>ch.cyberduck</groupId>
<artifactId>Cyberduck.Core.Native</artifactId>
<classifier>net472</classifier>
<type>dll</type>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>ch.cyberduck</groupId>
<artifactId>Cyberduck.Protocols</artifactId>
<classifier>net472</classifier>
<type>dll</type>
<version>${project.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>ch.cyberduck</groupId>
<artifactId>Cyberduck.Cryptomator</artifactId>
<classifier>net472</classifier>
<type>dll</type>
<version>${project.version}</version>
<scope>runtime</scope>
Expand Down
6 changes: 5 additions & 1 deletion cli/src/main/csharp/duck.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
<Link>$(Filename)$(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="$(TargetBuildDir)lib\jnidispatch.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>$(Filename)$(Extension)</Link>
</Content>

<Content Include="$(CyberduckDir)bookmarks/*.duck">
<Link>bookmarks/%(Filename)%(Extension)</Link>
Expand All @@ -42,4 +46,4 @@
<PackageReference Include="System.Memory" />
</ItemGroup>

</Project>
</Project>
1 change: 1 addition & 0 deletions cli/windows/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

<PropertyGroup>
<ModulePath Condition="'$(ModulePath)'==''">$(MSBuildThisFileDirectory)</ModulePath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>

<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.Props', $(MSBuildThisFileDirectory)../))" />
Expand Down
5 changes: 5 additions & 0 deletions cli/windows/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,33 +111,38 @@
<dependency>
<groupId>ch.cyberduck</groupId>
<artifactId>Cyberduck.Core</artifactId>
<classifier>net472</classifier>
<type>dll</type>
<version>${project.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>ch.cyberduck</groupId>
<artifactId>Cyberduck.Core.Native</artifactId>
<classifier>net472</classifier>
<type>dll</type>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>ch.cyberduck</groupId>
<artifactId>Cyberduck.Protocols</artifactId>
<classifier>net472</classifier>
<type>dll</type>
<version>${project.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>ch.cyberduck</groupId>
<artifactId>Cyberduck.Cryptomator</artifactId>
<classifier>net472</classifier>
<type>dll</type>
<version>${project.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>ch.cyberduck</groupId>
<artifactId>Cyberduck.Cli</artifactId>
<classifier>net472</classifier>
<type>dll</type>
<version>${project.version}</version>
<scope>runtime</scope>
Expand Down
Loading

0 comments on commit 6b552fe

Please sign in to comment.