From 9c2aed97299fb96aeee3f1471ce40225437aaecf Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 22 Apr 2021 16:58:03 -0700 Subject: Integrate new build scripts with signing support --- .gitignore | 43 +++++++++---- appveyor.cmd | 12 ++-- appveyor.yml | 2 + nuget.config | 3 +- signing.json | 13 ++++ src/Directory.Build.props | 4 +- src/Directory.Build.targets | 87 +++++++++++++++++--------- src/Directory.Packages.props | 20 ++++++ src/Directory.csproj.props | 13 ++++ src/Directory.vcxproj.props | 118 +++++++++++++++++++++++++++++++++++ src/NativeMultiTargeting.Build.props | 10 +++ src/engine/container.cpp | 4 ++ src/engine/container.h | 2 +- src/stub/stub.nuspec | 25 ++++++++ src/stub/stub.vcxproj | 8 +-- src/wix.snk | Bin 0 -> 596 bytes 16 files changed, 307 insertions(+), 57 deletions(-) create mode 100644 signing.json create mode 100644 src/Directory.Packages.props create mode 100644 src/Directory.csproj.props create mode 100644 src/Directory.vcxproj.props create mode 100644 src/NativeMultiTargeting.Build.props create mode 100644 src/stub/stub.nuspec create mode 100644 src/wix.snk diff --git a/.gitignore b/.gitignore index 3e8a1553..1ee53850 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,9 @@ # User-specific files (MonoDevelop/Xamarin Studio) *.userprefs +# Mono auto generated files +mono_crash.* + # Build results [Dd]ebug/ [Dd]ebugPublic/ @@ -20,12 +23,14 @@ [Rr]eleases/ x64/ x86/ +[Ww][Ii][Nn]32/ [Aa][Rr][Mm]/ [Aa][Rr][Mm]64/ bld/ [Bb]in/ [Oo]bj/ [Ll]og/ +[Ll]ogs/ # Visual Studio 2015/2017 cache/options directory .vs/ @@ -39,9 +44,10 @@ Generated\ Files/ [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* -# NUNIT +# NUnit *.VisualState.xml TestResult.xml +nunit-*.xml # Build Results of an ATL Project [Dd]ebugPS/ @@ -56,6 +62,9 @@ project.lock.json project.fragment.lock.json artifacts/ +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + # StyleCop StyleCopReport.xml @@ -122,9 +131,6 @@ _ReSharper*/ *.[Rr]e[Ss]harper *.DotSettings.user -# JustCode is a .NET coding add-in -.JustCode - # TeamCity is a build add-in _TeamCity* @@ -135,6 +141,11 @@ _TeamCity* .axoCover/* !.axoCover/settings.json +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + # Visual Studio code coverage results *.coverage *.coveragexml @@ -182,6 +193,8 @@ PublishScripts/ # NuGet Packages *.nupkg +# NuGet Symbol Packages +*.snupkg # The packages folder can be ignored because of Package Restore **/[Pp]ackages/* # except build/, which is used as an MSBuild target. @@ -206,6 +219,8 @@ BundleArtifacts/ Package.StoreAssociation.xml _pkginfo.txt *.appx +*.appxbundle +*.appxupload # Visual Studio cache files # files ending in .cache can be ignored @@ -231,8 +246,6 @@ orleans.codegen.cs # Since there are multiple workflows, uncomment next line to ignore bower_components # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) #bower_components/ -# ASP.NET Core default setup: bower directory is configured as wwwroot/lib/ and bower restore is true -**/wwwroot/lib/ # RIA/Silverlight projects Generated_Code/ @@ -257,6 +270,9 @@ ServiceFabricBackup/ *.bim.layout *.bim_*.settings *.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl # Microsoft Fakes FakesAssemblies/ @@ -292,10 +308,6 @@ paket-files/ # FAKE - F# Make .fake/ -# JetBrains Rider -.idea/ -*.sln.iml - # CodeRush personal settings .cr/personal @@ -337,5 +349,14 @@ ASALocalRun/ # Local History for Visual Studio .localhistory/ -# BeatPulse healthcheck temp database +# BeatPulse healthcheck temp database healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd diff --git a/appveyor.cmd b/appveyor.cmd index 4f18fbee..a35e10d5 100644 --- a/appveyor.cmd +++ b/appveyor.cmd @@ -1,15 +1,17 @@ @setlocal @pushd %~dp0 +@set _C=Release +@if /i "%1"=="debug" set _C=Debug nuget restore || exit /b -msbuild -t:Test -p:Configuration=Release src\test\BurnUnitTest || exit /b +msbuild -t:Test -p:Configuration=%_C% src\test\BurnUnitTest || exit /b -msbuild -p:Configuration=Release;Platform=x86 || exit /b -msbuild -p:Configuration=Release;Platform=x64 || exit /b -msbuild -p:Configuration=Release;Platform=arm64 || exit /b +msbuild -p:Configuration=%_C%;Platform=x86 || exit /b +msbuild -p:Configuration=%_C%;Platform=x64 || exit /b +msbuild -p:Configuration=%_C%;Platform=arm64 || exit /b -msbuild -p:Configuration=Release -t:Pack src\stub\stub.vcxproj || exit /b +msbuild -p:Configuration=%_C% -t:PackNative src\stub\stub.vcxproj || exit /b @popd @endlocal \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index e4d25586..364569cf 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -35,6 +35,8 @@ skip_tags: true artifacts: - path: build\Release\**\*.nupkg name: nuget +- path: build\Release\**\*.snupkg + name: snupkg notifications: - provider: Slack diff --git a/nuget.config b/nuget.config index 405367b4..237c522e 100644 --- a/nuget.config +++ b/nuget.config @@ -4,6 +4,7 @@ + - \ No newline at end of file + diff --git a/signing.json b/signing.json new file mode 100644 index 00000000..fe1c8c9b --- /dev/null +++ b/signing.json @@ -0,0 +1,13 @@ +{ + "SignClient": { + "AzureAd": { + "AADInstance": "https://login.microsoftonline.com/", + "ClientId": "c248d68a-ba6f-4aa9-8a68-71fe872063f8", + "TenantId": "16076fdc-fcc1-4a15-b1ca-32c9a255900e" + }, + "Service": { + "Url": "https://codesign.dotnetfoundation.org/", + "ResourceId": "https://SignService/3c30251f-36f3-490b-a955-520addb85001" + } + } +} diff --git a/src/Directory.Build.props b/src/Directory.Build.props index a22f4470..fb34d54e 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -8,7 +8,6 @@ Debug false - MSB3246 $(MSBuildProjectName) $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\build\)) @@ -22,7 +21,6 @@ WiX Toolset - - + diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets index dac7452a..44701fb6 100644 --- a/src/Directory.Build.targets +++ b/src/Directory.Build.targets @@ -4,45 +4,70 @@ Do NOT modify this file. Update the canonical version in Home\repo-template\src\Directory.Build.targets then update all of the repos. --> - - true - $(SolutionPath) - $(NCrunchOriginalSolutionPath) + $(BaseOutputPath)obj\.tools + $(SigningToolFolder)\SignClient.exe + $(SigningToolFolder)\empty-filelist.txt + $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), signing.json))\signing.json + + + + false + $(OutputPath)\$(AssemblyName).xml - - + + + $(PrivateRepositoryUrl.Replace('.git','')) + + $(MSBuildProjectName).nuspec + $(MSBuildProjectDirectory) + $(NuspecProperties);Id=$(PackageId);Authors="$(Authors)";Configuration=$(Configuration);Copyright="$(Copyright)";Description="$(Description)";Title="$(Title)" + $(NuspecProperties);Version=$(NPMPackageVersion);RepositoryCommit=$(SourceRevisionId);RepositoryType=$(RepositoryType);RepositoryUrl=$(PrivateRepositoryUrl);ProjectFolder=$(MSBuildProjectDirectory)\;ProjectUrl=$(ProjectUrl) + true + snupkg + + + + + + + + + + + + + + + - - $([System.IO.File]::ReadAllText($(TheSolutionPath))) - $([System.IO.Path]::GetDirectoryName( $(TheSolutionPath) )) - (?<="[PackageName]", ")(.*)(?=", ") - + + - - - - %(Identity) - $(SolutionFileContent.Contains('\%(Identity).csproj')) - + - - - $(RegexPattern.Replace('[PackageName]','%(PackageName)') ) - $([System.Text.RegularExpressions.Regex]::Match('$(SolutionFileContent)', '%(Pattern)')) - + + - + + + + - - - + + - - + + diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props new file mode 100644 index 00000000..369c51e7 --- /dev/null +++ b/src/Directory.Packages.props @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/src/Directory.csproj.props b/src/Directory.csproj.props new file mode 100644 index 00000000..81d24ad1 --- /dev/null +++ b/src/Directory.csproj.props @@ -0,0 +1,13 @@ + + + + + true + true + $([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)wix.snk)) + false + + diff --git a/src/Directory.vcxproj.props b/src/Directory.vcxproj.props new file mode 100644 index 00000000..63d73b36 --- /dev/null +++ b/src/Directory.vcxproj.props @@ -0,0 +1,118 @@ + + + + + + Win32 + $(BaseIntermediateOutputPath)$(Configuration)\$(Platform)\ + $(OutputPath)$(Platform)\ + + + $(Company) + $(Copyright) + + win-x86;win-x64;win-arm64 + native,Version=v0.0 + + + + $([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0')) + + + + $(MSBuildThisFileDirectory)CustomizedNativeRecommendedRules.ruleset + + + + + $(DisableSpecificCompilerWarnings) + Level4 + $(ProjectDir)inc;$(MSBuildProjectDirectory);$(IntDir);$(SqlCESdkIncludePath);$(ProjectAdditionalIncludeDirectories);%(AdditionalIncludeDirectories) + WIN32;_WINDOWS;_WIN32_MSI=500;_WIN32_WINNT=0x0600;$(ArmPreprocessorDefinitions);$(UnicodePreprocessorDefinitions);_CRT_STDIO_LEGACY_WIDE_SPECIFIERS;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions) + Use + precomp.h + StdCall + true + false + Guard + -YlprecompDefine + /Zc:threadSafeInit- %(AdditionalOptions) + true + + + $(ArmPreprocessorDefinitions);%(PreprocessorDefinitions) + $(ProjectAdditionalResourceIncludeDirectories);%(AdditionalIncludeDirectories) + + + $(OutDir);$(AdditionalMultiTargetLibraryPath);$(ProjectAdditionalLibraryDirectories);%(AdditionalLibraryDirectories) + + + $(ProjectSubSystem) + $(ProjectModuleDefinitionFile) + $(ResourceOnlyDll) + true + $(ProjectAdditionalLinkLibraries);advapi32.lib;comdlg32.lib;user32.lib;oleaut32.lib;gdi32.lib;shell32.lib;ole32.lib;version.lib;%(AdditionalDependencies) + $(OutDir);$(AdditionalMultiTargetLibraryPath);$(ArmLibraryDirectories);$(ProjectAdditionalLinkLibraryDirectories);%(AdditionalLibraryDirectories) + /IGNORE:4099 %(AdditionalOptions) + + + + + + NoExtensions + + + + + CDecl + + + + + OldStyle + true + true + + + + + Disabled + EnableFastChecks + _DEBUG;DEBUG;%(PreprocessorDefinitions) + MultiThreadedDebug + + + + + + + MultiThreadedDebugDll + + + + + MinSpace + NDEBUG;%(PreprocessorDefinitions) + true + true + MultiThreaded + + + true + true + + + + + + + MultiThreadedDll + + + + + $(LinkKeyFile) + $(LinkDelaySign) + + + diff --git a/src/NativeMultiTargeting.Build.props b/src/NativeMultiTargeting.Build.props new file mode 100644 index 00000000..1ff46559 --- /dev/null +++ b/src/NativeMultiTargeting.Build.props @@ -0,0 +1,10 @@ + + + + + + + $(BaseIntermediateOutputPath)$(Configuration)\$(PlatformToolset)\$(PlatformTarget)\ + $(OutputPath)$(PlatformToolset)\$(PlatformTarget)\ + + diff --git a/src/engine/container.cpp b/src/engine/container.cpp index 2db2412c..0cce3131 100644 --- a/src/engine/container.cpp +++ b/src/engine/container.cpp @@ -318,6 +318,10 @@ extern "C" HRESULT ContainerStreamToBuffer( case BURN_CONTAINER_TYPE_CABINET: hr = CabExtractStreamToBuffer(pContext, ppbBuffer, pcbBuffer); break; + + default: + *ppbBuffer = NULL; + *pcbBuffer = 0; } //LExit: diff --git a/src/engine/container.h b/src/engine/container.h index 88fe48f1..c2c1c9a8 100644 --- a/src/engine/container.h +++ b/src/engine/container.h @@ -161,7 +161,7 @@ HRESULT ContainerOpen( __in_z LPCWSTR wzFilePath ); HRESULT ContainerNextStream( - __inout BURN_CONTAINER_CONTEXT* pContext, + __in BURN_CONTAINER_CONTEXT* pContext, __inout_z LPWSTR* psczStreamName ); HRESULT ContainerStreamToFile( diff --git a/src/stub/stub.nuspec b/src/stub/stub.nuspec new file mode 100644 index 00000000..968feff3 --- /dev/null +++ b/src/stub/stub.nuspec @@ -0,0 +1,25 @@ + + + + $id$ + $version$ + $title$ + $description$ + $authors$ + MS-RL + false + $copyright$ + $projectUrl$ + + + + + + + + + + + + + diff --git a/src/stub/stub.vcxproj b/src/stub/stub.vcxproj index 38710865..97972848 100644 --- a/src/stub/stub.vcxproj +++ b/src/stub/stub.vcxproj @@ -46,6 +46,8 @@ 1033 Burn + WixToolset.Burn + false @@ -101,10 +103,6 @@ - - - - @@ -119,4 +117,4 @@ - \ No newline at end of file + diff --git a/src/wix.snk b/src/wix.snk new file mode 100644 index 00000000..3908a66a Binary files /dev/null and b/src/wix.snk differ -- cgit v1.2.3-55-g6feb