From 36cdadca909b837b328e50fcf0f5a9564980b63a Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Wed, 17 Apr 2019 10:50:36 -0700 Subject: [PATCH 01/24] add netcoreapp3.0 global tool --- azure-pipelines.yml | 8 ++++++-- src/nbgv/nbgv.csproj | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f2df0122..5914a096 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -35,12 +35,16 @@ jobs: displayName: Set build number - task: DotNetCoreInstaller@0 - displayName: Install .NET Core SDK 2.1.500 + displayName: Install .NET Core SDK inputs: packageType: sdk - version: 2.1.500 + version: 3.0.100-preview3 + - script: dotnet new globaljson --sdk-version 3.0.100-preview3 + displayName: Specify .NET Core SDK version + workingDirectory: src - script: dotnet --info displayName: Show dotnet SDK info + workingDirectory: src - task: DotNetCoreCLI@2 displayName: Restore NuGet packages diff --git a/src/nbgv/nbgv.csproj b/src/nbgv/nbgv.csproj index 721f8152..64b8602a 100644 --- a/src/nbgv/nbgv.csproj +++ b/src/nbgv/nbgv.csproj @@ -4,7 +4,7 @@ nbgv True Exe - netcoreapp2.1 + netcoreapp2.1;netcoreapp3.0 Nerdbank.GitVersioning.Tool A .NET Core Tool that can install, read and set version information based on git history, using Nerdbank.GitVersioning. From 0bc68a35f56c60ab261e2f416f2ec19baed24d85 Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Wed, 17 Apr 2019 11:04:40 -0700 Subject: [PATCH 02/24] --force --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5914a096..e20767f5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -39,7 +39,7 @@ jobs: inputs: packageType: sdk version: 3.0.100-preview3 - - script: dotnet new globaljson --sdk-version 3.0.100-preview3 + - script: dotnet new globaljson --sdk-version 3.0.100-preview3 --force displayName: Specify .NET Core SDK version workingDirectory: src - script: dotnet --info From 74f520cdf68b9e136aed85ca191fba25ffb12c67 Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Sun, 21 Apr 2019 19:25:38 -0500 Subject: [PATCH 03/24] switch to preview4 --- azure-pipelines.yml | 4 ++-- build.ps1 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e20767f5..47d44351 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -38,8 +38,8 @@ jobs: displayName: Install .NET Core SDK inputs: packageType: sdk - version: 3.0.100-preview3 - - script: dotnet new globaljson --sdk-version 3.0.100-preview3 --force + version: 3.0.100-preview4 + - script: dotnet new globaljson --sdk-version 3.0.100-preview4-011223 --force displayName: Specify .NET Core SDK version workingDirectory: src - script: dotnet --info diff --git a/build.ps1 b/build.ps1 index 93863439..c7f9683e 100644 --- a/build.ps1 +++ b/build.ps1 @@ -15,7 +15,7 @@ Param( [string]$MsBuildVerbosity = 'minimal' ) -$msbuildCommandLine = "msbuild `"$PSScriptRoot\src\Nerdbank.GitVersioning.sln`" /m /verbosity:$MsBuildVerbosity /nologo /p:Platform=`"Any CPU`" /t:build,pack" +$msbuildCommandLine = "dotnet build `"$PSScriptRoot\src\Nerdbank.GitVersioning.sln`" /m /verbosity:$MsBuildVerbosity /nologo /p:Platform=`"Any CPU`" /t:build,pack" if (Test-Path "C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll") { $msbuildCommandLine += " /logger:`"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll`"" From d3324592ab66b29d183b859814247b10eae1ba90 Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Sun, 21 Apr 2019 19:51:05 -0500 Subject: [PATCH 04/24] 3.0.100-preview4-011223 --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 47d44351..05444a28 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -38,7 +38,7 @@ jobs: displayName: Install .NET Core SDK inputs: packageType: sdk - version: 3.0.100-preview4 + version: 3.0.100-preview4-011223 - script: dotnet new globaljson --sdk-version 3.0.100-preview4-011223 --force displayName: Specify .NET Core SDK version workingDirectory: src From 5186d01b327909ea39cd187fad1cb49c0e2e9027 Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Sun, 21 Apr 2019 20:01:31 -0500 Subject: [PATCH 05/24] getVersion from 3.0 --- src/nerdbank-gitversioning.npm/ts/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nerdbank-gitversioning.npm/ts/index.ts b/src/nerdbank-gitversioning.npm/ts/index.ts index c94d2a07..7d062b6d 100644 --- a/src/nerdbank-gitversioning.npm/ts/index.ts +++ b/src/nerdbank-gitversioning.npm/ts/index.ts @@ -42,7 +42,7 @@ export interface IGitVersion { */ export async function getVersion(projectDirectory?: string): Promise { projectDirectory = projectDirectory || '.'; - var getVersionScriptPath = path.join(__dirname, nbgvPath, "tools", "netcoreapp2.1", "any", "nbgv.dll"); + var getVersionScriptPath = path.join(__dirname, nbgvPath, "tools", "netcoreapp3.0", "any", "nbgv.dll"); var versionText = await execAsync(`dotnet "${getVersionScriptPath}" get-version --format json`, { cwd: projectDirectory }) if (versionText.stderr) { throw versionText.stderr; From 3563f9889fcda186fa653967c75bbdd09ff968a4 Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Sun, 21 Apr 2019 20:32:24 -0500 Subject: [PATCH 06/24] try bumping ProtectedData to 4.5.0 --- src/nbgv/nbgv.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nbgv/nbgv.csproj b/src/nbgv/nbgv.csproj index 64b8602a..b6260b6c 100644 --- a/src/nbgv/nbgv.csproj +++ b/src/nbgv/nbgv.csproj @@ -12,6 +12,7 @@ + From 29015e886c2188bc3d53f5a2019d4a71e6ff0a2b Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Sun, 21 Apr 2019 20:49:22 -0500 Subject: [PATCH 07/24] try CopyLocalLockFileAssemblies --- src/nbgv/nbgv.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nbgv/nbgv.csproj b/src/nbgv/nbgv.csproj index b6260b6c..fcebbe59 100644 --- a/src/nbgv/nbgv.csproj +++ b/src/nbgv/nbgv.csproj @@ -5,6 +5,7 @@ True Exe netcoreapp2.1;netcoreapp3.0 + true Nerdbank.GitVersioning.Tool A .NET Core Tool that can install, read and set version information based on git history, using Nerdbank.GitVersioning. From ad04550172a52b42cde9352962e03e61703c7299 Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Sun, 21 Apr 2019 23:51:27 -0500 Subject: [PATCH 08/24] just dotnet publish there --- build.ps1 | 2 ++ src/Directory.Build.props | 2 -- src/nbgv/Program.cs | 33 +--------------------- src/nbgv/nbgv.csproj | 4 --- src/nerdbank-gitversioning.npm/ts/index.ts | 2 +- 5 files changed, 4 insertions(+), 39 deletions(-) diff --git a/build.ps1 b/build.ps1 index c7f9683e..9fb78344 100644 --- a/build.ps1 +++ b/build.ps1 @@ -16,6 +16,7 @@ Param( ) $msbuildCommandLine = "dotnet build `"$PSScriptRoot\src\Nerdbank.GitVersioning.sln`" /m /verbosity:$MsBuildVerbosity /nologo /p:Platform=`"Any CPU`" /t:build,pack" +$msbuildPublish = "dotnet publish .\src\nbgv\nbgv.csproj -f netcoreapp2.1 -o .\src\nerdbank-gitversioning.npm\out\nbgv.cli\tools\netcoreapp2.1\any" if (Test-Path "C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll") { $msbuildCommandLine += " /logger:`"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll`"" @@ -34,6 +35,7 @@ try { } } + Invoke-Expression $msbuildPublish if ($PSCmdlet.ShouldProcess("$PSScriptRoot\src\nerdbank-gitversioning.npm", "gulp")) { cd "$PSScriptRoot\src\nerdbank-gitversioning.npm" yarn run build diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 1df4c543..740309ab 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,8 +1,6 @@ Debug - $(MSBuildThisFileDirectory)..\obj\$(MSBuildProjectName)\ - $(MSBuildThisFileDirectory)..\bin\$(MSBuildProjectName)\$(Configuration)\ $(MSBuildThisFileDirectory)..\wiki\api 7.3 diff --git a/src/nbgv/Program.cs b/src/nbgv/Program.cs index 5781607a..44e885d0 100644 --- a/src/nbgv/Program.cs +++ b/src/nbgv/Program.cs @@ -8,12 +8,6 @@ namespace Nerdbank.GitVersioning.Tool using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json; - using NuGet.Common; - using NuGet.Configuration; - using NuGet.PackageManagement; - using NuGet.Protocol; - using NuGet.Protocol.Core.Types; - using NuGet.Resolver; using Validation; using MSBuild = Microsoft.Build.Evaluation; @@ -641,32 +635,7 @@ private static ExitCodes OnPrepareReleaseCommand(string projectPath, string prer private static async Task GetLatestPackageVersionAsync(string packageId, CancellationToken cancellationToken = default) { - var providers = new List>(); - providers.AddRange(Repository.Provider.GetCoreV3()); // Add v3 API support - - // We SHOULD use all the sources from the target's nuget.config file. - // But I don't know what API to use to do that. - var packageSource = new PackageSource("https://api.nuget.org/v3/index.json"); - - var sourceRepository = new SourceRepository(packageSource, providers); - var resolutionContext = new ResolutionContext( - DependencyBehavior.Highest, - includePrelease: false, - includeUnlisted: false, - VersionConstraints.None); - - // The target framework doesn't matter, since our package doesn't depend on this for its target projects. - var framework = new NuGet.Frameworks.NuGetFramework("net45"); - - var pkg = await NuGetPackageManager.GetLatestVersionAsync( - packageId, - framework, - resolutionContext, - sourceRepository, - NullLogger.Instance, - cancellationToken); - - return pkg.LatestVersion.ToNormalizedString(); + return "2.3.138"; // TODO } private static string GetSpecifiedOrCurrentDirectoryPath(string versionJsonRoot) diff --git a/src/nbgv/nbgv.csproj b/src/nbgv/nbgv.csproj index fcebbe59..1371361b 100644 --- a/src/nbgv/nbgv.csproj +++ b/src/nbgv/nbgv.csproj @@ -5,15 +5,11 @@ True Exe netcoreapp2.1;netcoreapp3.0 - true Nerdbank.GitVersioning.Tool A .NET Core Tool that can install, read and set version information based on git history, using Nerdbank.GitVersioning. - - - diff --git a/src/nerdbank-gitversioning.npm/ts/index.ts b/src/nerdbank-gitversioning.npm/ts/index.ts index 7d062b6d..c94d2a07 100644 --- a/src/nerdbank-gitversioning.npm/ts/index.ts +++ b/src/nerdbank-gitversioning.npm/ts/index.ts @@ -42,7 +42,7 @@ export interface IGitVersion { */ export async function getVersion(projectDirectory?: string): Promise { projectDirectory = projectDirectory || '.'; - var getVersionScriptPath = path.join(__dirname, nbgvPath, "tools", "netcoreapp3.0", "any", "nbgv.dll"); + var getVersionScriptPath = path.join(__dirname, nbgvPath, "tools", "netcoreapp2.1", "any", "nbgv.dll"); var versionText = await execAsync(`dotnet "${getVersionScriptPath}" get-version --format json`, { cwd: projectDirectory }) if (versionText.stderr) { throw versionText.stderr; From 1050fcfc8097a5ebf3ffb623b7fa523abd62c06a Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Mon, 22 Apr 2019 00:04:01 -0500 Subject: [PATCH 09/24] use 3.0.100-preview4-011223 --- src/global.json | 4 ++-- src/nbgv/Program.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/global.json b/src/global.json index b62f6cc5..243758ae 100644 --- a/src/global.json +++ b/src/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "2.1.500" + "version": "3.0.100-preview4-011223" } -} +} \ No newline at end of file diff --git a/src/nbgv/Program.cs b/src/nbgv/Program.cs index 44e885d0..eadca71d 100644 --- a/src/nbgv/Program.cs +++ b/src/nbgv/Program.cs @@ -633,9 +633,9 @@ private static ExitCodes OnPrepareReleaseCommand(string projectPath, string prer } } - private static async Task GetLatestPackageVersionAsync(string packageId, CancellationToken cancellationToken = default) + private static Task GetLatestPackageVersionAsync(string packageId, CancellationToken cancellationToken = default) { - return "2.3.138"; // TODO + return Task.FromResult("2.3.138"); // TODO } private static string GetSpecifiedOrCurrentDirectoryPath(string versionJsonRoot) From 60bc911ede1ef1021f9925a93df6cbd7d180bdac Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Mon, 22 Apr 2019 00:04:30 -0500 Subject: [PATCH 10/24] remove setting in pipelines --- azure-pipelines.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 05444a28..e4b2a7de 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -39,9 +39,6 @@ jobs: inputs: packageType: sdk version: 3.0.100-preview4-011223 - - script: dotnet new globaljson --sdk-version 3.0.100-preview4-011223 --force - displayName: Specify .NET Core SDK version - workingDirectory: src - script: dotnet --info displayName: Show dotnet SDK info workingDirectory: src From 08264a151de612fda3878f617ddd5d5d7fad0a34 Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Mon, 22 Apr 2019 00:32:26 -0500 Subject: [PATCH 11/24] upgrade System.Text.Encoding.CodePages to 4.5.1 --- src/global.json => global.json | 0 src/nbgv/nbgv.csproj | 2 ++ 2 files changed, 2 insertions(+) rename src/global.json => global.json (100%) diff --git a/src/global.json b/global.json similarity index 100% rename from src/global.json rename to global.json diff --git a/src/nbgv/nbgv.csproj b/src/nbgv/nbgv.csproj index 1371361b..65a7a555 100644 --- a/src/nbgv/nbgv.csproj +++ b/src/nbgv/nbgv.csproj @@ -5,11 +5,13 @@ True Exe netcoreapp2.1;netcoreapp3.0 + true Nerdbank.GitVersioning.Tool A .NET Core Tool that can install, read and set version information based on git history, using Nerdbank.GitVersioning. + From fb2a1171697c71f4891be7d0399baf90ac93dcfc Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Mon, 22 Apr 2019 00:34:42 -0500 Subject: [PATCH 12/24] mv global.json back to src --- global.json => src/global.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename global.json => src/global.json (100%) diff --git a/global.json b/src/global.json similarity index 100% rename from global.json rename to src/global.json From 612409a61f895c6075b69c26f853c907d0d50cad Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Mon, 22 Apr 2019 00:46:17 -0500 Subject: [PATCH 13/24] npm needs to run same dotnet --- azure-pipelines.yml | 9 +++++---- src/global.json => global.json | 0 2 files changed, 5 insertions(+), 4 deletions(-) rename src/global.json => global.json (100%) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e4b2a7de..701a3577 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -29,10 +29,6 @@ jobs: git config --global user.name ci git config --global user.email me@ci.com displayName: Configure git commit author for testing - - script: | - dotnet tool install --tool-path . nbgv - .\nbgv cloud -p src -a - displayName: Set build number - task: DotNetCoreInstaller@0 displayName: Install .NET Core SDK @@ -43,6 +39,11 @@ jobs: displayName: Show dotnet SDK info workingDirectory: src + - script: | + dotnet tool install --tool-path . nbgv + .\nbgv cloud -p src -a + displayName: Set build number + - task: DotNetCoreCLI@2 displayName: Restore NuGet packages inputs: diff --git a/src/global.json b/global.json similarity index 100% rename from src/global.json rename to global.json From 157f09cb5e80203b04969c8ce67e6583eedb4be5 Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Mon, 22 Apr 2019 00:52:31 -0500 Subject: [PATCH 14/24] remove CodePages change --- src/nbgv/nbgv.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/src/nbgv/nbgv.csproj b/src/nbgv/nbgv.csproj index 65a7a555..1de21ccf 100644 --- a/src/nbgv/nbgv.csproj +++ b/src/nbgv/nbgv.csproj @@ -11,7 +11,6 @@ - From 393793258dea2dd1e1177b0763ff8071488bb4c3 Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Mon, 22 Apr 2019 01:13:58 -0500 Subject: [PATCH 15/24] debug print dotnet --info --- src/nerdbank-gitversioning.npm/ts/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/nerdbank-gitversioning.npm/ts/index.ts b/src/nerdbank-gitversioning.npm/ts/index.ts index c94d2a07..1560e55e 100644 --- a/src/nerdbank-gitversioning.npm/ts/index.ts +++ b/src/nerdbank-gitversioning.npm/ts/index.ts @@ -43,6 +43,11 @@ export interface IGitVersion { export async function getVersion(projectDirectory?: string): Promise { projectDirectory = projectDirectory || '.'; var getVersionScriptPath = path.join(__dirname, nbgvPath, "tools", "netcoreapp2.1", "any", "nbgv.dll"); + var info = await execAsync(`dotnet --info`, { cwd: projectDirectory }) + if (info.stderr) { + throw info.stderr; + } + throw info.stdout; var versionText = await execAsync(`dotnet "${getVersionScriptPath}" get-version --format json`, { cwd: projectDirectory }) if (versionText.stderr) { throw versionText.stderr; From bed9b9a22db019c988bb5fe308896740ae235763 Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Mon, 22 Apr 2019 01:23:59 -0500 Subject: [PATCH 16/24] remove dotnet --info --- src/nerdbank-gitversioning.npm/ts/index.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/nerdbank-gitversioning.npm/ts/index.ts b/src/nerdbank-gitversioning.npm/ts/index.ts index 1560e55e..c94d2a07 100644 --- a/src/nerdbank-gitversioning.npm/ts/index.ts +++ b/src/nerdbank-gitversioning.npm/ts/index.ts @@ -43,11 +43,6 @@ export interface IGitVersion { export async function getVersion(projectDirectory?: string): Promise { projectDirectory = projectDirectory || '.'; var getVersionScriptPath = path.join(__dirname, nbgvPath, "tools", "netcoreapp2.1", "any", "nbgv.dll"); - var info = await execAsync(`dotnet --info`, { cwd: projectDirectory }) - if (info.stderr) { - throw info.stderr; - } - throw info.stdout; var versionText = await execAsync(`dotnet "${getVersionScriptPath}" get-version --format json`, { cwd: projectDirectory }) if (versionText.stderr) { throw versionText.stderr; From 6a68449a2971d018c9d3fae3c4cc42d7deed506d Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Mon, 22 Apr 2019 08:36:38 -0500 Subject: [PATCH 17/24] dotnet publish --- azure-pipelines.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 701a3577..baa41028 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -61,7 +61,9 @@ jobs: inputs: ProjectDirectory: 'src/nerdbank-gitversioning.npm' - - script: dotnet build -c $(BuildConfiguration) --no-restore /t:build,pack /bl:"$(Build.ArtifactStagingDirectory)/build_logs/msbuild.binlog" + - script: | + dotnet build -c $(BuildConfiguration) --no-restore /t:build,pack /bl:"$(Build.ArtifactStagingDirectory)/build_logs/msbuild.binlog" + dotnet publish .\src\nbgv\nbgv.csproj -f netcoreapp2.1 -o .\src\nerdbank-gitversioning.npm\out\nbgv.cli\tools\netcoreapp2.1\any displayName: Build NuGet package and tests workingDirectory: src From ffeac06f5b2b833a1149f5f2ac79298e350a7242 Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Mon, 22 Apr 2019 08:38:31 -0500 Subject: [PATCH 18/24] add BuildConfiguration --- azure-pipelines.yml | 2 +- build.ps1 | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index baa41028..45105d72 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -63,7 +63,7 @@ jobs: - script: | dotnet build -c $(BuildConfiguration) --no-restore /t:build,pack /bl:"$(Build.ArtifactStagingDirectory)/build_logs/msbuild.binlog" - dotnet publish .\src\nbgv\nbgv.csproj -f netcoreapp2.1 -o .\src\nerdbank-gitversioning.npm\out\nbgv.cli\tools\netcoreapp2.1\any + dotnet publish -c $(BuildConfiguration) --no-build .\src\nbgv\nbgv.csproj -f netcoreapp2.1 -o .\src\nerdbank-gitversioning.npm\out\nbgv.cli\tools\netcoreapp2.1\any displayName: Build NuGet package and tests workingDirectory: src diff --git a/build.ps1 b/build.ps1 index 9fb78344..acee8d16 100644 --- a/build.ps1 +++ b/build.ps1 @@ -24,6 +24,7 @@ if (Test-Path "C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll") if ($Configuration) { $msbuildCommandLine += " /p:Configuration=$Configuration" + $msbuildPublish += " /p:Configuration=$Configuration" } Push-Location . From 5f852956128ff1aeb1536b912b40d75edb8e8818 Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Mon, 22 Apr 2019 08:45:36 -0500 Subject: [PATCH 19/24] in src already --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 45105d72..d5eaa928 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -63,7 +63,7 @@ jobs: - script: | dotnet build -c $(BuildConfiguration) --no-restore /t:build,pack /bl:"$(Build.ArtifactStagingDirectory)/build_logs/msbuild.binlog" - dotnet publish -c $(BuildConfiguration) --no-build .\src\nbgv\nbgv.csproj -f netcoreapp2.1 -o .\src\nerdbank-gitversioning.npm\out\nbgv.cli\tools\netcoreapp2.1\any + dotnet publish -c $(BuildConfiguration) --no-build .\nbgv\nbgv.csproj -f netcoreapp2.1 -o .\nerdbank-gitversioning.npm\out\nbgv.cli\tools\netcoreapp2.1\any displayName: Build NuGet package and tests workingDirectory: src From 4222f4d40ea6a172729f9ecce69b9f058cab33ed Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Mon, 22 Apr 2019 09:18:33 -0500 Subject: [PATCH 20/24] mkdir bin/js --- src/nerdbank-gitversioning.npm/gulpfile.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/nerdbank-gitversioning.npm/gulpfile.js b/src/nerdbank-gitversioning.npm/gulpfile.js index 86307b11..e7ed4575 100644 --- a/src/nerdbank-gitversioning.npm/gulpfile.js +++ b/src/nerdbank-gitversioning.npm/gulpfile.js @@ -45,11 +45,15 @@ gulp.task('setPackageVersion', gulp.series('copyPackageContents', function () { gulp.task('package', gulp.series('setPackageVersion', function () { var afs = require('./out/asyncio'); - var binDir = '../../bin/js'; + var binDir = '../../bin'; + var binJsDir = binDir + '/js'; return afs.mkdirIfNotExistAsync(binDir) + .then(function () { + afs.mkdirIfNotExistAsync(binJsDir) + }) .then(function () { var ap = require('./out/asyncprocess'); - return ap.execAsync(`npm pack "${path.join(__dirname, outDir)}"`, { cwd: binDir }); + return ap.execAsync(`npm pack "${path.join(__dirname, outDir)}"`, { cwd: binJsDir }); }); })); From 3cf40bb09f8c261b66ef28a3344f49fa205884fa Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Mon, 22 Apr 2019 09:29:08 -0500 Subject: [PATCH 21/24] Revert "mkdir bin/js" This reverts commit 4222f4d40ea6a172729f9ecce69b9f058cab33ed. --- src/nerdbank-gitversioning.npm/gulpfile.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/nerdbank-gitversioning.npm/gulpfile.js b/src/nerdbank-gitversioning.npm/gulpfile.js index e7ed4575..86307b11 100644 --- a/src/nerdbank-gitversioning.npm/gulpfile.js +++ b/src/nerdbank-gitversioning.npm/gulpfile.js @@ -45,15 +45,11 @@ gulp.task('setPackageVersion', gulp.series('copyPackageContents', function () { gulp.task('package', gulp.series('setPackageVersion', function () { var afs = require('./out/asyncio'); - var binDir = '../../bin'; - var binJsDir = binDir + '/js'; + var binDir = '../../bin/js'; return afs.mkdirIfNotExistAsync(binDir) - .then(function () { - afs.mkdirIfNotExistAsync(binJsDir) - }) .then(function () { var ap = require('./out/asyncprocess'); - return ap.execAsync(`npm pack "${path.join(__dirname, outDir)}"`, { cwd: binJsDir }); + return ap.execAsync(`npm pack "${path.join(__dirname, outDir)}"`, { cwd: binDir }); }); })); From 6d926fda794260f1a823a558bd6eb703ef2de870 Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Mon, 22 Apr 2019 10:03:30 -0500 Subject: [PATCH 22/24] mkdir -p bin/js --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d5eaa928..9f696c43 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -61,6 +61,7 @@ jobs: inputs: ProjectDirectory: 'src/nerdbank-gitversioning.npm' + - bash: mkdir -p bin/js - script: | dotnet build -c $(BuildConfiguration) --no-restore /t:build,pack /bl:"$(Build.ArtifactStagingDirectory)/build_logs/msbuild.binlog" dotnet publish -c $(BuildConfiguration) --no-build .\nbgv\nbgv.csproj -f netcoreapp2.1 -o .\nerdbank-gitversioning.npm\out\nbgv.cli\tools\netcoreapp2.1\any From 4540fe683501dd0fb2d13d699df867cb22da4311 Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Mon, 22 Apr 2019 10:20:38 -0500 Subject: [PATCH 23/24] pack to bin --- azure-pipelines.yml | 4 ++-- build.ps1 | 19 ++++++++++++++----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9f696c43..a29c91d6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -61,9 +61,9 @@ jobs: inputs: ProjectDirectory: 'src/nerdbank-gitversioning.npm' - - bash: mkdir -p bin/js - script: | - dotnet build -c $(BuildConfiguration) --no-restore /t:build,pack /bl:"$(Build.ArtifactStagingDirectory)/build_logs/msbuild.binlog" + dotnet build -c $(BuildConfiguration) --no-restore /bl:"$(Build.ArtifactStagingDirectory)/build_logs/msbuild.binlog" + dotnet pack -c $(BuildConfiguration) --no-build -o ..\bin dotnet publish -c $(BuildConfiguration) --no-build .\nbgv\nbgv.csproj -f netcoreapp2.1 -o .\nerdbank-gitversioning.npm\out\nbgv.cli\tools\netcoreapp2.1\any displayName: Build NuGet package and tests workingDirectory: src diff --git a/build.ps1 b/build.ps1 index acee8d16..1c938c96 100644 --- a/build.ps1 +++ b/build.ps1 @@ -15,8 +15,9 @@ Param( [string]$MsBuildVerbosity = 'minimal' ) -$msbuildCommandLine = "dotnet build `"$PSScriptRoot\src\Nerdbank.GitVersioning.sln`" /m /verbosity:$MsBuildVerbosity /nologo /p:Platform=`"Any CPU`" /t:build,pack" -$msbuildPublish = "dotnet publish .\src\nbgv\nbgv.csproj -f netcoreapp2.1 -o .\src\nerdbank-gitversioning.npm\out\nbgv.cli\tools\netcoreapp2.1\any" +$msbuildCommandLine = "dotnet build `"$PSScriptRoot\src\Nerdbank.GitVersioning.sln`" /m /verbosity:$MsBuildVerbosity /nologo /p:Platform=`"Any CPU`"" +$msbuildPack = "dotnet pack --no-build `"$PSScriptRoot\src\Nerdbank.GitVersioning.sln`" -o bin" +$msbuildPublish = "dotnet publish --no-build .\src\nbgv\nbgv.csproj -f netcoreapp2.1 -o .\src\nerdbank-gitversioning.npm\out\nbgv.cli\tools\netcoreapp2.1\any" if (Test-Path "C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll") { $msbuildCommandLine += " /logger:`"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll`"" @@ -24,6 +25,7 @@ if (Test-Path "C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll") if ($Configuration) { $msbuildCommandLine += " /p:Configuration=$Configuration" + $msbuildPack += " /p:Configuration=$Configuration" $msbuildPublish += " /p:Configuration=$Configuration" } @@ -32,11 +34,18 @@ try { if ($PSCmdlet.ShouldProcess("$PSScriptRoot\src\Nerdbank.GitVersioning.sln", "msbuild")) { Invoke-Expression $msbuildCommandLine if ($LASTEXITCODE -ne 0) { - throw "MSBuild failed" + throw "dotnet build failed" + } + Invoke-Expression $msbuildPack + if ($LASTEXITCODE -ne 0) { + throw "dotnet pack failed" + } + Invoke-Expression $msbuildPublish + if ($LASTEXITCODE -ne 0) { + throw "dotnet publish failed" } } - - Invoke-Expression $msbuildPublish + if ($PSCmdlet.ShouldProcess("$PSScriptRoot\src\nerdbank-gitversioning.npm", "gulp")) { cd "$PSScriptRoot\src\nerdbank-gitversioning.npm" yarn run build From e3c1fc4dc5b5daee8058ce50cbe12ce970d0684c Mon Sep 17 00:00:00 2001 From: Cameron Taggart Date: Mon, 22 Apr 2019 10:29:15 -0500 Subject: [PATCH 24/24] CopyLocalLockFileAssemblies not needed --- azure-pipelines.yml | 1 - build.ps1 | 1 - src/nbgv/nbgv.csproj | 1 - 3 files changed, 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a29c91d6..e84443ac 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -37,7 +37,6 @@ jobs: version: 3.0.100-preview4-011223 - script: dotnet --info displayName: Show dotnet SDK info - workingDirectory: src - script: | dotnet tool install --tool-path . nbgv diff --git a/build.ps1 b/build.ps1 index 1c938c96..f23b5d5e 100644 --- a/build.ps1 +++ b/build.ps1 @@ -45,7 +45,6 @@ try { throw "dotnet publish failed" } } - if ($PSCmdlet.ShouldProcess("$PSScriptRoot\src\nerdbank-gitversioning.npm", "gulp")) { cd "$PSScriptRoot\src\nerdbank-gitversioning.npm" yarn run build diff --git a/src/nbgv/nbgv.csproj b/src/nbgv/nbgv.csproj index 1de21ccf..1371361b 100644 --- a/src/nbgv/nbgv.csproj +++ b/src/nbgv/nbgv.csproj @@ -5,7 +5,6 @@ True Exe netcoreapp2.1;netcoreapp3.0 - true Nerdbank.GitVersioning.Tool A .NET Core Tool that can install, read and set version information based on git history, using Nerdbank.GitVersioning.