From c178db127c22d35715a67f14974042a309a88a13 Mon Sep 17 00:00:00 2001 From: Konstantinos Karakostas Date: Sun, 25 Sep 2022 20:47:25 +0300 Subject: [PATCH 1/9] build: dotnet: migrate to .NET SDK --- build/VStudio/dotnet/Directory.Build.props | 7 ++ build/VStudio/dotnet/winfsp.net.csproj | 88 +++++++++------------- 2 files changed, 41 insertions(+), 54 deletions(-) create mode 100644 build/VStudio/dotnet/Directory.Build.props diff --git a/build/VStudio/dotnet/Directory.Build.props b/build/VStudio/dotnet/Directory.Build.props new file mode 100644 index 00000000..dc3d2356 --- /dev/null +++ b/build/VStudio/dotnet/Directory.Build.props @@ -0,0 +1,7 @@ + + + $(SolutionDir)build\$(Configuration)\$(MSBuildProjectName) + $(SolutionDir)build\$(MSBuildProjectName).build\ + $(BaseIntermediateOutputPath)$(Configuration)\ + + \ No newline at end of file diff --git a/build/VStudio/dotnet/winfsp.net.csproj b/build/VStudio/dotnet/winfsp.net.csproj index 52b5eebf..284e0bf6 100644 --- a/build/VStudio/dotnet/winfsp.net.csproj +++ b/build/VStudio/dotnet/winfsp.net.csproj @@ -1,43 +1,31 @@ - - + - - Debug - AnyCPU - {94580219-CC8D-4FE5-A3BE-437B0B3481E1} - Library + netstandard2.0;net35 winfsp.net + disable + disable + true Fsp $(MyProductFileName)-msil - v3.5 512 - true full false - $(SolutionDir)build\$(Configuration)\ - $(SolutionDir)build\$(ProjectName).build\ - $(BaseIntermediateOutputPath)$(Configuration)\ DEBUG;TRACE prompt 4 - true $(BaseIntermediateOutputPath)$(Configuration)\$(MyProductFileName)-msil.xml 1591 pdbonly true - $(SolutionDir)build\$(Configuration)\ - $(SolutionDir)build\$(ProjectName).build\ - $(BaseIntermediateOutputPath)$(Configuration)\ TRACE prompt 4 - true $(BaseIntermediateOutputPath)$(Configuration)\$(MyProductFileName)-msil.xml 1591 @@ -47,9 +35,6 @@ winfsp.net.snk - - - FileSystemBase+Const.cs @@ -70,44 +55,39 @@ - - - - - - - - - - - - - - - - - - - + + + 5.0.0 + + + 5.0.0 + + + + + $(MyProductFileName)-msil + $(MyDescription) + $(MyProductName) + $(MyCopyright) + $(MyAssemblyVersion) + $(MyVersion) + + exit /b 0 -set TargetName=$(TargetName) -set MyAssemblyPolicyVersion=$(MyAssemblyPolicyVersion) -set MyAssemblyVersion=$(MyAssemblyVersion) + set TargetName=$(TargetName) + set MyAssemblyPolicyVersion=$(MyAssemblyPolicyVersion) + set MyAssemblyVersion=$(MyAssemblyVersion) -setlocal EnableDelayedExpansion -if exist $(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).config del $(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).config -for /f "delims=" %25%25l in ($(ProjectDir)winfsp.net.policy.config) do ( - set line=%25%25l - echo !line! >>$(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).config -) + setlocal EnableDelayedExpansion + if exist $(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).config del $(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).config + for /f "delims=" %25%25l in ($(ProjectDir)winfsp.net.policy.config) do ( + set line=%25%25l + echo !line! >>$(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).config + ) -"$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.0A\Bin\al.exe" /product:"$(MyProductName)" /title:"$(MyDescription)" /company:"$(MyCompanyName)" /copyright:"$(MyCopyright)" /version:"$(MyAssemblyPolicyVersion)" /fileversion:"$(MyVersion)" /link:$(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).config /out:$(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).dll /keyfile:$(ProjectDir)$(ProjectName).snk - + "$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.0A\Bin\al.exe" /product:"$(MyProductName)" /title:"$(MyDescription)" /company:"$(MyCompanyName)" /copyright:"$(MyCopyright)" /version:"$(MyAssemblyPolicyVersion)" /fileversion:"$(MyVersion)" /link:$(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).config /out:$(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).dll /keyfile:$(ProjectDir)$(ProjectName).snk + \ No newline at end of file From 7333451eac6d544e769cabce485177e426ab677a Mon Sep 17 00:00:00 2001 From: Konstantinos Karakostas Date: Sun, 25 Sep 2022 20:54:00 +0300 Subject: [PATCH 2/9] build: installer: update assembly location --- build/VStudio/installer/Product.wxs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/VStudio/installer/Product.wxs b/build/VStudio/installer/Product.wxs index 1e3ac352..584bd7a5 100644 --- a/build/VStudio/installer/Product.wxs +++ b/build/VStudio/installer/Product.wxs @@ -171,10 +171,10 @@ - + - + + $(MyProductFileName)-msil + $(MyVersion) From 0a39ef60bdc9c1b2a9e647150954c419c5099a7c Mon Sep 17 00:00:00 2001 From: Noire001 Date: Tue, 27 Sep 2022 13:41:23 +0300 Subject: [PATCH 4/9] Update Contributors.asciidoc --- Contributors.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/Contributors.asciidoc b/Contributors.asciidoc index 3ace0b19..dfef611b 100644 --- a/Contributors.asciidoc +++ b/Contributors.asciidoc @@ -66,6 +66,7 @@ CONTRIBUTOR LIST |Gal Hammer (Red Hat, https://www.redhat.com) |ghammer at redhat.com |John Oberschelp |john at oberschelp.net |John Tyner |jtyner at gmail.com +|Konstantinos Karakostas |noiredev at protonmail.com |Paweł Wegner (Google LLC, https://google.com) |lemourin at google.com |Pedro Frejo (Arpa System, https://arpasystem.com) |pedro.frejo at arpasystem.com |Ronny Chan |ronny at ronnychan.ca From 2945971ba9aab6ca0c1228c41d19c7dc64bfe512 Mon Sep 17 00:00:00 2001 From: Konstantinos Karakostas Date: Sun, 2 Oct 2022 17:08:42 +0300 Subject: [PATCH 5/9] build: memfs-dotnet: migrate to .NET SDK --- build/VStudio/installer/Product.wxs | 2 +- build/VStudio/testing/Directory.Build.props | 11 +++++ build/VStudio/testing/memfs-dotnet.csproj | 55 ++------------------- 3 files changed, 16 insertions(+), 52 deletions(-) create mode 100644 build/VStudio/testing/Directory.Build.props diff --git a/build/VStudio/installer/Product.wxs b/build/VStudio/installer/Product.wxs index 584bd7a5..9b581d96 100644 --- a/build/VStudio/installer/Product.wxs +++ b/build/VStudio/installer/Product.wxs @@ -373,7 +373,7 @@ - + diff --git a/build/VStudio/testing/Directory.Build.props b/build/VStudio/testing/Directory.Build.props new file mode 100644 index 00000000..f0128b25 --- /dev/null +++ b/build/VStudio/testing/Directory.Build.props @@ -0,0 +1,11 @@ + + + + + $(SolutionDir)build\$(Configuration)\$(MSBuildProjectName) + $(SolutionDir)build\$(MSBuildProjectName).build\ + $(BaseIntermediateOutputPath)$(Configuration)\ + + + + \ No newline at end of file diff --git a/build/VStudio/testing/memfs-dotnet.csproj b/build/VStudio/testing/memfs-dotnet.csproj index a198c347..857ce9f4 100644 --- a/build/VStudio/testing/memfs-dotnet.csproj +++ b/build/VStudio/testing/memfs-dotnet.csproj @@ -1,64 +1,17 @@ - - + - - Debug - AnyCPU - {4920E350-D496-4652-AE98-6C4208AEC1D8} Exe + net452 memfs-dotnet - Properties memfs memfs-dotnet-msil - v4.5.2 512 - true - - - AnyCPU - true - full - false - $(SolutionDir)build\$(Configuration)\ - $(SolutionDir)build\$(ProjectName).build\ - $(BaseIntermediateOutputPath)$(Configuration)\ - DEBUG;TRACE - prompt - 4 - false - - - AnyCPU - pdbonly - true - $(SolutionDir)build\$(Configuration)\ - $(SolutionDir)build\$(ProjectName).build\ - $(BaseIntermediateOutputPath)$(Configuration)\ - TRACE - prompt - 4 - + - - Program.cs - + - - - {94580219-cc8d-4fe5-a3be-437b0b3481e1} - winfsp.net - - - - \ No newline at end of file From 2770eca1bf061bbaaec90d4cbcd876d383ef4114 Mon Sep 17 00:00:00 2001 From: Konstantinos Karakostas Date: Sun, 2 Oct 2022 20:22:48 +0300 Subject: [PATCH 6/9] tools: use dotnet build in VS2015 CI --- appveyor.yml | 8 ++++++ build/VStudio/dotnet/winfsp.net.csproj | 20 ++------------ build/VStudio/testing/memfs-dotnet.csproj | 32 +++++++++++------------ tools/build.bat | 8 ++++++ tools/gensrc/remove-build-dotnet.bat | 17 ++++++++++++ tools/gensrc/remove-sln-project.ps1 | 12 +++++++++ 6 files changed, 63 insertions(+), 34 deletions(-) create mode 100644 tools/gensrc/remove-build-dotnet.bat create mode 100644 tools/gensrc/remove-sln-project.ps1 diff --git a/appveyor.yml b/appveyor.yml index 45c7c2c4..9afddef1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -51,6 +51,11 @@ install: $targets.Save("C:\Program Files (x86)\Windows Kits\10\build\WindowsDriver.Common.targets") Add-AppveyorMessage "Hack to make WDK 1903 work on VS2015" } +# Install .NET SDK on VS2015 image +- ps: | + if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2015") { + & ([scriptblock]::Create((New-Object System.Net.WebClient).DownloadString('https://dot.net/v1/dotnet-install.ps1'))) -InstallDir "C:\dotnet" + } # Submodules - git submodule update --init --recursive # Kernel and user mode dumps @@ -76,6 +81,9 @@ build_script: # remove ARM64 project configurations to build in VS2015/VS2017 - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" tools\gensrc\remove-build-arm64.bat - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" tools\gensrc\remove-build-arm64.bat +# remove .NET library from solution for VS2015 and use the .NET SDK instead +- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" tools\gensrc\remove-build-dotnet.bat build\VStudio +- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" set PATH=C:\dotnet;%PATH% # build winfsp - tools\build.bat %CONFIGURATION% diff --git a/build/VStudio/dotnet/winfsp.net.csproj b/build/VStudio/dotnet/winfsp.net.csproj index d1eb9a0e..34dbc2f2 100644 --- a/build/VStudio/dotnet/winfsp.net.csproj +++ b/build/VStudio/dotnet/winfsp.net.csproj @@ -9,25 +9,9 @@ Fsp $(MyProductFileName)-msil 512 + true + $(BaseIntermediateOutputPath)$(Configuration)\$(MyProductFileName)-msil.xml true - - - true - full - false - DEBUG;TRACE - prompt - 4 - $(BaseIntermediateOutputPath)$(Configuration)\$(MyProductFileName)-msil.xml - 1591 - - - pdbonly - true - TRACE - prompt - 4 - $(BaseIntermediateOutputPath)$(Configuration)\$(MyProductFileName)-msil.xml 1591 diff --git a/build/VStudio/testing/memfs-dotnet.csproj b/build/VStudio/testing/memfs-dotnet.csproj index 857ce9f4..f47c2304 100644 --- a/build/VStudio/testing/memfs-dotnet.csproj +++ b/build/VStudio/testing/memfs-dotnet.csproj @@ -1,17 +1,17 @@ - - - - Exe - net452 - memfs-dotnet - memfs - memfs-dotnet-msil - 512 - - - - - - - + + + + Exe + net452 + memfs-dotnet + memfs + memfs-dotnet-msil + 512 + + + + + + + \ No newline at end of file diff --git a/tools/build.bat b/tools/build.bat index 9e5ebad7..a95877e0 100755 --- a/tools/build.bat +++ b/tools/build.bat @@ -27,6 +27,7 @@ if X%~nx0==Xbuild-choco.bat ( set BuildArm64=yes if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" ( set BuildArm64=no + set UseDotnetSdk=yes ) if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" ( set BuildArm64=no @@ -56,6 +57,13 @@ if X%SignedPackage%==X ( if exist build\ for /R build\ %%d in (%Configuration%) do ( if exist "%%d" rmdir /s/q "%%d" ) + + if X%UseDotnetSdk%==Xyes ( + dotnet build ./dotnet/ -c "%Configuration%" -p:SolutionDir=..\ + if errorlevel 1 goto fail + dotnet build ./testing/memfs-dotnet.csproj -c "%Configuration%" -p:SolutionDir=..\ + if errorlevel 1 goto fail + ) if X%BuildArm64%==Xyes ( devenv winfsp.sln /build "%Configuration%|ARM64" diff --git a/tools/gensrc/remove-build-dotnet.bat b/tools/gensrc/remove-build-dotnet.bat new file mode 100644 index 00000000..a12423d2 --- /dev/null +++ b/tools/gensrc/remove-build-dotnet.bat @@ -0,0 +1,17 @@ +@echo off + +setlocal +setlocal EnableDelayedExpansion + +if "%1"=="" ( + cd %~dp0..\.. +) else ( + cd "%1" +) + + +if exist winfsp.sln ( + powershell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dp0remove-sln-project.ps1' -Path '%cd%\winfsp.sln' -Match '*dotnet*' +) else ( + echo winfsp.sln not found in %cd% +) diff --git a/tools/gensrc/remove-sln-project.ps1 b/tools/gensrc/remove-sln-project.ps1 new file mode 100644 index 00000000..ccf8856e --- /dev/null +++ b/tools/gensrc/remove-sln-project.ps1 @@ -0,0 +1,12 @@ +param ( + [Parameter(Mandatory)][string]$Path, + [Parameter(Mandatory)][string]$Match +) + +echo "Removing projects that match $($Match) from $($Path)" + +Get-Content $Path -Delimiter 'EndProject' | + Where-Object {$_ -notlike $Match} | + Set-Content "$($Path).new" + + Move-Item -Path "$($Path).new" -Destination $Path -Force \ No newline at end of file From 53f97c98412e6eb5cc1bcc74777852cc2b06b761 Mon Sep 17 00:00:00 2001 From: Konstantinos Karakostas Date: Sun, 20 Nov 2022 19:32:07 +0200 Subject: [PATCH 7/9] build: dotnet: revert optional changes/deletions --- build/VStudio/Directory.Build.props | 9 +++++ build/VStudio/dotnet/Directory.Build.props | 7 ---- build/VStudio/dotnet/winfsp.net.csproj | 43 +++++++++++++++------ build/VStudio/testing/Directory.Build.props | 11 ------ build/VStudio/testing/memfs-dotnet.csproj | 20 ++++++++++ 5 files changed, 61 insertions(+), 29 deletions(-) create mode 100644 build/VStudio/Directory.Build.props delete mode 100644 build/VStudio/dotnet/Directory.Build.props delete mode 100644 build/VStudio/testing/Directory.Build.props diff --git a/build/VStudio/Directory.Build.props b/build/VStudio/Directory.Build.props new file mode 100644 index 00000000..f22c97d3 --- /dev/null +++ b/build/VStudio/Directory.Build.props @@ -0,0 +1,9 @@ + + + + + $(SolutionDir)build\$(MSBuildProjectName).build\ + + + + \ No newline at end of file diff --git a/build/VStudio/dotnet/Directory.Build.props b/build/VStudio/dotnet/Directory.Build.props deleted file mode 100644 index dc3d2356..00000000 --- a/build/VStudio/dotnet/Directory.Build.props +++ /dev/null @@ -1,7 +0,0 @@ - - - $(SolutionDir)build\$(Configuration)\$(MSBuildProjectName) - $(SolutionDir)build\$(MSBuildProjectName).build\ - $(BaseIntermediateOutputPath)$(Configuration)\ - - \ No newline at end of file diff --git a/build/VStudio/dotnet/winfsp.net.csproj b/build/VStudio/dotnet/winfsp.net.csproj index 34dbc2f2..b153d42c 100644 --- a/build/VStudio/dotnet/winfsp.net.csproj +++ b/build/VStudio/dotnet/winfsp.net.csproj @@ -9,11 +9,32 @@ Fsp $(MyProductFileName)-msil 512 + $(SolutionDir)build\$(Configuration)\$(MSBuildProjectName) + $(BaseIntermediateOutputPath)$(Configuration)\ true $(BaseIntermediateOutputPath)$(Configuration)\$(MyProductFileName)-msil.xml true 1591 + + true + full + false + DEBUG;TRACE + prompt + 4 + $(BaseIntermediateOutputPath)$(Configuration)\$(MyProductFileName)-msil.xml + 1591 + + + pdbonly + true + TRACE + prompt + 4 + $(BaseIntermediateOutputPath)$(Configuration)\$(MyProductFileName)-msil.xml + 1591 + true @@ -65,18 +86,18 @@ exit /b 0 - set TargetName=$(TargetName) - set MyAssemblyPolicyVersion=$(MyAssemblyPolicyVersion) - set MyAssemblyVersion=$(MyAssemblyVersion) +set TargetName=$(TargetName) +set MyAssemblyPolicyVersion=$(MyAssemblyPolicyVersion) +set MyAssemblyVersion=$(MyAssemblyVersion) - setlocal EnableDelayedExpansion - if exist $(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).config del $(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).config - for /f "delims=" %25%25l in ($(ProjectDir)winfsp.net.policy.config) do ( - set line=%25%25l - echo !line! >>$(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).config - ) +setlocal EnableDelayedExpansion +if exist $(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).config del $(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).config +for /f "delims=" %25%25l in ($(ProjectDir)winfsp.net.policy.config) do ( +set line=%25%25l +echo !line! >>$(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).config +) - "$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.0A\Bin\al.exe" /product:"$(MyProductName)" /title:"$(MyDescription)" /company:"$(MyCompanyName)" /copyright:"$(MyCopyright)" /version:"$(MyAssemblyPolicyVersion)" /fileversion:"$(MyVersion)" /link:$(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).config /out:$(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).dll /keyfile:$(ProjectDir)$(ProjectName).snk - +"$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.0A\Bin\al.exe" /product:"$(MyProductName)" /title:"$(MyDescription)" /company:"$(MyCompanyName)" /copyright:"$(MyCopyright)" /version:"$(MyAssemblyPolicyVersion)" /fileversion:"$(MyVersion)" /link:$(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).config /out:$(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).dll /keyfile:$(ProjectDir)$(ProjectName).snk + \ No newline at end of file diff --git a/build/VStudio/testing/Directory.Build.props b/build/VStudio/testing/Directory.Build.props deleted file mode 100644 index f0128b25..00000000 --- a/build/VStudio/testing/Directory.Build.props +++ /dev/null @@ -1,11 +0,0 @@ - - - - - $(SolutionDir)build\$(Configuration)\$(MSBuildProjectName) - $(SolutionDir)build\$(MSBuildProjectName).build\ - $(BaseIntermediateOutputPath)$(Configuration)\ - - - - \ No newline at end of file diff --git a/build/VStudio/testing/memfs-dotnet.csproj b/build/VStudio/testing/memfs-dotnet.csproj index f47c2304..fe7feabe 100644 --- a/build/VStudio/testing/memfs-dotnet.csproj +++ b/build/VStudio/testing/memfs-dotnet.csproj @@ -6,8 +6,28 @@ memfs-dotnet memfs memfs-dotnet-msil + $(SolutionDir)build\$(Configuration)\$(MSBuildProjectName) + $(BaseIntermediateOutputPath)$(Configuration)\ 512 + + AnyCPU + true + full + false + DEBUG;TRACE + prompt + 4 + false + + + AnyCPU + pdbonly + true + TRACE + prompt + 4 + From 92084a56c63dcf70f4d8db7df817274a10e1ae24 Mon Sep 17 00:00:00 2001 From: Konstantinos Karakostas Date: Sun, 20 Nov 2022 20:05:10 +0200 Subject: [PATCH 8/9] build: dotnet: add missing NuGet properties --- build/VStudio/dotnet/winfsp.net.csproj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/VStudio/dotnet/winfsp.net.csproj b/build/VStudio/dotnet/winfsp.net.csproj index b153d42c..fdcebc67 100644 --- a/build/VStudio/dotnet/winfsp.net.csproj +++ b/build/VStudio/dotnet/winfsp.net.csproj @@ -81,6 +81,9 @@ $(MyProductFileName)-msil $(MyVersion) + $(MyDescription) + $(MyCompanyName) + $(MyCompanyName) From d99cb2d7d1c74f29f4dff51de8b7a4b3c0bf0653 Mon Sep 17 00:00:00 2001 From: Konstantinos Karakostas Date: Wed, 23 Nov 2022 22:47:50 +0200 Subject: [PATCH 9/9] build: dotnet: set PlatformTarget to AnyCPU --- build/VStudio/dotnet/winfsp.net.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/build/VStudio/dotnet/winfsp.net.csproj b/build/VStudio/dotnet/winfsp.net.csproj index fdcebc67..7d1f38d3 100644 --- a/build/VStudio/dotnet/winfsp.net.csproj +++ b/build/VStudio/dotnet/winfsp.net.csproj @@ -6,6 +6,7 @@ disable disable true + AnyCPU Fsp $(MyProductFileName)-msil 512