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: Migrated shared properties to props file #16557

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
cc2ec70
Use props file
Lamparter Dec 4, 2024
3334e7e
Fix solution configuration mappings
Lamparter Dec 4, 2024
76f36e0
Fix more active mapping configurations
Lamparter Dec 4, 2024
8e27993
Merge branch `main` into `props`
Lamparter Dec 7, 2024
0a0c0be
Revert BOM removal
Lamparter Dec 7, 2024
e1452ca
Allow pre-defined constants
Lamparter Dec 7, 2024
1b831f3
Add back line at the start of project
Lamparter Dec 8, 2024
15f9a46
Merge branch 'files-community:main' into props
Lamparter Dec 10, 2024
aaf014f
Remove unnecessary configurations
Lamparter Dec 12, 2024
0e1988d
Merge branch 'main' into props
Lamparter Dec 12, 2024
85f66aa
Merge branch 'files-community:main' into props
Lamparter Dec 15, 2024
35002fa
Fix arm64 configurations
Lamparter Dec 15, 2024
ed96899
Merge branch `props` into local
Lamparter Dec 15, 2024
2f26adf
Fix release configuration
Lamparter Dec 15, 2024
ffd516f
Fix more active mapping configurations
Lamparter Dec 15, 2024
829b2a4
Remove C++ projects from solution build configuration
Lamparter Dec 15, 2024
fb226a7
Specify `SetWindowLong` for x86 configuration
gave92 Dec 16, 2024
3c9654d
Merge branch 'files-community:main' into props
Lamparter Dec 16, 2024
28cc49c
Add platform as a default constant
Lamparter Dec 16, 2024
4beaaf5
Remove x86 constant from CsWin32 project
Lamparter Dec 16, 2024
53c3c5e
Update x86 constant name in SWLP block
Lamparter Dec 16, 2024
f0c11e7
Remove UWP constants
Lamparter Dec 16, 2024
8c9fed3
Remove build configuration from constants
Lamparter Dec 16, 2024
e89e280
Merge branch 'main' into props
Lamparter Jan 5, 2025
386b9a5
Rename Win32 to x86
Lamparter Jan 5, 2025
e62fad1
Revert "Rename Win32 to x86"
Lamparter Jan 12, 2025
e538cb5
Fix x86 configuration
Lamparter Jan 12, 2025
b27a8bb
Fix solution configuration
Lamparter Jan 12, 2025
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
14 changes: 14 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- Copyright (c) 2024 Files Community. Licensed under the MIT License. See the LICENSE. -->
<Project>

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

</Project>
920 changes: 677 additions & 243 deletions Files.sln

Large diffs are not rendered by default.

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</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</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
7 changes: 0 additions & 7 deletions src/Files.App.CsWin32/Files.App.CsWin32.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,7 @@
<PropertyGroup>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<Nullable>enable</Nullable>
<IsTrimmable>true</IsTrimmable>
<Configurations>Debug;Release</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
1 change: 1 addition & 0 deletions src/Files.App.CsWin32/NativeMethods.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ SendMessage
IsWindowVisible
COPYDATASTRUCT
SetWindowLongPtr
SetWindowLong
GetDpiForWindow
CallWindowProc
MINMAXINFO
Expand Down
12 changes: 12 additions & 0 deletions src/Files.App.CsWin32/Windows.Win32.Extras.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,16 @@ namespace UI.WindowsAndMessaging
[UnmanagedFunctionPointer(CallingConvention.Winapi)]
public delegate LRESULT WNDPROC(HWND hWnd, uint msg, WPARAM wParam, LPARAM lParam);
}

public static partial class PInvoke
{
public static nint SetWindowLongPlat(HWND hWnd, UI.WindowsAndMessaging.WINDOW_LONG_PTR_INDEX nIndex, nint dwNewLong)
{
#if x86
return SetWindowLong(hWnd, nIndex, (int)dwNewLong);
#else
return SetWindowLongPtr(hWnd, nIndex, dwNewLong);
#endif
}
}
}
13 changes: 0 additions & 13 deletions src/Files.App.Server/Files.App.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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</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
12 changes: 0 additions & 12 deletions src/Files.App.Storage/Files.App.Storage.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,13 @@
<PropertyGroup>
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<Nullable>enable</Nullable>
<IsTrimmable>true</IsTrimmable>
<Configurations>Debug;Release</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
Binary file modified src/Files.App/Assets/FilesOpenDialog/Files.App.Launcher.exe
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cc957911eb0abac03d457a70f1c6ff03eeabd0d05548806ff801998d7218b48d
012f49883cbe42d457d8ee0817e766808d7da5585e051b2279cc4864994ab689
2 changes: 1 addition & 1 deletion src/Files.App/Data/Items/WindowEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public unsafe WindowEx(int minWidth = 400, int minHeight = 300)

_newWndProc = new(NewWindowProc);
var pNewWndProc = Marshal.GetFunctionPointerForDelegate(_newWndProc);
var pOldWndProc = PInvoke.SetWindowLongPtr(new(WindowHandle), WINDOW_LONG_PTR_INDEX.GWL_WNDPROC, pNewWndProc);
var pOldWndProc = PInvoke.SetWindowLongPlat(new(WindowHandle), WINDOW_LONG_PTR_INDEX.GWL_WNDPROC, pNewWndProc);
_oldWndProc = Marshal.GetDelegateForFunctionPointer<WNDPROC>(pOldWndProc);

Closed += WindowEx_Closed;
Expand Down
15 changes: 2 additions & 13 deletions src/Files.App/Files.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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</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'">$(DefineConstants);DISABLE_XAML_GENERATED_MAIN</DefineConstants>
<DefineConstants Condition="'$(Configuration)' != 'Debug'">$(DefineConstants);DISABLE_XAML_GENERATED_MAIN</DefineConstants>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,11 @@ public unsafe void PointerEntered(bool onPreview)
(uint)Marshal.SizeOf(dwAttrib));

if (isOfficePreview)
PInvoke.SetWindowLongPtr(new((nint)hwnd), WINDOW_LONG_PTR_INDEX.GWL_EXSTYLE, 0);
PInvoke.SetWindowLongPlat(new((nint)hwnd), WINDOW_LONG_PTR_INDEX.GWL_EXSTYLE, 0);
}
else
{
PInvoke.SetWindowLongPtr(new((nint)hwnd), WINDOW_LONG_PTR_INDEX.GWL_EXSTYLE, (nint)(WINDOW_EX_STYLE.WS_EX_LAYERED | WINDOW_EX_STYLE.WS_EX_COMPOSITED));
PInvoke.SetWindowLongPlat(new((nint)hwnd), WINDOW_LONG_PTR_INDEX.GWL_EXSTYLE, (nint)(WINDOW_EX_STYLE.WS_EX_LAYERED | WINDOW_EX_STYLE.WS_EX_COMPOSITED));

var dwAttrib = Convert.ToUInt32(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,12 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<IncludeBuildOutput>false</IncludeBuildOutput>
<PlatformTarget>AnyCPU</PlatformTarget>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
<Configurations>Debug;Release</Configurations>
</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
12 changes: 0 additions & 12 deletions src/Files.Core.Storage/Files.Core.Storage.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</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</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</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
11 changes: 0 additions & 11 deletions tests/Files.InteractionTests/Files.InteractionTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<Configurations>Debug;Release</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