From 622c3d4f28b2162c3580bf9690a4c6fc7241d039 Mon Sep 17 00:00:00 2001 From: Riccardo De Agostini Date: Tue, 18 Aug 2020 22:53:26 +0200 Subject: [PATCH 1/9] Clarify the note to contributors in Sdk\PackageVersions.props --- src/Buildvana.Sdk/Sdk/PackageVersions.props | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Buildvana.Sdk/Sdk/PackageVersions.props b/src/Buildvana.Sdk/Sdk/PackageVersions.props index 9c1177cd..5903810c 100644 --- a/src/Buildvana.Sdk/Sdk/PackageVersions.props +++ b/src/Buildvana.Sdk/Sdk/PackageVersions.props @@ -1,9 +1,9 @@ - + + From fe884b4bc06fe79bde62067e53747d687c84c4b5 Mon Sep 17 00:00:00 2001 From: Riccardo De Agostini Date: Tue, 18 Aug 2020 22:54:58 +0200 Subject: [PATCH 2/9] Remove redundant definition of UseJetBrainsAnnotations. --- .../Modules/JetBrainsAnnotations/Module.targets | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Buildvana.Sdk/Modules/JetBrainsAnnotations/Module.targets b/src/Buildvana.Sdk/Modules/JetBrainsAnnotations/Module.targets index 92ba3ec8..89835b67 100644 --- a/src/Buildvana.Sdk/Modules/JetBrainsAnnotations/Module.targets +++ b/src/Buildvana.Sdk/Modules/JetBrainsAnnotations/Module.targets @@ -1,10 +1,5 @@ - - true - false - - Date: Tue, 18 Aug 2020 22:56:14 +0200 Subject: [PATCH 3/9] Improve automatic discovery of license, thrid-paty notice, and package icon file. --- .../Modules/NuGetPack/Module.Core.targets | 198 ++++++++++++++++-- 1 file changed, 186 insertions(+), 12 deletions(-) diff --git a/src/Buildvana.Sdk/Modules/NuGetPack/Module.Core.targets b/src/Buildvana.Sdk/Modules/NuGetPack/Module.Core.targets index 31b03ad8..aa8c2acb 100644 --- a/src/Buildvana.Sdk/Modules/NuGetPack/Module.Core.targets +++ b/src/Buildvana.Sdk/Modules/NuGetPack/Module.Core.targets @@ -55,12 +55,59 @@ + $([MSBuild]::GetPathOfFileAbove('LICENSE', '$(MSBuildProjectDirectory)')) - $([MSBuild]::GetPathOfFileAbove('LICENSE.txt', '$(MSBuildProjectDirectory)')) - $([MSBuild]::GetPathOfFileAbove('LICENSE.md', '$(MSBuildProjectDirectory)')) - $([System.IO.Path]::GetFileName('$(PackageLicensePath)')) + + + $([MSBuild]::GetPathOfFileAbove('LICENSE.txt', '$(MSBuildProjectDirectory)')) + + + + $([MSBuild]::GetPathOfFileAbove('LICENSE.md', '$(MSBuildProjectDirectory)')) + + + + $([MSBuild]::GetPathOfFileAbove('License', '$(MSBuildProjectDirectory)')) + + + + $([MSBuild]::GetPathOfFileAbove('License.txt', '$(MSBuildProjectDirectory)')) + + + + $([MSBuild]::GetPathOfFileAbove('License.md', '$(MSBuildProjectDirectory)')) + + + + $([MSBuild]::GetPathOfFileAbove('license', '$(MSBuildProjectDirectory)')) + + + + $([MSBuild]::GetPathOfFileAbove('license.txt', '$(MSBuildProjectDirectory)')) + + + + $([MSBuild]::GetPathOfFileAbove('license.md', '$(MSBuildProjectDirectory)')) + + + + + $([System.IO.Path]::GetFileName('$(PackageLicensePath)')) + + + - $([MSBuild]::GetPathOfFileAbove('THIRD-PARTY-NOTICE', '$(MSBuildProjectDirectory)')) - $([MSBuild]::GetPathOfFileAbove('THIRD-PARTY-NOTICE.txt', '$(MSBuildProjectDirectory)')) - $([MSBuild]::GetPathOfFileAbove('THIRD-PARTY-NOTICE.md', '$(MSBuildProjectDirectory)')) - $([System.IO.Path]::GetFileName('$(PackageThirdPartyNoticePath)')) + $([MSBuild]::GetPathOfFileAbove('THIRD-PARTY-NOTICES', '$(MSBuildProjectDirectory)')) + + + + $([MSBuild]::GetPathOfFileAbove('THIRD-PARTY-NOTICES.txt', '$(MSBuildProjectDirectory)')) + + + + $([MSBuild]::GetPathOfFileAbove('THIRD-PARTY-NOTICES.md', '$(MSBuildProjectDirectory)')) + + + + $([MSBuild]::GetPathOfFileAbove('third-party-notices', '$(MSBuildProjectDirectory)')) + + + + $([MSBuild]::GetPathOfFileAbove('third-party-notices.txt', '$(MSBuildProjectDirectory)')) + + + + $([MSBuild]::GetPathOfFileAbove('third-party-notices.md', '$(MSBuildProjectDirectory)')) + + + + $([MSBuild]::GetPathOfFileAbove('ThirdPartyNotices', '$(MSBuildProjectDirectory)')) + + + + $([MSBuild]::GetPathOfFileAbove('ThirdPartyNotices.txt', '$(MSBuildProjectDirectory)')) + + + $([MSBuild]::GetPathOfFileAbove('ThirdPartyNotices.md', '$(MSBuildProjectDirectory)')) + + + + + $([System.IO.Path]::GetFileName('$(PackageThirdPartyNoticePath)')) + + + - $([MSBuild]::GetPathOfFileAbove('LICENSE', '$(MSBuildProjectDirectory)')) - $([MSBuild]::GetPathOfFileAbove('icon.png', '$(MSBuildProjectDirectory)')) - $([MSBuild]::GetPathOfFileAbove('$(Product).png', '$(MSBuildProjectDirectory)')) - $([MSBuild]::GetPathOfFileAbove('$(MSBuildProjectName).png', '$(MSBuildProjectDirectory)')) - $([System.IO.Path]::GetFileName('$(PackageIconPath)')) + $([MSBuild]::GetPathOfFileAbove('$(MSBuildProjectName).package.png', '$(MSBuildProjectDirectory)')) + + + + graphics/$(MSBuildProjectName).package.png + $([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildProjectDirectory)','$(BV_PackageIconSubPath)')) + $([System.IO.Path]::Combine('$(BV_PackageIconDirectory)', '$(BV_PackageIconSubPath)')) + + + + branding/$(MSBuildProjectName).package.png + $([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildProjectDirectory)','$(BV_PackageIconSubPath)')) + $([System.IO.Path]::Combine('$(BV_PackageIconDirectory)', '$(BV_PackageIconSubPath)')) + + + + $([MSBuild]::GetPathOfFileAbove('$(Product).package.png', '$(MSBuildProjectDirectory)')) + + + + graphics/$(Product).package.png + $([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildProjectDirectory)','$(BV_PackageIconSubPath)')) + $([System.IO.Path]::Combine('$(BV_PackageIconDirectory)', '$(BV_PackageIconSubPath)')) + + + + branding/$(Product).package.png + $([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildProjectDirectory)','$(BV_PackageIconSubPath)')) + $([System.IO.Path]::Combine('$(BV_PackageIconDirectory)', '$(BV_PackageIconSubPath)')) + + + + $([MSBuild]::GetPathOfFileAbove('PackageIcon.png', '$(MSBuildProjectDirectory)')) + + + + graphics/PackageIcon.png + $([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildProjectDirectory)','$(BV_PackageIconSubPath)')) + $([System.IO.Path]::Combine('$(BV_PackageIconDirectory)', '$(BV_PackageIconSubPath)')) + + + + branding/PackageIcon.png + $([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildProjectDirectory)','$(BV_PackageIconSubPath)')) + $([System.IO.Path]::Combine('$(BV_PackageIconDirectory)', '$(BV_PackageIconSubPath)')) + + + + $([MSBuild]::GetPathOfFileAbove('icon.png', '$(MSBuildProjectDirectory)')) + + + + graphics/icon.png + $([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildProjectDirectory)','$(BV_PackageIconSubPath)')) + $([System.IO.Path]::Combine('$(BV_PackageIconDirectory)', '$(BV_PackageIconSubPath)')) + + + + branding/icon.png + $([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildProjectDirectory)','$(BV_PackageIconSubPath)')) + $([System.IO.Path]::Combine('$(BV_PackageIconDirectory)', '$(BV_PackageIconSubPath)')) + + + + + $([System.IO.Path]::GetFileName('$(PackageIconPath)')) + Date: Tue, 18 Aug 2020 22:57:05 +0200 Subject: [PATCH 4/9] [ADD] Support for .nuspec file alongside project. --- .../Modules/NuGetPack/Module.Core.targets | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/src/Buildvana.Sdk/Modules/NuGetPack/Module.Core.targets b/src/Buildvana.Sdk/Modules/NuGetPack/Module.Core.targets index aa8c2acb..0a433e15 100644 --- a/src/Buildvana.Sdk/Modules/NuGetPack/Module.Core.targets +++ b/src/Buildvana.Sdk/Modules/NuGetPack/Module.Core.targets @@ -384,4 +384,48 @@ + + + $(MSBuildProjectName).nuspec + + + + + $(GenerateNuspecDependsOn);BV_SetNuspecProperties + + + + + + + 0 + + + + + id=$(PackageId); + title=$(Title); + version=$(PackageVersion); + summary=$(Summary); + description=$(Description); + owners=$(Owners.Replace(';',',')); + authors=$(Authors.Replace(';',',')); + copyright=$(Copyright); + tags=$(PackageTags.Replace(';',',')); + repositoryType=$(RepositoryType); + repositoryUrl=$(RepositoryUrl); + projectUrl=$(PackageProjectUrl); + licenseFile=$(PackageLicenseFile); + icon=$([System.IO.Path]::GetFileName('$(PackageIcon)')); + requireLicenseAcceptance=$(PackageRequireLicenseAcceptance); + packageType=$(PackageType); + releaseNotes=$(PackageReleaseNotes); + sourceRevisionId=$(SourceRevisionId); + developmentDependency=$(DevelopmentDependency); + serviceable=$(Serviceable) + + + + + \ No newline at end of file From c4088bd244f4702af3d30d8755ce0cf4c28553c4 Mon Sep 17 00:00:00 2001 From: Riccardo De Agostini Date: Tue, 18 Aug 2020 22:59:42 +0200 Subject: [PATCH 5/9] Restructure project type detection code. --- src/Buildvana.Sdk/Sdk/Sdk.props | 38 ++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/Buildvana.Sdk/Sdk/Sdk.props b/src/Buildvana.Sdk/Sdk/Sdk.props index ee368dfe..69f52ee6 100644 --- a/src/Buildvana.Sdk/Sdk/Sdk.props +++ b/src/Buildvana.Sdk/Sdk/Sdk.props @@ -49,29 +49,29 @@ $([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)..\Modules')) - - - true - - + + false - - - - - true - - false - - - - - true - - false + + + + true + + + + + true + + + + + true + + + From 5f56a3b1a13d160e43928569ea0ee9a910bac408 Mon Sep 17 00:00:00 2001 From: Riccardo De Agostini Date: Tue, 18 Aug 2020 23:01:22 +0200 Subject: [PATCH 6/9] Add global.json to build using .NET SDK 3.1.300 or higher, but NOT .NET 5 Preview. --- global.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 global.json diff --git a/global.json b/global.json new file mode 100644 index 00000000..7caee59b --- /dev/null +++ b/global.json @@ -0,0 +1,6 @@ +{ + "sdk": { + "version": "3.1.300", + "rollForward": "latestMinor" + } +} \ No newline at end of file From 8716cd7f749cb08a5a4ebe8acbcebe5ed1815e5d Mon Sep 17 00:00:00 2001 From: Riccardo De Agostini Date: Tue, 18 Aug 2020 23:03:23 +0200 Subject: [PATCH 7/9] [ADD] Support for projects using Microsoft.Build.NoTargets SDK. --- .../Modules/JetBrainsAnnotations/Module.targets | 5 +++-- .../Modules/StandardAnalyzers/BeforeModules.targets | 4 ++-- src/Buildvana.Sdk/Sdk/Sdk.props | 6 ++++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Buildvana.Sdk/Modules/JetBrainsAnnotations/Module.targets b/src/Buildvana.Sdk/Modules/JetBrainsAnnotations/Module.targets index 89835b67..fad7e070 100644 --- a/src/Buildvana.Sdk/Modules/JetBrainsAnnotations/Module.targets +++ b/src/Buildvana.Sdk/Modules/JetBrainsAnnotations/Module.targets @@ -1,7 +1,8 @@ - - + + diff --git a/src/Buildvana.Sdk/Modules/StandardAnalyzers/BeforeModules.targets b/src/Buildvana.Sdk/Modules/StandardAnalyzers/BeforeModules.targets index fef3239d..72700c59 100644 --- a/src/Buildvana.Sdk/Modules/StandardAnalyzers/BeforeModules.targets +++ b/src/Buildvana.Sdk/Modules/StandardAnalyzers/BeforeModules.targets @@ -1,9 +1,9 @@ - + true - false + false false diff --git a/src/Buildvana.Sdk/Sdk/Sdk.props b/src/Buildvana.Sdk/Sdk/Sdk.props index 69f52ee6..699ada76 100644 --- a/src/Buildvana.Sdk/Sdk/Sdk.props +++ b/src/Buildvana.Sdk/Sdk/Sdk.props @@ -51,11 +51,17 @@ + false false false false + + + true + + true From 51ac0cf2bd8ad5a00a0336924d338e4b83a2f5a7 Mon Sep 17 00:00:00 2001 From: Riccardo De Agostini Date: Tue, 18 Aug 2020 23:11:18 +0200 Subject: [PATCH 8/9] Ditch build scripts; use Microsoft.Build.NoTargets + Buildvana.Sdk --- Common.props | 20 ++++++ Directory.Build.props | 39 +---------- Directory.Build.targets | 13 +--- Directory.Packages.props | 7 -- build/MSBuild.Packaging.props | 15 ----- build/MSBuild.Packaging.targets | 90 -------------------------- src/Buildvana.Sdk/Buildvana.Sdk.csproj | 9 ++- 7 files changed, 32 insertions(+), 161 deletions(-) create mode 100644 Common.props delete mode 100644 Directory.Packages.props delete mode 100644 build/MSBuild.Packaging.props delete mode 100644 build/MSBuild.Packaging.targets diff --git a/Common.props b/Common.props new file mode 100644 index 00000000..21d24376 --- /dev/null +++ b/Common.props @@ -0,0 +1,20 @@ + + + + + Buildvana.Sdk + rdeago + Buildvana + Copyright (C) 2020 Riccardo De Agostini. + false + + + + + git + https://github.com/Buildvana/Buildvana.Sdk + https://github.com/Buildvana/Buildvana + Release notes are available at https://github.com/Buildvana/Buildvana.Sdk/blob/master/CHANGELOG.md + + + \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index 25e66b26..8b21087d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,40 +1,7 @@ - + - + - - - Buildvana.Sdk - rdeago - Buildvana - Copyright (C) 2020 Buildvana contributors. - false - LICENSE - - - - - - - - - true - - - - - git - https://github.com/Buildvana/Buildvana.Sdk - https://github.com/Buildvana/Buildvana - Release notes are available at https://github.com/Buildvana/Buildvana.Sdk/blob/master/CHANGELOG.md - - - - - $(Product).png - - - - + \ No newline at end of file diff --git a/Directory.Build.targets b/Directory.Build.targets index 5a6b4b24..06dca416 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,14 +1,7 @@ - + - + - - - - - - - $(MSBuildThisFileDirectory)artifacts\$(Configuration)\ - + \ No newline at end of file diff --git a/Directory.Packages.props b/Directory.Packages.props deleted file mode 100644 index 7d10eff3..00000000 --- a/Directory.Packages.props +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/build/MSBuild.Packaging.props b/build/MSBuild.Packaging.props deleted file mode 100644 index e88e45ca..00000000 --- a/build/MSBuild.Packaging.props +++ /dev/null @@ -1,15 +0,0 @@ - - - - - Full - - - - - - - - - - \ No newline at end of file diff --git a/build/MSBuild.Packaging.targets b/build/MSBuild.Packaging.targets deleted file mode 100644 index 81dca9a3..00000000 --- a/build/MSBuild.Packaging.targets +++ /dev/null @@ -1,90 +0,0 @@ - - - - MSBuildSdk - <_DefaultTags>build;msbuild;sdk;dotnet - $(_DefaultTags);$(PackageTags) - $(_DefaultTags) - true - true - - - - true - - - - true - $(DefaultItemExcludes);$(DefaultExcludesInProjectFolder) - $(DefaultContentItemExcludes);**\*$(DefaultLanguageSourceExtension);**\*.resx - - - - true - false - true - false - false - false - true - - - - - - - - - - - InitializeSourceControlInformation; - BuildOnlySettings; - PrepareForBuild; - PreBuildEvent; - ResolveProjectReferences; - GetTargetPath; - PrepareForRun; - IncrementalClean; - PostBuildEvent - - - - - $(MSBuildProjectName).nuspec - - - - $(GenerateNuspecDependsOn);SetNuSpecProperties - - - - - - 0 - - - - - id=$(PackageId); - title=$(Title); - version=$(PackageVersion); - summary=$(Summary); - description=$(Description); - authors=$(Authors.Replace(';',',')); - copyright=$(Copyright); - tags=$(PackageTags.Replace(';',',')); - repositoryType=$(RepositoryType); - repositoryUrl=$(RepositoryUrl); - projectUrl=$(PackageProjectUrl); - licenseFile=$(PackageLicenseFile); - requireLicenseAcceptance=$(PackageRequireLicenseAcceptance); - packageType=$(PackageType); - releaseNotes=$(PackageReleaseNotes); - sourceRevisionId=$(SourceRevisionId); - developmentDependency=$(DevelopmentDependency); - serviceable=$(Serviceable) - - - - - \ No newline at end of file diff --git a/src/Buildvana.Sdk/Buildvana.Sdk.csproj b/src/Buildvana.Sdk/Buildvana.Sdk.csproj index 1e94a7ae..70c0e050 100644 --- a/src/Buildvana.Sdk/Buildvana.Sdk.csproj +++ b/src/Buildvana.Sdk/Buildvana.Sdk.csproj @@ -1,12 +1,15 @@ - + netstandard2.0 - true + true Buildvana SDK An opinionated, best-practices-based, CI-friendly, VS-friendly, MSBuild-powered build system for .NET projects. Documentation is available here: https://github.com/Buildvana/Buildvana.Sdk/blob/master/README.md - 0.1.0 + build;msbuild;sdk;dotnet + MSBuildSdk + true + true From e15c9939927a643686a11d96009e6d5b1b394857 Mon Sep 17 00:00:00 2001 From: Riccardo De Agostini Date: Tue, 18 Aug 2020 23:11:46 +0200 Subject: [PATCH 9/9] [FIX] Authors are duplicated as owners in nuspec file. --- src/Buildvana.Sdk/Buildvana.Sdk.nuspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Buildvana.Sdk/Buildvana.Sdk.nuspec b/src/Buildvana.Sdk/Buildvana.Sdk.nuspec index ee28c766..4d24ef1b 100644 --- a/src/Buildvana.Sdk/Buildvana.Sdk.nuspec +++ b/src/Buildvana.Sdk/Buildvana.Sdk.nuspec @@ -2,7 +2,7 @@ $id$ $title$ - $authors$ + $owners$ $authors$ $version$ $copyright$