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 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 52b5eebf..45d1af22 100644 --- a/build/VStudio/dotnet/winfsp.net.csproj +++ b/build/VStudio/dotnet/winfsp.net.csproj @@ -1,25 +1,29 @@ - - + + + $(SolutionDir)build\$(MSBuildProjectName).build\ + + - Debug AnyCPU - {94580219-CC8D-4FE5-A3BE-437B0B3481E1} Library winfsp.net Fsp $(MyProductFileName)-msil - v3.5 + netstandard2.0;net35 512 - + true + + + false + false true full false $(SolutionDir)build\$(Configuration)\ - $(SolutionDir)build\$(ProjectName).build\ $(BaseIntermediateOutputPath)$(Configuration)\ DEBUG;TRACE prompt @@ -32,7 +36,6 @@ pdbonly true $(SolutionDir)build\$(Configuration)\ - $(SolutionDir)build\$(ProjectName).build\ $(BaseIntermediateOutputPath)$(Configuration)\ TRACE prompt @@ -47,9 +50,6 @@ winfsp.net.snk - - - FileSystemBase+Const.cs @@ -70,29 +70,28 @@ - - - - - - - - - - - - - - - - - - - + + + 5.0.0 + + + 5.0.0 + + + + $(MyProductFileName)-msil + $(MyDescription) + $(MyProductName) + $(MyCopyright) + $(MyAssemblyVersion) + $(MyVersion) + + $(MyProductFileName).net + $(MyVersion) + $(MyDescription) + $(MyCopyright) + $(MyCompanyName) + exit /b 0 @@ -110,4 +109,5 @@ for /f "delims=" %25%25l in ($(ProjectDir)winfsp.net.policy.config) do ( "$(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/memfs-dotnet.csproj b/build/VStudio/testing/memfs-dotnet.csproj index a198c347..b715d61f 100644 --- a/build/VStudio/testing/memfs-dotnet.csproj +++ b/build/VStudio/testing/memfs-dotnet.csproj @@ -1,27 +1,30 @@ - - + + + $(SolutionDir)build\$(MSBuildProjectName).build\ + + - Debug AnyCPU - {4920E350-D496-4652-AE98-6C4208AEC1D8} Exe memfs-dotnet - Properties memfs memfs-dotnet-msil - v4.5.2 + net452 512 true + + false + false + AnyCPU true full false $(SolutionDir)build\$(Configuration)\ - $(SolutionDir)build\$(ProjectName).build\ $(BaseIntermediateOutputPath)$(Configuration)\ DEBUG;TRACE prompt @@ -33,32 +36,16 @@ 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 diff --git a/tools/build.bat b/tools/build.bat index 9e5ebad7..a7b99b92 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 @@ -42,8 +43,11 @@ call "%~dp0vcvarsall.bat" x64 if not X%SignedPackage%==X ( if not exist "%~dp0..\build\VStudio\build\%Configuration%\%MyProductFileName%-*.msi" (echo previous build not found >&2 & exit /b 1) if not exist "%SignedPackage%" (echo signed package not found >&2 & exit /b 1) + set Version= + for %%f in (build\%Configuration%\%MyProductFileName%-*.msi) do set Version=%%~nf + set Version=!Version:%MyProductFileName%-=! del "%~dp0..\build\VStudio\build\%Configuration%\%MyProductFileName%-*.msi" - if exist "%~dp0..\build\VStudio\build\%Configuration%\winfsp.*.nupkg" del "%~dp0..\build\VStudio\build\%Configuration%\winfsp.*.nupkg" + if exist "%~dp0..\build\VStudio\build\%Configuration%\winfsp.!Version!.nupkg" del "%~dp0..\build\VStudio\build\%Configuration%\winfsp.!Version!.nupkg" for /R "%SignedPackage%" %%f in (*.sys) do ( copy "%%f" "%~dp0..\build\VStudio\build\%Configuration%" >nul ) @@ -70,6 +74,13 @@ if X%SignedPackage%==X ( if errorlevel 1 goto fail ) + if X%UseDotnetSdk%==Xyes ( + dotnet build ./dotnet/winfsp.net.csproj -c "%Configuration%" -p:Platform=AnyCPU -p:SolutionDir="%cd%"\ + if errorlevel 1 goto fail + dotnet build ./testing/memfs-dotnet.csproj -c "%Configuration%" -p:Platform=AnyCPU -p:SolutionDir="%cd%"\ + if errorlevel 1 goto fail + ) + pushd build\%Configuration% set signfiles=^ %MyProductFileName%-a64.sys %MyProductFileName%-x64.sys %MyProductFileName%-x86.sys^ 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 diff --git a/tools/make-release.ps1 b/tools/make-release.ps1 index 02991f2d..f0410200 100644 --- a/tools/make-release.ps1 +++ b/tools/make-release.ps1 @@ -161,9 +161,15 @@ function Check-Assets { exit 1 } + # check winfsp.net.nupkg + if (!(Test-Path "$ProjectRoot\build\VStudio\build\Release\winfsp.net.*.nupkg" -ErrorAction SilentlyContinue)) { + Write-Stderr "error: cannot find winfsp.net.*.nupkg" + exit 1 + } + # check winfsp.nupkg - if (!(Test-Path "$ProjectRoot\build\VStudio\build\Release\winfsp*.nupkg" -ErrorAction SilentlyContinue)) { - Write-Stderr "error: cannot find winfsp*.nupkg" + if (!(Test-Path "$ProjectRoot\build\VStudio\build\Release\winfsp.*.nupkg" -ErrorAction SilentlyContinue)) { + Write-Stderr "error: cannot find winfsp.*.nupkg" exit 1 } @@ -324,7 +330,7 @@ function Make-ChocoRelease { Check-Assets Push-Location "$ProjectRoot\build\VStudio\build\Release" - choco push + choco push (Resolve-Path winfsp.[0-9]*.nupkg) if ($LastExitCode -ne 0) { Write-Stderr "error: cannot push to Chocolatey" exit 1