2024-10-14 18:54:30 +02:00
<Project Sdk= "Microsoft.NET.Sdk" >
2024-10-14 21:27:12 +02:00
<PropertyGroup >
<Nullable > enable</Nullable>
<ImplicitUsings > enable</ImplicitUsings>
<ProduceReferenceAssembly > False</ProduceReferenceAssembly>
2026-05-24 18:33:54 +02:00
<AvaloniaUseCompiledBindingsByDefault > false</AvaloniaUseCompiledBindingsByDefault>
2026-02-14 22:18:56 +01:00
<!-- Default assembly name for regular builds -->
<AssemblyName > ImageCatalog</AssemblyName>
2025-07-23 15:08:25 +02:00
<LangVersion > default</LangVersion>
2026-03-16 22:14:49 +01:00
<AvaloniaWindowsCrossPublish Condition= "'$(AvaloniaWindowsCrossPublish)' == ''" > false</AvaloniaWindowsCrossPublish>
2026-05-09 17:27:05 +02:00
<UseLocalAIFotoONLUS Condition= "'$(UseLocalAIFotoONLUS)' == '' and Exists('..\..\AIFotoONLUS\src\AIFotoONLUS.Core\AIFotoONLUS.Core.csproj') and '$(GITHUB_ACTIONS)' != 'true' and '$(CI)' != 'true'" > true</UseLocalAIFotoONLUS>
<UseLocalAIFotoONLUS Condition= "'$(UseLocalAIFotoONLUS)' == ''" > false</UseLocalAIFotoONLUS>
2024-10-14 21:56:40 +02:00
</PropertyGroup>
2026-02-26 19:17:23 +01:00
<!-- Windows: net10.0 - windows TFM auto - defines WINDOWS preprocessor symbol -->
<PropertyGroup Condition= "$([MSBuild]::IsOsPlatform('Windows'))" >
<TargetFramework > net10.0-windows</TargetFramework>
<OutputType > WinExe</OutputType>
2025-07-23 15:24:36 +02:00
<RuntimeIdentifier > win-x64</RuntimeIdentifier>
2026-02-26 19:17:23 +01:00
<ApplicationIcon > Logo.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition= "!$([MSBuild]::IsOsPlatform('Windows'))" >
<TargetFramework > net10.0</TargetFramework>
<OutputType > Exe</OutputType>
2025-07-23 15:24:36 +02:00
</PropertyGroup>
2026-03-16 22:14:49 +01:00
<PropertyGroup Condition= "'$(AvaloniaWindowsCrossPublish)' == 'true'" >
<OutputType > WinExe</OutputType>
<RuntimeIdentifier Condition= "'$(RuntimeIdentifier)' == ''" > win-x64</RuntimeIdentifier>
<UseAppHost > true</UseAppHost>
<SelfContained Condition= "'$(SelfContained)' == ''" > true</SelfContained>
<PublishSingleFile Condition= "'$(PublishSingleFile)' == ''" > true</PublishSingleFile>
<PublishTrimmed Condition= "'$(PublishTrimmed)' == ''" > false</PublishTrimmed>
<PublishReadyToRun Condition= "'$(PublishReadyToRun)' == ''" > false</PublishReadyToRun>
</PropertyGroup>
2024-10-14 21:56:40 +02:00
<PropertyGroup >
2026-05-09 14:04:21 +02:00
<!-- Keep MinVer package enabled but do NOT let it overwrite AssemblyVersion/FileVersion used at build - time. -->
2024-10-14 21:56:40 +02:00
<UpdateVersionProperties > true</UpdateVersionProperties>
2026-03-12 18:48:13 +01:00
<!-- Skip MinVer execution during local builds to avoid environment/runtime - specific failures. -->
<MinVerSkip > true</MinVerSkip>
2024-10-14 21:27:12 +02:00
</PropertyGroup>
2026-05-09 18:37:31 +02:00
<PropertyGroup Condition= "$([MSBuild]::IsOsPlatform('Windows')) and '$(UseLocalAIFotoONLUS)' == 'true'" >
<LocalAIFotoOutputDir > $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\..\AIFotoONLUS\src\AIFotoONLUS.Core\bin\$(Configuration)\net10.0'))</LocalAIFotoOutputDir>
</PropertyGroup>
2021-03-04 10:44:09 +01:00
<PropertyGroup Condition= " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " >
2024-10-14 21:27:12 +02:00
<DebugType > embedded</DebugType>
</PropertyGroup>
<PropertyGroup Condition= "'$(Configuration)|$(Platform)'=='Release|AnyCPU'" >
<DebugType > embedded</DebugType>
2021-03-04 17:26:08 +01:00
</PropertyGroup>
2026-02-26 21:19:03 +01:00
<ItemGroup >
2026-05-24 18:33:54 +02:00
<AvaloniaXaml Remove= "AvaloniaApp.axaml" />
2026-02-26 21:19:03 +01:00
<AvaloniaXaml Remove= "Sorgenti\**" />
<Compile Remove= "Sorgenti\**" />
<EmbeddedResource Remove= "Sorgenti\**" />
<None Remove= "Sorgenti\**" />
<Page Remove= "Sorgenti\**" />
</ItemGroup>
2026-05-24 18:33:54 +02:00
<ItemGroup >
<AvaloniaResource Include= "AvaloniaApp.axaml" />
</ItemGroup>
2021-03-04 10:44:09 +01:00
<ItemGroup >
2024-10-14 19:54:29 +02:00
<None Update= "Properties\Settings.settings" >
<Generator > SettingsSingleFileGenerator</Generator>
<LastGenOutput > Settings.Designer.cs</LastGenOutput>
</None>
2021-03-04 10:44:09 +01:00
</ItemGroup>
<ItemGroup >
2026-02-28 15:30:57 +01:00
<ProjectReference Include= "..\Catalog.Communication\Catalog.Communication.csproj" />
2024-10-14 18:54:30 +02:00
<ProjectReference Include= "..\MaddoShared\MaddoShared.csproj" />
2026-05-09 17:27:05 +02:00
<ProjectReference Include= "..\..\AIFotoONLUS\src\AIFotoONLUS.Core\AIFotoONLUS.Core.csproj" Condition= "'$(UseLocalAIFotoONLUS)' == 'true'" />
2021-03-04 10:44:09 +01:00
</ItemGroup>
2024-10-14 18:54:30 +02:00
<ItemGroup >
2026-11-30 19:54:10 +01:00
<PackageReference Include= "AIFotoONLUS.Core" Version= "0.1.4" Condition= "'$(UseLocalAIFotoONLUS)' != 'true'" />
2026-05-24 17:29:05 +02:00
<PackageReference Include= "AutoMapper" Version= "16.1.1" />
<PackageReference Include= "IconPacks.Avalonia" Version= "2.0.0" />
2026-05-28 20:27:05 +02:00
<PackageReference Include= "System.Configuration.ConfigurationManager" Version= "10.0.3" />
2026-05-24 17:29:05 +02:00
<PackageReference Include= "Microsoft.Extensions.DependencyInjection" Version= "10.0.8" />
<PackageReference Include= "Microsoft.Extensions.Logging" Version= "10.0.8" />
<PackageReference Include= "Microsoft.Extensions.Logging.Console" Version= "10.0.8" />
2026-02-17 20:51:35 +01:00
<PackageReference Include= "MinVer" Version= "7.0.0" PrivateAssets= "all" />
2026-05-24 18:33:54 +02:00
<PackageReference Include= "Avalonia" Version= "11.3.13" />
<PackageReference Include= "Avalonia.Desktop" Version= "11.3.13" />
<PackageReference Include= "Avalonia.Themes.Fluent" Version= "11.3.13" />
<PackageReference Include= "Avalonia.Controls.DataGrid" Version= "11.3.13" />
2024-10-14 19:54:29 +02:00
<PackageReference Include= "Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers" Version= "0.4.421302" >
2024-10-14 18:54:30 +02:00
<PrivateAssets > all</PrivateAssets>
</PackageReference>
</ItemGroup>
2026-02-15 00:03:16 +01:00
2026-02-17 20:51:35 +01:00
<!-- MinVer provides a computed 'Version' property. Do not automatically override AssemblyVersion/FileVersion
2026-05-09 14:04:21 +02:00
with MinVer's computed Version. The explicit AssemblyVersion/FileVersion at the top of this file will be used for runtime identity. -->
2024-10-14 19:54:29 +02:00
<ItemGroup >
<Compile Update= "Properties\Settings.Designer.cs" >
<DesignTimeSharedInput > True</DesignTimeSharedInput>
<AutoGen > True</AutoGen>
<DependentUpon > Settings.settings</DependentUpon>
</Compile>
</ItemGroup>
2024-10-14 18:54:30 +02:00
<PropertyGroup />
2026-02-14 22:18:56 +01:00
2026-02-16 21:49:46 +01:00
<!-- No Visual Studio fallback required for MinVer; MinVer integrates with MSBuild during build. -->
2026-02-15 00:03:16 +01:00
2026-02-14 22:18:56 +01:00
<!-- After publish, rename the produced executable to ImageCatalog.<year>.<major>.<minor>.<build>.<revision>.<ext>
The destination extension is taken from the actual produced file (exe or dll).
-->
<Target Name= "RenamePublishedExeWithYearAndVersion" AfterTargets= "Publish" Condition= "'$(PublishDir)' != ''" >
<PropertyGroup >
<_PublishYear > $([System.DateTime]::Now.ToString("yyyy"))</_PublishYear>
2026-02-16 21:49:46 +01:00
<!-- Prefer MinVer/MSBuild 'Version', then FileVersion, then AssemblyVersion -->
<_Ver Condition= "'$(Version)' != ''" > $(Version)</_Ver>
<_Ver Condition= "'$(Version)' == ''" > $(FileVersion)</_Ver>
2026-02-14 22:18:56 +01:00
<_Ver Condition= "'$(_Ver)' == ''" > $(AssemblyVersion)</_Ver>
2026-02-15 00:03:16 +01:00
<!-- Normalize to avoid spaces but keep plus signs for pre - release build metadata; replace spaces with underscore -->
2026-02-14 22:18:56 +01:00
<_VerSanitized > $([System.String]::Copy('$(_Ver)'))</_VerSanitized>
<_VerSanitized > $([System.String]::Copy('$(_VerSanitized)').Replace(' ', '_'))</_VerSanitized>
<_NewExeNameBase > ImageCatalog.$(_PublishYear).$(_VerSanitized)</_NewExeNameBase>
</PropertyGroup>
<Message Text= "Attempting to find published assembly to rename to $(_NewExeNameBase).* in $(PublishDir)" Importance= "High" />
<!-- Candidate locations in order of likelihood -->
<PropertyGroup >
<_Candidate1 > $(PublishDir)$(TargetFileName)</_Candidate1>
<_Candidate2 > $(PublishDir)$(TargetName)$(TargetExt)</_Candidate2>
<_Candidate3 > $(PublishDir)$(TargetName).exe</_Candidate3>
<_Candidate4 > $(PublishDir)$(AssemblyName)$(TargetExt)</_Candidate4>
<_Candidate5 > $(PublishDir)$(AssemblyName).exe</_Candidate5>
</PropertyGroup>
<!-- Pick the first existing candidate and compute destination using its extension -->
<PropertyGroup Condition= "Exists('$(_Candidate1)') and '$(_CandidateFound)' == ''" >
<_CandidateFound > $(_Candidate1)</_CandidateFound>
</PropertyGroup>
<PropertyGroup Condition= "Exists('$(_Candidate2)') and '$(_CandidateFound)' == ''" >
<_CandidateFound > $(_Candidate2)</_CandidateFound>
</PropertyGroup>
<PropertyGroup Condition= "Exists('$(_Candidate3)') and '$(_CandidateFound)' == ''" >
<_CandidateFound > $(_Candidate3)</_CandidateFound>
</PropertyGroup>
<PropertyGroup Condition= "Exists('$(_Candidate4)') and '$(_CandidateFound)' == ''" >
<_CandidateFound > $(_Candidate4)</_CandidateFound>
</PropertyGroup>
<PropertyGroup Condition= "Exists('$(_Candidate5)') and '$(_CandidateFound)' == ''" >
<_CandidateFound > $(_Candidate5)</_CandidateFound>
</PropertyGroup>
<!-- If a candidate was found, compute destination using its extension and perform copy/delete -->
<PropertyGroup Condition= "'$(_CandidateFound)' != ''" >
<_FoundExt > $([System.IO.Path]::GetExtension('$(_CandidateFound)'))</_FoundExt>
<_DestExe > $(PublishDir)$(_NewExeNameBase)$(_FoundExt)</_DestExe>
</PropertyGroup>
<Message Text= "Found candidate: $(_CandidateFound). Renaming to $(_DestExe)" Importance= "High" Condition= "'$(_CandidateFound)' != ''" />
<Copy SourceFiles= "$(_CandidateFound)" DestinationFiles= "$(_DestExe)" SkipUnchangedFiles= "false" Condition= "'$(_CandidateFound)' != ''" />
<Delete Files= "$(_CandidateFound)" Condition= "'$(_CandidateFound)' != ''" />
</Target>
2026-05-09 18:37:31 +02:00
<Target Name= "CopyLocalCudaInferenceLibraries" AfterTargets= "Build" Condition= "$([MSBuild]::IsOsPlatform('Windows')) and '$(UseLocalAIFotoONLUS)' == 'true'" >
<ItemGroup >
<LocalCudaInferenceLibrary Include= "$(LocalAIFotoOutputDir)\cublasLt64_11.dll" Condition= "Exists('$(LocalAIFotoOutputDir)\cublasLt64_11.dll')" />
<LocalCudaInferenceLibrary Include= "$(LocalAIFotoOutputDir)\cudnn_cnn_infer64_8.dll" Condition= "Exists('$(LocalAIFotoOutputDir)\cudnn_cnn_infer64_8.dll')" />
</ItemGroup>
<Copy SourceFiles= "@(LocalCudaInferenceLibrary)" DestinationFolder= "$(TargetDir)" SkipUnchangedFiles= "true" Condition= "'@(LocalCudaInferenceLibrary)' != ''" />
</Target>
2026-05-24 10:49:41 +02:00
<Target Name= "CopyLocalCudaInferenceLibrariesToPublish" AfterTargets= "Publish" Condition= "$([MSBuild]::IsOsPlatform('Windows')) and '$(UseLocalAIFotoONLUS)' == 'true' and '$(PublishDir)' != ''" >
<ItemGroup >
<LocalCudaInferenceLibraryForPublish Include= "$(LocalAIFotoOutputDir)\cublasLt64_11.dll" Condition= "Exists('$(LocalAIFotoOutputDir)\cublasLt64_11.dll')" />
<LocalCudaInferenceLibraryForPublish Include= "$(LocalAIFotoOutputDir)\cudnn_cnn_infer64_8.dll" Condition= "Exists('$(LocalAIFotoOutputDir)\cudnn_cnn_infer64_8.dll')" />
</ItemGroup>
<Copy SourceFiles= "@(LocalCudaInferenceLibraryForPublish)" DestinationFolder= "$(PublishDir)" SkipUnchangedFiles= "true" Condition= "'@(LocalCudaInferenceLibraryForPublish)' != ''" />
</Target>
2026-12-03 20:06:06 +01:00
<Target Name= "AssemblePackageCudaInferenceLibrariesToPublish" AfterTargets= "Publish" Condition= "'$(RuntimeIdentifier)' == 'win-x64' and '$(UseLocalAIFotoONLUS)' != 'true' and '$(PublishDir)' != ''" >
<PropertyGroup >
<_CublasLtFragment0 > $([System.IO.Path]::GetFullPath('$(NuGetPackageRoot)ntvlibs.cuda11.cublaslt64_11.runtime.win-x64.f00/11.8.0/fragments/win-x64/native/cublasLt64_11.dll.f00'))</_CublasLtFragment0>
<_CublasLtFragment1 > $([System.IO.Path]::GetFullPath('$(NuGetPackageRoot)ntvlibs.cuda11.cublaslt64_11.runtime.win-x64.f01/11.8.0/fragments/win-x64/native/cublasLt64_11.dll.f01'))</_CublasLtFragment1>
<_CudnnCnnInferFragment0 > $([System.IO.Path]::GetFullPath('$(NuGetPackageRoot)ntvlibs.cudnn.cuda11.cudnn_cnn_infer64_8.runtime.win-x64.f00/8.9.7.29/fragments/win-x64/native/cudnn_cnn_infer64_8.dll.f00'))</_CudnnCnnInferFragment0>
<_CudnnCnnInferFragment1 > $([System.IO.Path]::GetFullPath('$(NuGetPackageRoot)ntvlibs.cudnn.cuda11.cudnn_cnn_infer64_8.runtime.win-x64.f01/8.9.7.29/fragments/win-x64/native/cudnn_cnn_infer64_8.dll.f01'))</_CudnnCnnInferFragment1>
<_CublasLtOutput > $([System.IO.Path]::GetFullPath('$(PublishDir)/cublasLt64_11.dll'))</_CublasLtOutput>
<_CudnnCnnInferOutput > $([System.IO.Path]::GetFullPath('$(PublishDir)/cudnn_cnn_infer64_8.dll'))</_CudnnCnnInferOutput>
</PropertyGroup>
<Error Condition= "!Exists('$(_CublasLtFragment0)')" Text= "Missing CUDA runtime fragment: $(_CublasLtFragment0)" />
<Error Condition= "!Exists('$(_CublasLtFragment1)')" Text= "Missing CUDA runtime fragment: $(_CublasLtFragment1)" />
<Error Condition= "!Exists('$(_CudnnCnnInferFragment0)')" Text= "Missing cuDNN runtime fragment: $(_CudnnCnnInferFragment0)" />
<Error Condition= "!Exists('$(_CudnnCnnInferFragment1)')" Text= "Missing cuDNN runtime fragment: $(_CudnnCnnInferFragment1)" />
<Exec Condition= "$([MSBuild]::IsOsPlatform('Windows'))" Command= "powershell -NoProfile -ExecutionPolicy Bypass -Command "$ErrorActionPreference='Stop'; function Join-Binary([string]$outFile, [string[]]$parts) { $stream = [System.IO.File]::Create($outFile); try { foreach ($part in $parts) { $input = [System.IO.File]::OpenRead($part); try { $input.CopyTo($stream) } finally { $input.Dispose() } } } finally { $stream.Dispose() } }; Join-Binary '$(_CublasLtOutput)' @('$(_CublasLtFragment0)', '$(_CublasLtFragment1)'); Join-Binary '$(_CudnnCnnInferOutput)' @('$(_CudnnCnnInferFragment0)', '$(_CudnnCnnInferFragment1)')"" />
<Exec Condition= "!$([MSBuild]::IsOsPlatform('Windows'))" Command= "cat "$(_CublasLtFragment0)" "$(_CublasLtFragment1)" > "$(_CublasLtOutput)" && cat "$(_CudnnCnnInferFragment0)" "$(_CudnnCnnInferFragment1)" > "$(_CudnnCnnInferOutput)"" />
</Target>
<Target Name= "ValidateWindowsCatalogPublishOutput" >
<Error Condition= "'$(PublishDir)' == ''" Text= "PublishDir must be set before validating the Windows Catalog output." />
<PropertyGroup >
<_CatalogPublishDirectory > $([System.IO.Path]::GetFullPath('$(PublishDir)'))</_CatalogPublishDirectory>
<_OpenCvSharpRuntimePath > $([System.IO.Path]::Combine('$(_CatalogPublishDirectory)', 'OpenCvSharpExtern.dll'))</_OpenCvSharpRuntimePath>
<_CublasRuntimePath > $([System.IO.Path]::Combine('$(_CatalogPublishDirectory)', 'cublas64_11.dll'))</_CublasRuntimePath>
<_CublasLtRuntimePath > $([System.IO.Path]::Combine('$(_CatalogPublishDirectory)', 'cublasLt64_11.dll'))</_CublasLtRuntimePath>
<_CudaRuntimePath > $([System.IO.Path]::Combine('$(_CatalogPublishDirectory)', 'cudart64_110.dll'))</_CudaRuntimePath>
<_CudnnRuntimePath > $([System.IO.Path]::Combine('$(_CatalogPublishDirectory)', 'cudnn64_8.dll'))</_CudnnRuntimePath>
<_CudnnOpsRuntimePath > $([System.IO.Path]::Combine('$(_CatalogPublishDirectory)', 'cudnn_ops_infer64_8.dll'))</_CudnnOpsRuntimePath>
<_CudnnAdvRuntimePath > $([System.IO.Path]::Combine('$(_CatalogPublishDirectory)', 'cudnn_adv_infer64_8.dll'))</_CudnnAdvRuntimePath>
<_CudnnCnnRuntimePath > $([System.IO.Path]::Combine('$(_CatalogPublishDirectory)', 'cudnn_cnn_infer64_8.dll'))</_CudnnCnnRuntimePath>
</PropertyGroup>
<ItemGroup >
<_CatalogPublishedExecutable Include= "$(_CatalogPublishDirectory)/*.exe" />
</ItemGroup>
<Error Condition= "!Exists('$(_CatalogPublishDirectory)')" Text= "Windows Catalog publish directory does not exist: $(_CatalogPublishDirectory)" />
<Error Condition= "'@(_CatalogPublishedExecutable)' == ''" Text= "No Windows Catalog executable was found in $(_CatalogPublishDirectory)." />
<Error Condition= "!Exists('$(_OpenCvSharpRuntimePath)')" Text= "Required OpenCV runtime library is missing: $(_OpenCvSharpRuntimePath)" />
<Error Condition= "!Exists('$(_CublasRuntimePath)')" Text= "Required CUDA runtime library is missing: $(_CublasRuntimePath)" />
<Error Condition= "!Exists('$(_CublasLtRuntimePath)')" Text= "Required CUDA runtime library is missing: $(_CublasLtRuntimePath)" />
<Error Condition= "!Exists('$(_CudaRuntimePath)')" Text= "Required CUDA runtime library is missing: $(_CudaRuntimePath)" />
<Error Condition= "!Exists('$(_CudnnRuntimePath)')" Text= "Required cuDNN runtime library is missing: $(_CudnnRuntimePath)" />
<Error Condition= "!Exists('$(_CudnnOpsRuntimePath)')" Text= "Required cuDNN runtime library is missing: $(_CudnnOpsRuntimePath)" />
<Error Condition= "!Exists('$(_CudnnAdvRuntimePath)')" Text= "Required cuDNN runtime library is missing: $(_CudnnAdvRuntimePath)" />
<Error Condition= "!Exists('$(_CudnnCnnRuntimePath)')" Text= "Required cuDNN runtime library is missing: $(_CudnnCnnRuntimePath)" />
</Target>
<Target Name= "PackageWindowsCatalogOutput" DependsOnTargets= "ValidateWindowsCatalogPublishOutput" >
<Error Condition= "'$(PublishArchivePath)' == ''" Text= "PublishArchivePath must be set before packaging the Windows Catalog output." />
<PropertyGroup >
<_CatalogPublishArchivePath Condition= "'$(PublishArchivePath)' != ''" > $([System.IO.Path]::GetFullPath('$(PublishArchivePath)'))</_CatalogPublishArchivePath>
</PropertyGroup>
<ZipDirectory SourceDirectory= "$(_CatalogPublishDirectory)" DestinationFile= "$(_CatalogPublishArchivePath)" Overwrite= "true" />
</Target>
2021-03-04 10:44:09 +01:00
</Project>