Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Quality: Migrate shared properties to Directory.Build.props #16557

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Copyright (c) 2024 Files Community. Licensed under the MIT License. See the LICENSE. -->
<Project>

<PropertyGroup Condition="'$(MSBuildProjectExtension)' == '.csproj'">
<Configurations>Debug;Release;Stable;Preview;Store</Configurations>
<Platforms>x86;x64;arm64</Platforms>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
<DefineConstants Condition="'$(Configuration)' == 'Debug'">$(DefineConstants);TRACE;DEBUG;NETFX_CORE</DefineConstants>
<DefineConstants Condition="'$(Configuration)' != 'Debug'">$(DefineConstants);TRACE;RELEASE;NETFX_CORE</DefineConstants>
<Optimize Condition="'$(Configuration)' != 'Debug'">true</Optimize>
</PropertyGroup>

</Project>
14 changes: 7 additions & 7 deletions Files.sln
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,8 @@ Global
{8F60FD8E-1921-47D6-97B0-D26D7B3A4999}.Store|x86.Deploy.0 = Store|x86
{6FA07816-DE0A-4D49-84E8-38E953A33C87}.Debug|arm64.ActiveCfg = Debug|Any CPU
{6FA07816-DE0A-4D49-84E8-38E953A33C87}.Debug|arm64.Build.0 = Debug|Any CPU
{6FA07816-DE0A-4D49-84E8-38E953A33C87}.Debug|x64.ActiveCfg = Debug|Any CPU
{6FA07816-DE0A-4D49-84E8-38E953A33C87}.Debug|x64.Build.0 = Debug|Any CPU
{6FA07816-DE0A-4D49-84E8-38E953A33C87}.Debug|x64.ActiveCfg = Debug|x64
{6FA07816-DE0A-4D49-84E8-38E953A33C87}.Debug|x64.Build.0 = Debug|x64
{6FA07816-DE0A-4D49-84E8-38E953A33C87}.Debug|x86.ActiveCfg = Debug|Any CPU
{6FA07816-DE0A-4D49-84E8-38E953A33C87}.Debug|x86.Build.0 = Debug|Any CPU
{6FA07816-DE0A-4D49-84E8-38E953A33C87}.Preview|arm64.ActiveCfg = Preview|Any CPU
Expand Down Expand Up @@ -459,8 +459,8 @@ Global
{EBFA367F-CBDB-4CD0-B838-D6B95F61D1F6}.Store|x86.Build.0 = Store|Win32
{7756A1A4-17B5-4E6B-9B12-F19AA868A225}.Debug|arm64.ActiveCfg = Debug|Win32
{7756A1A4-17B5-4E6B-9B12-F19AA868A225}.Debug|arm64.Build.0 = Debug|Win32
{7756A1A4-17B5-4E6B-9B12-F19AA868A225}.Debug|x64.ActiveCfg = Debug|Win32
{7756A1A4-17B5-4E6B-9B12-F19AA868A225}.Debug|x64.Build.0 = Debug|Win32
{7756A1A4-17B5-4E6B-9B12-F19AA868A225}.Debug|x64.ActiveCfg = Debug|x64
{7756A1A4-17B5-4E6B-9B12-F19AA868A225}.Debug|x64.Build.0 = Debug|x64
{7756A1A4-17B5-4E6B-9B12-F19AA868A225}.Debug|x86.ActiveCfg = Debug|Win32
{7756A1A4-17B5-4E6B-9B12-F19AA868A225}.Preview|arm64.ActiveCfg = Preview|Win32
{7756A1A4-17B5-4E6B-9B12-F19AA868A225}.Preview|arm64.Build.0 = Preview|Win32
Expand All @@ -484,8 +484,8 @@ Global
{7756A1A4-17B5-4E6B-9B12-F19AA868A225}.Store|x86.ActiveCfg = Store|Win32
{B3FE3F3B-CECC-4918-B72B-5488C3774125}.Debug|arm64.ActiveCfg = Debug|Win32
{B3FE3F3B-CECC-4918-B72B-5488C3774125}.Debug|arm64.Build.0 = Debug|Win32
{B3FE3F3B-CECC-4918-B72B-5488C3774125}.Debug|x64.ActiveCfg = Debug|Win32
{B3FE3F3B-CECC-4918-B72B-5488C3774125}.Debug|x64.Build.0 = Debug|Win32
{B3FE3F3B-CECC-4918-B72B-5488C3774125}.Debug|x64.ActiveCfg = Debug|x64
{B3FE3F3B-CECC-4918-B72B-5488C3774125}.Debug|x64.Build.0 = Debug|x64
{B3FE3F3B-CECC-4918-B72B-5488C3774125}.Debug|x86.ActiveCfg = Debug|Win32
{B3FE3F3B-CECC-4918-B72B-5488C3774125}.Preview|arm64.ActiveCfg = Preview|Win32
{B3FE3F3B-CECC-4918-B72B-5488C3774125}.Preview|arm64.Build.0 = Preview|Win32
Expand Down Expand Up @@ -626,4 +626,4 @@ Global
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0E62043C-A7A1-4982-9EC9-4CDB2939B776}
EndGlobalSection
EndGlobal
EndGlobal
11 changes: 0 additions & 11 deletions src/Files.App.BackgroundTasks/Files.App.BackgroundTasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<IsTrimmable>true</IsTrimmable>
<Configurations>Debug;Release;Stable;Preview;Store</Configurations>
<Platforms>x86;x64;ARM64</Platforms>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -17,14 +14,6 @@
<CsWinRTGeneratedFilesDir>$(MSBuildProjectDirectory)\bin\$(Platform)\$(Configuration)</CsWinRTGeneratedFilesDir>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DefineConstants>TRACE;DEBUG;NETFX_CORE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' != 'Debug'">
<DefineConstants>TRACE;RELEASE;NETFX_CORE</DefineConstants>
<Optimize>true</Optimize>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.7" />
</ItemGroup>
Expand Down
7 changes: 0 additions & 7 deletions src/Files.App.Controls/Files.App.Controls.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<UseWinUI>true</UseWinUI>
<SupportedOSPlatformVersion>10.0.19041.0</SupportedOSPlatformVersion>
<Nullable>enable</Nullable>
<Configurations>Debug;Release;Stable;Preview;Store</Configurations>
<Platforms>x86;x64;arm64</Platforms>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<DefineConstants Condition="'$(Configuration)' == 'Debug'">TRACE;DEBUG;NETFX_CORE</DefineConstants>
<DefineConstants Condition="'$(Configuration)' != 'Debug'">TRACE;RELEASE;NETFX_CORE</DefineConstants>
<Optimize Condition="'$(Configuration)' != 'Debug'">true</Optimize>
</PropertyGroup>

<ItemGroup>
Expand Down
9 changes: 1 addition & 8 deletions src/Files.App.CsWin32/Files.App.CsWin32.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
<!-- Copyright (c) 2024 Files Community. Licensed under the MIT License. See the LICENSE. -->
<!-- Copyright (c) 2024 Files Community. Licensed under the MIT License. See the LICENSE. -->
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<Nullable>enable</Nullable>
<IsTrimmable>true</IsTrimmable>
<Configurations>Debug;Release;Stable;Preview;Store</Configurations>
<Platforms>x86;x64;arm64</Platforms>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<DefineConstants Condition="'$(Configuration)' == 'Debug'">TRACE;DEBUG;NETFX_CORE</DefineConstants>
<DefineConstants Condition="'$(Configuration)' != 'Debug'">TRACE;RELEASE;NETFX_CORE</DefineConstants>
<Optimize Condition="'$(Configuration)' != 'Debug'">true</Optimize>
</PropertyGroup>

<ItemGroup>
Expand Down
15 changes: 1 addition & 14 deletions src/Files.App.Server/Files.App.Server.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
Expand All @@ -8,15 +8,10 @@
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Configurations>Debug;Release;Stable;Preview;Store</Configurations>
<Platforms>x86;x64;arm64</Platforms>
<SelfContained>true</SelfContained>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<RuntimeIdentifier Condition="'$(Platform)' == 'x86'">win-x86</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(Platform)' == 'x64'">win-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(Platform)' == 'arm64'">win-arm64</RuntimeIdentifier>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CsWinRTComponent>true</CsWinRTComponent>
<CsWinRTWindowsMetadata>10.0.22621.0</CsWinRTWindowsMetadata>
<ApplicationManifest>app.manifest</ApplicationManifest>
Expand All @@ -28,14 +23,6 @@
<CsWinRTEnableLogging>true</CsWinRTEnableLogging>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DefineConstants>TRACE;DEBUG;NETFX_CORE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' != 'Debug'">
<DefineConstants>TRACE;RELEASE;NETFX_CORE</DefineConstants>
<Optimize>true</Optimize>
</PropertyGroup>

<ItemGroup>
<Manifest Include="app.manifest" />
<TrimmerRootAssembly Include="Files.App.Server" />
Expand Down
14 changes: 1 addition & 13 deletions src/Files.App.Storage/Files.App.Storage.csproj
Original file line number Diff line number Diff line change
@@ -1,28 +1,16 @@
<!-- Copyright (c) 2024 Files Community. Licensed under the MIT License. See the LICENSE. -->
<!-- Copyright (c) 2024 Files Community. Licensed under the MIT License. See the LICENSE. -->
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<Nullable>enable</Nullable>
<IsTrimmable>true</IsTrimmable>
<Configurations>Debug;Release;Stable;Preview;Store</Configurations>
<Platforms>x86;x64;arm64</Platforms>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentFTP" Version="43.0.1" />
</ItemGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DefineConstants>TRACE;DEBUG;NETFX_CORE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' != 'Debug'">
<DefineConstants>TRACE;RELEASE;NETFX_CORE</DefineConstants>
<Optimize>true</Optimize>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Files.Core.Storage\Files.Core.Storage.csproj" />
<ProjectReference Include="..\Files.Shared\Files.Shared.csproj" />
Expand Down
17 changes: 3 additions & 14 deletions src/Files.App/Files.App.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- Copyright (c) 2024 Files Community. Licensed under the MIT License. See the LICENSE. -->
<!-- Copyright (c) 2024 Files Community. Licensed under the MIT License. See the LICENSE. -->
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
Expand All @@ -17,28 +17,17 @@
<DisableXbfLineInfo>False</DisableXbfLineInfo>
<AppxBundlePlatforms>x86|x64|arm64</AppxBundlePlatforms>
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
<Nullable>Enable</Nullable>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;arm64</Platforms>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<UseWinUI>true</UseWinUI>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Configurations>Debug;Release;Stable;Preview;Store</Configurations>
<CsWinRTIncludes>Files.App.Server;Microsoft.UI.Content.ContentExternalOutputLink;Microsoft.UI.Content.IContentExternalOutputLink</CsWinRTIncludes>
<PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir>
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
<PublishReadyToRunComposite Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRunComposite>
<ApplicationIcon>..\Files.App (Package)\Assets\AppTiles\Dev\Logo.ico</ApplicationIcon>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DefineConstants>TRACE;DEBUG;NETFX_CORE;DISABLE_XAML_GENERATED_MAIN</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' != 'Debug'">
<DefineConstants>TRACE;RELEASE;NETFX_CORE;DISABLE_XAML_GENERATED_MAIN</DefineConstants>
<Optimize>true</Optimize>
<DefineConstants Condition="'$(Configuration)' == 'Debug'">DISABLE_XAML_GENERATED_MAIN</DefineConstants>
<DefineConstants Condition="'$(Configuration)' != 'Debug'">DISABLE_XAML_GENERATED_MAIN</DefineConstants>
</PropertyGroup>

<ItemGroup>
Expand Down
11 changes: 1 addition & 10 deletions src/Files.Core.SourceGenerator/Files.Core.SourceGenerator.csproj
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
<!-- Copyright (c) 2024 Files Community. Licensed under the MIT License. See the LICENSE. -->
<!-- Copyright (c) 2024 Files Community. Licensed under the MIT License. See the LICENSE. -->
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<IncludeBuildOutput>false</IncludeBuildOutput>
<PlatformTarget>AnyCPU</PlatformTarget>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DefineConstants>TRACE;DEBUG;NETFX_CORE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' != 'Debug'">
<DefineConstants>TRACE;RELEASE;NETFX_CORE</DefineConstants>
<Optimize>true</Optimize>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" PrivateAssets="all" />
Expand Down
14 changes: 1 addition & 13 deletions src/Files.Core.Storage/Files.Core.Storage.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
<!-- Copyright (c) 2024 Files Community. Licensed under the MIT License. See the LICENSE. -->
<!-- Copyright (c) 2024 Files Community. Licensed under the MIT License. See the LICENSE. -->
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<IsTrimmable>true</IsTrimmable>
<Configurations>Debug;Release;Stable;Preview;Store</Configurations>
<Platforms>x86;x64;arm64</Platforms>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DefineConstants>TRACE;DEBUG;NETFX_CORE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' != 'Debug'">
<DefineConstants>TRACE;RELEASE;NETFX_CORE</DefineConstants>
<Optimize>true</Optimize>
</PropertyGroup>

</Project>
12 changes: 0 additions & 12 deletions src/Files.Shared/Files.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,7 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<IsTrimmable>true</IsTrimmable>
<Configurations>Debug;Release;Stable;Preview;Store</Configurations>
<Platforms>x86;x64;arm64</Platforms>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DefineConstants>TRACE;DEBUG;NETFX_CORE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' != 'Debug'">
<DefineConstants>TRACE;RELEASE;NETFX_CORE</DefineConstants>
<Optimize>true</Optimize>
</PropertyGroup>

<ItemGroup>
Expand Down
7 changes: 0 additions & 7 deletions tests/Files.App.UITests/Files.App.UITests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@
<UseWinUI>true</UseWinUI>
<EnableMsixTooling>true</EnableMsixTooling>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Nullable>enable</Nullable>
<Configurations>Debug;Release;Stable;Preview;Store</Configurations>
<Platforms>x86;x64;arm64</Platforms>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<DefineConstants Condition="'$(Configuration)' == 'Debug'">TRACE;DEBUG;NETFX_CORE</DefineConstants>
<DefineConstants Condition="'$(Configuration)' != 'Debug'">TRACE;RELEASE;NETFX_CORE</DefineConstants>
<Optimize Condition="'$(Configuration)' != 'Debug'">true</Optimize>
</PropertyGroup>

<ItemGroup>
Expand Down
13 changes: 1 addition & 12 deletions tests/Files.InteractionTests/Files.InteractionTests.csproj
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
<!-- Copyright (c) 2024 Files Community. Licensed under the MIT License. See the LICENSE. -->
<!-- Copyright (c) 2024 Files Community. Licensed under the MIT License. See the LICENSE. -->
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<Configurations>Debug;Release;Stable;Preview;Store</Configurations>
<Platforms>x86;x64;arm64</Platforms>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DefineConstants>TRACE;DEBUG;NETFX_CORE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' != 'Debug'">
<DefineConstants>TRACE;RELEASE;NETFX_CORE</DefineConstants>
<Optimize>true</Optimize>
</PropertyGroup>

<ItemGroup>
Expand Down