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 14, 2024
1 parent 27eebb0 commit ef96bd6
Show file tree
Hide file tree
Showing 71 changed files with 755 additions and 973 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
269 changes: 90 additions & 179 deletions Cyberduck.sln

Large diffs are not rendered by default.

59 changes: 33 additions & 26 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,36 @@

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

<PropertyGroup Label="AssemblyInfo">
<Company>iterate GmbH</Company>
<Description>Libre FTP, SFTP, WebDAV, S3 and OpenStack Swift browser for Mac and Windows.</Description>
</PropertyGroup>

<PropertyGroup>
<CyberduckDir>$(MSBuildThisFileDirectory)</CyberduckDir>
<TargetBuildDir>$(ModulePath)target\</TargetBuildDir>

<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>

<ItemDefinitionGroup>
<CyberduckReference>
<ProjectPath />
</CyberduckReference>
</ItemDefinitionGroup>

</Project>
<PropertyGroup Label="AssemblyInfo">
<Company>iterate GmbH</Company>
<Description>Libre FTP, SFTP, WebDAV, S3 and OpenStack Swift browser for Mac and Windows.</Description>
</PropertyGroup>

<PropertyGroup>
<CyberduckDir>$(MSBuildThisFileDirectory)</CyberduckDir>
<BuildSupportDir>$(CyberduckDir)src\main\msbuild\</BuildSupportDir>
<TargetBuildDir>$(ModulePath)target\</TargetBuildDir>
<LibDir>$(TargetBuildDir)lib\</LibDir>
<GeneratedMSBuildDir>$(TargetBuildDir)generated\msbuild\</GeneratedMSBuildDir>

<ArtifactsPath>$(TargetBuildDir)</ArtifactsPath>
<UseArtifactsOutput>false</UseArtifactsOutput>

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

<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<LangVersion>12</LangVersion>
</PropertyGroup>

<ItemDefinitionGroup>
<CyberduckReference>
<ProjectPath />
</CyberduckReference>
</ItemDefinitionGroup>

<Import Project="$(GeneratedMSBuildDir)Version.props" Condition="Exists('$(GeneratedMSBuildDir)Version.props')" />

</Project>
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>
3 changes: 3 additions & 0 deletions Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@
<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" />
<PackageReference Update="System.Security.Cryptography.ProtectedData" Version="8.0.0" />

<GlobalPackageReference Include="MSBuildTasks" Version="1.5.0.235" GeneratePathProperty="true" />
</ItemGroup>
Expand Down
25 changes: 15 additions & 10 deletions bonjour/dll/Cyberduck.Bonjour.msbuildproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
<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>
<Import Project="$(BuildSupportDir)Cyberduck.Java.props" />

<ItemGroup>
<CyberduckReference Include="Core" />

<Convert Include="$(TargetBuildDir)ch.cyberduck.bonjour.jar" />
<Convert Include="$(TargetBuildDir)com.apple.dnssd.jar" />
</ItemGroup>
</Project>
1 change: 0 additions & 1 deletion bonjour/dll/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@
</PropertyGroup>

<Import Project="../Directory.Build.props" />
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.Java.props', '$(MSBuildThisFileDirectory)../'))" />

</Project>
4 changes: 1 addition & 3 deletions bonjour/dll/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@
</msbuild>
</target>

<target name="build" if="platform.windows" depends="version,restore,msbuild.configuration">
<target name="build" if="platform.windows" depends="restore,msbuild">
<msbuild buildfile="Cyberduck.Bonjour.msbuildproj">
<property name="Configuration" value="${msbuild.configuration}" />
<property name="Copyright" value="${copyright}" />
<property name="Version" value="${version}.${revision}" />
</msbuild>
</target>

Expand Down
11 changes: 10 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 All @@ -87,6 +89,13 @@
<groupId>ch.cyberduck</groupId>
<artifactId>bonjour</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>ch.cyberduck</groupId>
<artifactId>core</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
19 changes: 3 additions & 16 deletions bonjour/native/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,18 @@

<import file="../../build.xml"/>

<property name="msbuild.configuration" value="release"/>

<target name="init-msbuild">
<taskdef name="msbuild" classname="org.apache.ant.dotnet.build.MSBuildTask">
<classpath path="${lib.ext}/ant-dotnet-1.1.jar"/>
</taskdef>
</target>

<target name="restore" depends="init-msbuild, version">
<target name="restore" depends="msbuild">
<msbuild buildfile="../src/main/csharp/Cyberduck.Bonjour.Native.csproj">
<target name="Restore" />
</msbuild>
</target>

<target name="build" depends="init-msbuild, version">
<target name="build" depends="restore,msbuild">
<!-- Create DLL Cyberduck.Bonjour.Native -->
<msbuild buildfile="../src/main/csharp/Cyberduck.Bonjour.Native.csproj">
<target name="Build"/>

<property name="Version"
value="${version}.${revision}"/>
<property name="ShortVersion"
value="${version} (${revision})"/>
<property name="Configuration"
value="${msbuild.configuration}"/>
<property name="Configuration" value="${msbuild.configuration}"/>
</msbuild>
</target>
</project>
43 changes: 3 additions & 40 deletions 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 All @@ -46,56 +47,18 @@
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>run-ant-restore-target</id>
<phase>initialize</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<property name="home" value="${main.basedir}" />
<ant antfile="${project.basedir}/build.xml" target="restore" dir="." />
</target>
</configuration>
</execution>
<execution>
<id>run-ant-build-target</id>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<property name="home" value="${main.basedir}" />
<property name="version" value="${project.version}" />
<property name="revision" value="${git.commitsCount}" />
<ant antfile="${project.basedir}/build.xml" target="build" dir="." />
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>ch.cyberduck</groupId>
<artifactId>Cyberduck.Bonjour</artifactId>
<classifier>net472</classifier>
<type>dll</type>
<version>${project.version}</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</profile>
</profiles>

<dependencies>
<dependency>
<groupId>ch.cyberduck</groupId>
<artifactId>bonjour</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
Loading

0 comments on commit ef96bd6

Please sign in to comment.