From 1d0b43c0e8f341a10446cffe74d16aef7916e58c Mon Sep 17 00:00:00 2001 From: Artur Stolear Date: Sat, 15 Sep 2018 18:47:31 +0300 Subject: [PATCH 01/13] added a new bootstrapper based on xplat powershell core and cake tool --- .editorconfig | 10 ++- .gitignore | 2 + .travis.yml | 9 +-- appveyor.yml | 6 +- run.ps1 | 161 ++++++++++++++++++++++++++++++++++++++++++ tools/packages.config | 5 -- 6 files changed, 180 insertions(+), 13 deletions(-) create mode 100644 run.ps1 delete mode 100644 tools/packages.config diff --git a/.editorconfig b/.editorconfig index a9516b4e9f..410b3d69aa 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,4 +7,12 @@ indent_size = 4 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true -insert_final_newline = true \ No newline at end of file +insert_final_newline = true + +[.yml] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/.gitignore b/.gitignore index 96a6f29cb9..02294953cc 100644 --- a/.gitignore +++ b/.gitignore @@ -117,3 +117,5 @@ GitVersion.CommandLine/*/ releaseArtifacts /ILMergeTemp +.dotnet +.cake diff --git a/.travis.yml b/.travis.yml index 5259e80a37..6f98d3720f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,18 @@ language: csharp sudo: required dist: trusty -dotnet: 2.1.105 +dotnet: 2.1.401 mono: - latest os: - linux - osx before_install: - - git fetch --unshallow # Travis always does a shallow clone, but GitVersion needs the full history including branches and tags + - git fetch --unshallow # Travis always does a shallow clone, but GitVersion needs the full history including branches and tags + - bash <(wget -O - https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.sh) script: - - ./build.sh -v Diagnostic + - pwsh ./run.ps1 -script build.cake -target Travis env: global: - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true \ No newline at end of file + - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true diff --git a/appveyor.yml b/appveyor.yml index 6df9d5c357..ca1d385785 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,6 @@ image: Visual Studio 2017 install: - npm i -g tfx-cli + - npm i -g tfx-cli assembly_info: patch: false @@ -9,10 +9,10 @@ configuration: - Debug build_script: - - ps: .\build.ps1 + - pwsh: ./run.ps1 -script build.cake test: off skip_tags: true cache: - - src\packages -> **\packages.config # preserve "packages" directory in the root of build folder but will reset it if packages.config is modified \ No newline at end of file + - src\packages -> **\packages.config # preserve "packages" directory in the root of build folder but will reset it if packages.config is modified diff --git a/run.ps1 b/run.ps1 new file mode 100644 index 0000000000..c17240c26e --- /dev/null +++ b/run.ps1 @@ -0,0 +1,161 @@ +########################################################################## +# This is the Cake bootstrapper script for PowerShell. +# This file was downloaded from https://github.com/cake-build/resources +# Feel free to change this file to fit your needs. +########################################################################## + +<# + +.SYNOPSIS +This is a Powershell script to bootstrap a Cake build. + +.DESCRIPTION +This Powershell script will download NuGet if missing, restore NuGet tools (including Cake) +and execute your Cake build script with the parameters you provide. + +.PARAMETER Script +The build script to execute. +.PARAMETER Target +The build script target to run. +.PARAMETER Configuration +The build configuration to use. +.PARAMETER Verbosity +Specifies the amount of information to be displayed. +.PARAMETER WhatIf +Performs a dry run of the build script. +No tasks will be executed. +.PARAMETER ScriptArgs +Remaining arguments are added here. + +.LINK +https://cakebuild.net +#> + +[CmdletBinding()] +Param( + [string]$Script = "build.cake", + [string]$Target = "Default", + [string]$Configuration = "Release", + [ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")] + [string]$Verbosity = "Verbose", + [Alias("DryRun","Noop")] + [switch]$WhatIf, + [Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)] + [string[]]$ScriptArgs +) + +Write-Host "Preparing to run build script..." + +$CakeVersion = "0.30.0" + +$DotNetChannel = "Current"; +$DotNetInstaller = if ($IsWindows) { "dotnet-install.ps1" } else { "dotnet-install.sh" } +$DotNetInstallerUri = "https://dot.net/v1/$DotNetInstaller"; +$DotNetVersion = (Get-Content ./src/global.json | ConvertFrom-Json).sdk.version; + +$NugetUrl = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" + +# SSL FIX +[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12; + +# Make sure tools folder exists +$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent +$ToolPath = Join-Path $PSScriptRoot "tools" +if (!(Test-Path $ToolPath)) { + Write-Verbose "Creating tools directory..." + New-Item -Path $ToolPath -Type directory | out-null +} + +########################################################################### +# INSTALL .NET CORE CLI +########################################################################### +function Remove-PathVariable([string]$VariableToRemove) { + $path = [Environment]::GetEnvironmentVariable("PATH", "User") + if ($path -ne $null) { + $newItems = $path.Split(';', [StringSplitOptions]::RemoveEmptyEntries) | Where-Object { "$($_)" -inotlike $VariableToRemove } + [Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "User") + } + + $path = [Environment]::GetEnvironmentVariable("PATH", "Process") + if ($path -ne $null) { + $newItems = $path.Split(';', [StringSplitOptions]::RemoveEmptyEntries) | Where-Object { "$($_)" -inotlike $VariableToRemove } + [Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "Process") + } +} + +# Get .NET Core CLI path if installed. +$FoundDotNetCliVersion = $null; +if (Get-Command dotnet -ErrorAction SilentlyContinue) { + $FoundDotNetCliVersion = dotnet --version; +} + +if($FoundDotNetCliVersion -ne $DotNetVersion) { + $InstallPath = Join-Path $PSScriptRoot ".dotnet" + + if (!(Test-Path $InstallPath)) { + New-Item -ItemType Directory $InstallPath | Out-Null; + } + + [string] $InstalledDotNetVersion = Get-ChildItem -Path ./.dotnet -File ` + | Where-Object { $_.Name -eq 'dotnet' -or $_.Name -eq 'dotnet.exe' } ` + | ForEach-Object { &$_.FullName --version } + + if ($InstalledDotNetVersion -ne $DotNetVersion) + { + (New-Object System.Net.WebClient).DownloadFile($DotNetInstallerUri, "$InstallPath/$DotNetInstaller"); + $Cmd = "$InstallPath/$DotNetInstaller -Channel $DotNetChannel -Version $DotNetVersion -InstallDir $InstallPath -NoPath" + if (!$IsWindows) { $Cmd = "bash $Cmd" } + Invoke-Expression "& $Cmd" + + Remove-PathVariable "$InstallPath" + $env:PATH = "$InstallPath;$env:PATH" + } +} + +# Temporarily skip verification of addins. +$env:CAKE_SETTINGS_SKIPVERIFICATION='true' +$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 +$env:DOTNET_CLI_TELEMETRY_OPTOUT=1 + +########################################################################### +# INSTALL NUGET +########################################################################### + +# Make sure nuget.exe exists. +$NugetPath = Join-Path $ToolPath "nuget.exe" +if (!(Test-Path $NugetPath)) { + Write-Host "Downloading NuGet.exe..." + (New-Object System.Net.WebClient).DownloadFile($NugetUrl, $NugetPath); +} + +########################################################################### +# INSTALL CAKE +########################################################################### + +# Make sure Cake has been installed. +Write-Host "Installing Cake..." +$CakeInstallPath = Join-Path $PSScriptRoot ".cake" +if (!(Test-Path $CakeInstallPath)) { + New-Item -ItemType Directory $CakeInstallPath | Out-Null; + Invoke-Expression "& dotnet tool install Cake.Tool --version $CakeVersion --tool-path $CakeInstallPath" +} + +# ########################################################################### +# # RUN BUILD SCRIPT +# ########################################################################### + +# Build the argument list. +$Arguments = @{ + target=$Target; + configuration=$Configuration; + verbosity=$Verbosity; + dryrun=$WhatIf; +}.GetEnumerator() | ForEach-Object { "--{0}=`"{1}`"" -f $_.key, $_.value }; + +# Start Cake +Write-Host "Running build script..." + +$Cmd = "$CakeInstallPath/dotnet-cake $Script $Arguments" +Invoke-Expression "& $Cmd" + +exit $LASTEXITCODE diff --git a/tools/packages.config b/tools/packages.config deleted file mode 100644 index 0f070f2afe..0000000000 --- a/tools/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - From 1c07af2f5ebc6077f05b453ae3ea3517919cddbd Mon Sep 17 00:00:00 2001 From: Artur Stolear Date: Wed, 12 Sep 2018 13:27:01 +0300 Subject: [PATCH 02/13] renamed Travis task to Unix --- .travis.yml | 2 +- build.cake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6f98d3720f..ff48ef9c0a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ before_install: - git fetch --unshallow # Travis always does a shallow clone, but GitVersion needs the full history including branches and tags - bash <(wget -O - https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.sh) script: - - pwsh ./run.ps1 -script build.cake -target Travis + - pwsh ./run.ps1 -script build.cake -target Unix env: global: - DOTNET_CLI_TELEMETRY_OPTOUT: 1 diff --git a/build.cake b/build.cake index 2cc1a05dbe..fd9f00ee2e 100644 --- a/build.cake +++ b/build.cake @@ -477,7 +477,7 @@ Task("Upload-AppVeyor-Artifacts") Error(exception.Dump()); }); -Task("Travis") +Task("Unix") .IsDependentOn("Run-Tests"); Task("Default") From 27d9d89500a209fc1a2518be24cb4436c88ca17a Mon Sep 17 00:00:00 2001 From: Artur Stolear Date: Fri, 14 Sep 2018 17:34:15 +0300 Subject: [PATCH 03/13] fixes for VsoAgent so that we can build on azure pipelines --- src/GitVersionCore.Tests/ExecuteCoreTests.cs | 5 +++-- src/GitVersionCore/BuildServers/VsoAgent.cs | 6 ++++-- src/GitVersionExe.Tests/GitVersionHelper.cs | 5 +++-- src/GitVersionTask.Tests/GitVersionTask.Tests.csproj | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/GitVersionCore.Tests/ExecuteCoreTests.cs b/src/GitVersionCore.Tests/ExecuteCoreTests.cs index bb6be7a756..121b30b95d 100644 --- a/src/GitVersionCore.Tests/ExecuteCoreTests.cs +++ b/src/GitVersionCore.Tests/ExecuteCoreTests.cs @@ -1,4 +1,4 @@ -using GitTools.Testing; +using GitTools.Testing; using GitVersion; using GitVersion.Helpers; using GitVersionCore.Tests; @@ -270,6 +270,7 @@ LogMessages RepositoryScope(ExecuteCore executeCore = null, Action debugLogger = s => { @@ -315,4 +316,4 @@ LogMessages RepositoryScope(ExecuteCore executeCore = null, Action(TeamCity.EnvironmentVariableName, arguments.IsTeamCity ? "8.0.0" : null), new KeyValuePair(AppVeyor.EnvironmentVariableName, null), new KeyValuePair(TravisCI.EnvironmentVariableName, null), + new KeyValuePair(VsoAgent.EnvironmentVariableName, null), }; var exitCode = -1; @@ -82,4 +83,4 @@ static ExecutionResults ExecuteIn(ArgumentBuilder arguments) return new ExecutionResults(exitCode, output.ToString(), logContents); } -} \ No newline at end of file +} diff --git a/src/GitVersionTask.Tests/GitVersionTask.Tests.csproj b/src/GitVersionTask.Tests/GitVersionTask.Tests.csproj index f60db5e352..7f060009d8 100644 --- a/src/GitVersionTask.Tests/GitVersionTask.Tests.csproj +++ b/src/GitVersionTask.Tests/GitVersionTask.Tests.csproj @@ -46,7 +46,7 @@ - + From 6320d49244e2d23cdc779f82a1bff87c025943fa Mon Sep 17 00:00:00 2001 From: Artur Stolear Date: Fri, 14 Sep 2018 18:05:00 +0300 Subject: [PATCH 04/13] added azure-pipelines.yml --- azure-pipelines.yml | 31 +++++++++++++++++++++++++++++++ src/GitVersion.sln | 1 + 2 files changed, 32 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000000..a663809348 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,31 @@ +jobs: +- job: macOS + pool: + vmImage: 'macOS 10.13' + steps: + - task: DotNetCoreInstaller@0 + displayName: 'Use .NET Core sdk 2.1.401' + inputs: + version: 2.1.401 + - powershell: ./run.ps1 -script build.cake -target Unix + displayName: 'Cake build' +- job: Linux + pool: + vmImage: 'Ubuntu 16.04' + steps: + - task: DotNetCoreInstaller@0 + displayName: 'Use .NET Core sdk 2.1.401' + inputs: + version: 2.1.401 + - powershell: ./run.ps1 -script build.cake -target Unix + displayName: 'Cake build' +- job: Windows + pool: + vmImage: 'VS2017-Win2016' + steps: + - task: DotNetCoreInstaller@0 + displayName: 'Use .NET Core sdk 2.1.401' + inputs: + version: 2.1.401 + - powershell: ./run.ps1 -script build.cake + displayName: 'Cake build' diff --git a/src/GitVersion.sln b/src/GitVersion.sln index c018de2420..007ddbb819 100644 --- a/src/GitVersion.sln +++ b/src/GitVersion.sln @@ -16,6 +16,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ..\.travis.yml = ..\.travis.yml ..\appveyor.deploy.yml = ..\appveyor.deploy.yml ..\appveyor.yml = ..\appveyor.yml + ..\azure-pipelines.yml = ..\azure-pipelines.yml ..\BREAKING CHANGES.md = ..\BREAKING CHANGES.md ..\build.cake = ..\build.cake ..\build.ps1 = ..\build.ps1 From 2f449f0c5bdcc2d27d6081a87e46d354a2414a4d Mon Sep 17 00:00:00 2001 From: Artur Stolear Date: Sat, 15 Sep 2018 18:16:11 +0300 Subject: [PATCH 05/13] added build status badge to README --- README.md | 73 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 38 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 930de3dbe2..145a49dddc 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ works out the [semantic version][semver] of the commit being built. [![Gitter][gitter-badge]][gitter] [![Build status][appveyor-badge]][appveyor] [![Build Status][travis-badge]][travis] +[![Build Status][azure-pipeline-badge]][azure-pipeline] | | Stable | Pre-release | | -------------------------: | :---------------------------------------: | :---------------------------------------: | @@ -51,38 +52,40 @@ target="_blank">Tree designed by David Chapman from The Noun Project -[icon]: https://raw.github.com/GitTools/GitVersion/master/docs/img/package_icon.png -[semver]: http://semver.org -[gitter]: https://gitter.im/GitTools/GitVersion?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge -[gitter-badge]: https://badges.gitter.im/Join+Chat.svg -[appveyor]: https://ci.appveyor.com/project/GitTools/gitversion/branch/master -[appveyor-badge]: https://ci.appveyor.com/api/projects/status/sxje0wht0cscmn7w/branch/master?svg=true -[travis]: https://travis-ci.org/GitTools/GitVersion -[travis-badge]: https://travis-ci.org/GitTools/GitVersion.svg?branch=master -[docs]: http://gitversion.readthedocs.org/en/stable/ -[docs-badge]: https://readthedocs.org/projects/gitversion/badge/?version=stable -[docs-pre]: http://gitversion.readthedocs.org/en/latest/ -[docs-pre-badge]: https://readthedocs.org/projects/gitversion/badge/?version=latest -[gh-rel]: https://github.com/GitTools/GitVersion/releases/latest -[gh-rel-badge]: https://img.shields.io/github/release/gittools/gitversion.svg -[choco]: https://chocolatey.org/packages/GitVersion.Portable -[choco-badge]: https://img.shields.io/chocolatey/v/gitversion.portable.svg -[choco-pre-badge]: https://img.shields.io/chocolatey/vpre/gitversion.portable.svg -[gvt]: https://www.nuget.org/packages/GitVersionTask -[gvt-badge]: https://img.shields.io/nuget/v/GitVersionTask.svg -[gvt-pre-badge]: https://img.shields.io/nuget/vpre/GitVersionTask.svg -[gvc]: https://www.nuget.org/packages/GitVersion.CommandLine -[gvc-badge]: https://img.shields.io/nuget/v/GitVersion.CommandLine.svg -[gvc-pre-badge]: https://img.shields.io/nuget/vpre/GitVersion.CommandLine.svg -[gem-badge]: https://img.shields.io/gem/v/gitversion.svg -[gem]: https://rubygems.org/gems/gitversion -[brew]: http://brew.sh/ -[brew-badge]: https://img.shields.io/homebrew/v/gitversion.svg -[contribute]: https://github.com/GitTools/GitVersion/blob/master/CONTRIBUTING.md -[why]: http://gitversion.readthedocs.org/en/latest/why -[usage]: http://gitversion.readthedocs.org/en/latest/usage/usage/ -[how]: http://gitversion.readthedocs.org/en/latest/more-info/how-it-works/ -[faq]: http://gitversion.readthedocs.org/en/latest/faq/ -[who]: http://gitversion.readthedocs.org/en/latest/who/ -[gv-in-action]: https://raw.github.com/GitTools/GitVersion/master/docs/img/README.png -[dockerhub]: https://hub.docker.com/r/gittools/gitversion/ +[icon]: https://raw.github.com/GitTools/GitVersion/master/docs/img/package_icon.png +[semver]: http://semver.org +[gitter]: https://gitter.im/GitTools/GitVersion?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge +[gitter-badge]: https://badges.gitter.im/Join+Chat.svg +[appveyor]: https://ci.appveyor.com/project/GitTools/gitversion/branch/master +[appveyor-badge]: https://ci.appveyor.com/api/projects/status/sxje0wht0cscmn7w/branch/master?svg=true +[azure-pipeline]: https://dev.azure.com/arturcic/OSS/_build/latest?definitionId=2 +[azure-pipeline-badge]: https://dev.azure.com/arturcic/OSS/_apis/build/status/GitVersion +[travis]: https://travis-ci.org/GitTools/GitVersion +[travis-badge]: https://travis-ci.org/GitTools/GitVersion.svg?branch=master +[docs]: http://gitversion.readthedocs.org/en/stable/ +[docs-badge]: https://readthedocs.org/projects/gitversion/badge/?version=stable +[docs-pre]: http://gitversion.readthedocs.org/en/latest/ +[docs-pre-badge]: https://readthedocs.org/projects/gitversion/badge/?version=latest +[gh-rel]: https://github.com/GitTools/GitVersion/releases/latest +[gh-rel-badge]: https://img.shields.io/github/release/gittools/gitversion.svg +[choco]: https://chocolatey.org/packages/GitVersion.Portable +[choco-badge]: https://img.shields.io/chocolatey/v/gitversion.portable.svg +[choco-pre-badge]: https://img.shields.io/chocolatey/vpre/gitversion.portable.svg +[gvt]: https://www.nuget.org/packages/GitVersionTask +[gvt-badge]: https://img.shields.io/nuget/v/GitVersionTask.svg +[gvt-pre-badge]: https://img.shields.io/nuget/vpre/GitVersionTask.svg +[gvc]: https://www.nuget.org/packages/GitVersion.CommandLine +[gvc-badge]: https://img.shields.io/nuget/v/GitVersion.CommandLine.svg +[gvc-pre-badge]: https://img.shields.io/nuget/vpre/GitVersion.CommandLine.svg +[gem-badge]: https://img.shields.io/gem/v/gitversion.svg +[gem]: https://rubygems.org/gems/gitversion +[brew]: http://brew.sh/ +[brew-badge]: https://img.shields.io/homebrew/v/gitversion.svg +[contribute]: https://github.com/GitTools/GitVersion/blob/master/CONTRIBUTING.md +[why]: http://gitversion.readthedocs.org/en/latest/why +[usage]: http://gitversion.readthedocs.org/en/latest/usage/usage/ +[how]: http://gitversion.readthedocs.org/en/latest/more-info/how-it-works/ +[faq]: http://gitversion.readthedocs.org/en/latest/faq/ +[who]: http://gitversion.readthedocs.org/en/latest/who/ +[gv-in-action]: https://raw.github.com/GitTools/GitVersion/master/docs/img/README.png +[dockerhub]: https://hub.docker.com/r/gittools/gitversion/ From d96d26dddffd692479fd964c967f4cf0d1a19e5c Mon Sep 17 00:00:00 2001 From: Artur Stolear Date: Sun, 30 Sep 2018 11:38:41 +0300 Subject: [PATCH 06/13] Implemented Nuget, Chocolatey, Docker, Vsix, Gem Publish Added Azure Pipelines support Building unit tests on unix with nunit --- .gitignore | 10 + .travis.yml | 4 +- appveyor.yml | 9 +- azure-pipelines.yml | 12 +- build/artifacts.cake | 95 ++ build/credentials.cake | 153 ++ build/parameters.cake | 171 ++ build/paths.cake | 151 ++ build/utils.cake | 201 +++ build/version.cake | 30 + .../GitVersion.CommandLine.DotNetCore.nuspec | 19 + nuspec/GitVersion.CommandLine.nuspec | 19 + nuspec/GitVersion.Portable.nuspec | 18 + nuspec/chocolateyInstall.ps1 | 1 + nuspec/chocolateyUninstall.ps1 | 2 + run.cake | 650 +++++++ src/Docker/DotNetCore/Dockerfile | 8 - src/Docker/Mono/DockerBase/Dockerfile | 23 - src/Docker/Mono/DockerBase/readme | 6 - src/Docker/Mono/Dockerfile | 16 - src/Docker/Readme.md | 16 + src/Docker/linux/dotnetcore/Dockerfile | 12 + src/Docker/linux/fullfx/Dockerfile | 12 + src/Docker/windows/dotnetcore/Dockerfile | 8 + src/Docker/windows/fullfx/Dockerfile | 8 + .../GemAssets/gitversion.gemspec | 20 - src/GitVersionExe/GitVersionExe.csproj | 36 +- .../.gitignore | 0 .../GemAssets => GitVersionRubyGem}/.rspec | 0 .../GemAssets => GitVersionRubyGem}/Gemfile | 0 .../GemAssets => GitVersionRubyGem}/Guardfile | 0 .../bin/gitversion | 0 src/GitVersionRubyGem/credentials | 2 + src/GitVersionRubyGem/gitversion.gemspec | 18 + .../lib/git_version.rb | 0 .../lib/git_version/parser.rb | 0 .../spec/lib/git_version/parser_spec.rb | 0 .../spec/lib/git_version_spec.rb | 0 .../spec/spec_helper.rb | 0 src/GitVersionTfsTask/GitVersion.ts | 2 +- .../{ => img}/build-task.png | Bin src/GitVersionTfsTask/{ => img}/builds.png | Bin src/GitVersionTfsTask/manifest.json | 43 +- src/GitVersionTfsTask/package-lock.json | 1492 +++++++++++++++++ src/GitVersionTfsTask/package.json | 43 +- src/GitVersionTfsTask/task.json | 146 +- 46 files changed, 3239 insertions(+), 217 deletions(-) create mode 100644 build/artifacts.cake create mode 100644 build/credentials.cake create mode 100644 build/parameters.cake create mode 100644 build/paths.cake create mode 100644 build/utils.cake create mode 100644 build/version.cake create mode 100644 nuspec/GitVersion.CommandLine.DotNetCore.nuspec create mode 100644 nuspec/GitVersion.CommandLine.nuspec create mode 100644 nuspec/GitVersion.Portable.nuspec create mode 100644 nuspec/chocolateyInstall.ps1 create mode 100644 nuspec/chocolateyUninstall.ps1 create mode 100644 run.cake delete mode 100644 src/Docker/DotNetCore/Dockerfile delete mode 100644 src/Docker/Mono/DockerBase/Dockerfile delete mode 100644 src/Docker/Mono/DockerBase/readme delete mode 100644 src/Docker/Mono/Dockerfile create mode 100644 src/Docker/Readme.md create mode 100644 src/Docker/linux/dotnetcore/Dockerfile create mode 100644 src/Docker/linux/fullfx/Dockerfile create mode 100644 src/Docker/windows/dotnetcore/Dockerfile create mode 100644 src/Docker/windows/fullfx/Dockerfile delete mode 100644 src/GitVersionExe/GemAssets/gitversion.gemspec rename src/{GitVersionExe/GemAssets => GitVersionRubyGem}/.gitignore (100%) rename src/{GitVersionExe/GemAssets => GitVersionRubyGem}/.rspec (100%) rename src/{GitVersionExe/GemAssets => GitVersionRubyGem}/Gemfile (100%) rename src/{GitVersionExe/GemAssets => GitVersionRubyGem}/Guardfile (100%) rename src/{GitVersionExe/GemAssets => GitVersionRubyGem}/bin/gitversion (100%) create mode 100644 src/GitVersionRubyGem/credentials create mode 100644 src/GitVersionRubyGem/gitversion.gemspec rename src/{GitVersionExe/GemAssets => GitVersionRubyGem}/lib/git_version.rb (100%) rename src/{GitVersionExe/GemAssets => GitVersionRubyGem}/lib/git_version/parser.rb (100%) rename src/{GitVersionExe/GemAssets => GitVersionRubyGem}/spec/lib/git_version/parser_spec.rb (100%) rename src/{GitVersionExe/GemAssets => GitVersionRubyGem}/spec/lib/git_version_spec.rb (100%) rename src/{GitVersionExe/GemAssets => GitVersionRubyGem}/spec/spec_helper.rb (100%) rename src/GitVersionTfsTask/{ => img}/build-task.png (100%) rename src/GitVersionTfsTask/{ => img}/builds.png (100%) create mode 100644 src/GitVersionTfsTask/package-lock.json diff --git a/.gitignore b/.gitignore index 02294953cc..a38e8d819a 100644 --- a/.gitignore +++ b/.gitignore @@ -119,3 +119,13 @@ releaseArtifacts /ILMergeTemp .dotnet .cake +artifacts +/src/Docker/**/content +/src/GitVersionTfsTask/lib +/src/GitVersionTfsTask/GitVersion.exe +/src/GitVersionTfsTask/LibGit2Sharp.dll.config +/src/GitVersionTfsTask/*.vsix +/src/GitVersionRubyGem/*.gem +/src/GitVersionRubyGem/bin/lib +/src/GitVersionRubyGem/bin/GitVersion.exe +/src/GitVersionRubyGem/bin/LibGit2Sharp.dll.config diff --git a/.travis.yml b/.travis.yml index ff48ef9c0a..b09687cd3b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,9 +9,11 @@ os: - osx before_install: - git fetch --unshallow # Travis always does a shallow clone, but GitVersion needs the full history including branches and tags + - git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" + - git fetch origin - bash <(wget -O - https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.sh) script: - - pwsh ./run.ps1 -script build.cake -target Unix + - pwsh ./run.ps1 -script run.cake -target Default env: global: - DOTNET_CLI_TELEMETRY_OPTOUT: 1 diff --git a/appveyor.yml b/appveyor.yml index ca1d385785..add7403f0d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,18 +1,15 @@ image: Visual Studio 2017 -install: - - npm i -g tfx-cli assembly_info: patch: false configuration: - Debug +install: + - set PATH=C:\Ruby25-x64\bin;%PATH% build_script: - - pwsh: ./run.ps1 -script build.cake + - pwsh: ./run.ps1 -script run.cake -target Default test: off skip_tags: true - -cache: - - src\packages -> **\packages.config # preserve "packages" directory in the root of build folder but will reset it if packages.config is modified diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a663809348..fb30cc68a7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,7 +7,7 @@ jobs: displayName: 'Use .NET Core sdk 2.1.401' inputs: version: 2.1.401 - - powershell: ./run.ps1 -script build.cake -target Unix + - powershell: ./run.ps1 -script run.cake -target Default displayName: 'Cake build' - job: Linux pool: @@ -17,7 +17,10 @@ jobs: displayName: 'Use .NET Core sdk 2.1.401' inputs: version: 2.1.401 - - powershell: ./run.ps1 -script build.cake -target Unix + - task: UseRubyVersion@0 + inputs: + addToPath: true # Optional + - powershell: ./run.ps1 -script run.cake -target Default displayName: 'Cake build' - job: Windows pool: @@ -27,5 +30,8 @@ jobs: displayName: 'Use .NET Core sdk 2.1.401' inputs: version: 2.1.401 - - powershell: ./run.ps1 -script build.cake + - task: UseRubyVersion@0 + inputs: + addToPath: true # Optional + - powershell: ./run.ps1 -script run.cake -target Default displayName: 'Cake build' diff --git a/build/artifacts.cake b/build/artifacts.cake new file mode 100644 index 0000000000..1457db6ee1 --- /dev/null +++ b/build/artifacts.cake @@ -0,0 +1,95 @@ +public class BuildPackages +{ + public ICollection All { get; private set; } + public ICollection Nuget { get; private set; } + public ICollection Chocolatey { get; private set; } + + public static BuildPackages GetPackages( + DirectoryPath nugetRooPath, + string semVersion, + string[] packageIds, + string[] chocolateyPackageIds) + { + var toNugetPackage = BuildPackage(nugetRooPath, semVersion); + var toChocolateyPackage = BuildPackage(nugetRooPath, semVersion, isChocolateyPackage: true); + var nugetPackages = packageIds.Select(toNugetPackage).ToArray(); + var chocolateyPackages = chocolateyPackageIds.Select(toChocolateyPackage).ToArray(); + + return new BuildPackages { + All = nugetPackages.Union(chocolateyPackages).ToArray(), + Nuget = nugetPackages, + Chocolatey = chocolateyPackages + }; + } + + private static Func BuildPackage( + DirectoryPath nugetRooPath, + string semVersion, + bool isChocolateyPackage = false) + { + return package => new BuildPackage( + id: package, + nuspecPath: string.Concat("./nuspec/", package, ".nuspec"), + packagePath: nugetRooPath.CombineWithFilePath(string.Concat(package, ".", semVersion, ".nupkg")), + isChocolateyPackage: isChocolateyPackage); + } +} + +public class BuildPackage +{ + public string Id { get; private set; } + public FilePath NuspecPath { get; private set; } + public FilePath PackagePath { get; private set; } + public bool IsChocolateyPackage { get; private set; } + public string PackageName { get; private set; } + + + public BuildPackage( + string id, + FilePath nuspecPath, + FilePath packagePath, + bool isChocolateyPackage) + { + Id = id; + NuspecPath = nuspecPath; + PackagePath = packagePath; + IsChocolateyPackage = isChocolateyPackage; + PackageName = PackagePath.GetFilename().ToString(); + } +} + +public class BuildArtifacts +{ + public ICollection All { get; private set; } + + public static BuildArtifacts GetArtifacts(FilePath[] artifacts) + { + var toBuildArtifact = BuildArtifact("build-artifact"); + var buildArtifacts = artifacts.Select(toBuildArtifact).ToArray(); + + return new BuildArtifacts { + All = buildArtifacts.ToArray(), + }; + } + + private static Func BuildArtifact(string containerName) + { + return artifactPath => new BuildArtifact(containerName: containerName, artifactPath: artifactPath); + } +} + +public class BuildArtifact +{ + public string ContainerName { get; private set; } + public FilePath ArtifactPath { get; private set; } + public string ArtifactName { get; private set; } + + public BuildArtifact( + string containerName, + FilePath artifactPath) + { + ContainerName = containerName; + ArtifactPath = artifactPath.FullPath; + ArtifactName = ArtifactPath.GetFilename().ToString(); + } +} diff --git a/build/credentials.cake b/build/credentials.cake new file mode 100644 index 0000000000..0dcae78508 --- /dev/null +++ b/build/credentials.cake @@ -0,0 +1,153 @@ +public class BuildCredentials +{ + public GitHubCredentials GitHub { get; private set; } + public GitterCredentials Gitter { get; private set; } + public DockerHubCredentials Docker { get; private set; } + public NugetCredentials Nuget { get; private set; } + public ChocolateyCredentials Chocolatey { get; private set; } + public TfxCredentials Tfx { get; private set; } + public RubyGemCredentials RubyGem { get; private set; } + + public static BuildCredentials GetCredentials(ICakeContext context) + { + return new BuildCredentials + { + GitHub = GitHubCredentials.GetGitHubCredentials(context), + Gitter = GitterCredentials.GetGitterCredentials(context), + Docker = DockerHubCredentials.GetDockerHubCredentials(context), + Nuget = NugetCredentials.GetNugetCredentials(context), + Chocolatey = ChocolateyCredentials.GetChocolateyCredentials(context), + Tfx = TfxCredentials.GetTfxCredentials(context), + RubyGem = RubyGemCredentials.GetRubyGemCredentials(context), + }; + } +} + +public class GitHubCredentials +{ + public string UserName { get; private set; } + public string Password { get; private set; } + public string Token { get; private set; } + + public GitHubCredentials(string userName, string password, string token) + { + UserName = userName; + Password = password; + Token = token; + } + + public static GitHubCredentials GetGitHubCredentials(ICakeContext context) + { + return new GitHubCredentials( + context.EnvironmentVariable("GITHUB_USERNAME"), + context.EnvironmentVariable("GITHUB_PASSWORD"), + context.EnvironmentVariable("GITHUB_TOKEN")); + } +} + +public class GitterCredentials +{ + public string Token { get; private set; } + public string RoomId { get; private set; } + + public GitterCredentials(string token, string roomId) + { + Token = token; + RoomId = roomId; + } + + public static GitterCredentials GetGitterCredentials(ICakeContext context) + { + return new GitterCredentials( + context.EnvironmentVariable("GITTER_TOKEN"), + context.EnvironmentVariable("GITTER_ROOM_ID") + ); + } +} + +public class DockerHubCredentials +{ + public string UserName { get; private set; } + public string Password { get; private set; } + + public DockerHubCredentials(string userName, string password) + { + UserName = userName; + Password = password; + } + + public static DockerHubCredentials GetDockerHubCredentials(ICakeContext context) + { + return new DockerHubCredentials( + context.EnvironmentVariable("DOCKER_USERNAME"), + context.EnvironmentVariable("DOCKER_PASSWORD")); + } +} + +public class NugetCredentials +{ + public string ApiKey { get; private set; } + public string ApiUrl { get; private set; } + + public NugetCredentials(string apiKey, string apiUrl) + { + ApiKey = apiKey; + ApiUrl = apiUrl; + } + + public static NugetCredentials GetNugetCredentials(ICakeContext context) + { + return new NugetCredentials( + context.EnvironmentVariable("NUGET_API_KEY"), + context.EnvironmentVariable("NUGET_API_URL")); + } +} + +public class ChocolateyCredentials +{ + public string ApiKey { get; private set; } + public string ApiUrl { get; private set; } + + public ChocolateyCredentials(string apiKey, string apiUrl) + { + ApiKey = apiKey; + ApiUrl = apiUrl; + } + + public static ChocolateyCredentials GetChocolateyCredentials(ICakeContext context) + { + return new ChocolateyCredentials( + context.EnvironmentVariable("CHOCOLATEY_API_KEY"), + context.EnvironmentVariable("CHOCOLATEY_API_URL")); + } +} + +public class TfxCredentials +{ + public string Token { get; private set; } + + public TfxCredentials(string token) + { + Token = token; + } + + public static TfxCredentials GetTfxCredentials(ICakeContext context) + { + return new TfxCredentials(context.EnvironmentVariable("TFX_TOKEN")); + } +} + +public class RubyGemCredentials +{ + public string ApiKey { get; private set; } + + public RubyGemCredentials(string apiKey) + { + ApiKey = apiKey; + } + + public static RubyGemCredentials GetRubyGemCredentials(ICakeContext context) + { + return new RubyGemCredentials(context.EnvironmentVariable("RUBY_GEM_API_KEY")); + } +} diff --git a/build/parameters.cake b/build/parameters.cake new file mode 100644 index 0000000000..c84a367d8b --- /dev/null +++ b/build/parameters.cake @@ -0,0 +1,171 @@ +#load "./paths.cake" +#load "./artifacts.cake" +#load "./credentials.cake" +#load "./version.cake" + +public class BuildParameters +{ + public string Target { get; private set; } + public string Configuration { get; private set; } + + public bool DisableUnitTests { get; private set; } + public bool DisablePublishGem { get; private set; } + public bool DisablePublishTfs { get; private set; } + public bool DisablePublishNuget { get; private set; } + public bool DisablePublishChocolatey { get; private set; } + public bool DisablePublishDocker { get; private set; } + + public bool IsRunningOnUnix { get; private set; } + public bool IsRunningOnWindows { get; private set; } + public bool IsRunningOnLinux { get; private set; } + public bool IsRunningOnMacOS { get; private set; } + + public bool IsLocalBuild { get; private set; } + public bool IsRunningOnAppVeyor { get; private set; } + public bool IsRunningOnTravis { get; private set; } + public bool IsRunningOnAzurePipeline { get; private set; } + + public bool IsMainRepo { get; private set; } + public bool IsMainBranch { get; private set; } + public bool IsTagged { get; private set; } + + public BuildCredentials Credentials { get; private set; } + public BuildVersion Version { get; private set; } + public BuildPaths Paths { get; private set; } + public BuildPackages Packages { get; private set; } + public BuildArtifacts Artifacts { get; private set; } + public Dictionary PackagesBuildMap { get; private set; } + + public bool IsStableRelease() => !IsLocalBuild && IsMainRepo && IsMainBranch && IsTagged; + public bool IsPreRelease() => !IsLocalBuild && IsMainRepo && IsMainBranch && !IsTagged; + + public bool CanPostToGitter => !string.IsNullOrWhiteSpace(Credentials.Gitter.Token) && !string.IsNullOrWhiteSpace(Credentials.Gitter.RoomId); + + public static BuildParameters GetParameters(ICakeContext context) + { + if (context == null) + { + throw new ArgumentNullException(nameof(context)); + } + + var target = context.Argument("target", "Default"); + var buildSystem = context.BuildSystem(); + + return new BuildParameters { + Target = target, + Configuration = context.Argument("configuration", "Release"), + + DisableUnitTests = IsDisabled(context, "DISABLE_UNIT_TESTS"), + DisablePublishGem = IsDisabled(context, "DISABLE_PUBLISH_GEM"), + DisablePublishTfs = IsDisabled(context, "DISABLE_PUBLISH_TFS"), + DisablePublishNuget = IsDisabled(context, "DISABLE_PUBLISH_NUGET"), + DisablePublishChocolatey = IsDisabled(context, "DISABLE_PUBLISH_CHOCOLATEY"), + DisablePublishDocker = IsDisabled(context, "DISABLE_PUBLISH_DOCKER"), + + IsRunningOnUnix = context.IsRunningOnUnix(), + IsRunningOnWindows = context.IsRunningOnWindows(), + IsRunningOnLinux = context.Environment.Platform.Family == PlatformFamily.Linux, + IsRunningOnMacOS = context.Environment.Platform.Family == PlatformFamily.OSX, + + IsLocalBuild = buildSystem.IsLocalBuild, + IsRunningOnAppVeyor = buildSystem.IsRunningOnAppVeyor, + IsRunningOnTravis = buildSystem.IsRunningOnTravisCI, + IsRunningOnAzurePipeline = buildSystem.IsRunningOnVSTS + }; + } + + public void Initialize(ICakeContext context, GitVersion gitVersion) + { + Version = BuildVersion.Calculate(context, this, gitVersion); + + Paths = BuildPaths.GetPaths(context, Configuration, Version); + + Packages = BuildPackages.GetPackages( + Paths.Directories.NugetRoot, + Version.SemVersion, + new [] { "GitVersion.CommandLine.DotNetCore", "GitVersion.CommandLine", "GitVersionCore", "GitVersionTask" }, + new [] { "GitVersion.Portable" }); + + var files = Paths.Files; + Artifacts = BuildArtifacts.GetArtifacts(new[] { + files.ZipArtifactPathDesktop, + files.ZipArtifactPathCoreClr, + files.TestCoverageOutputFilePath, + files.ReleaseNotesOutputFilePath, + files.VsixOutputFilePath, + files.GemOutputFilePath + }); + + PackagesBuildMap = new Dictionary + { + ["GitVersion.CommandLine.DotNetCore"] = Paths.Directories.ArtifactsBinNetCore, + ["GitVersion.CommandLine"] = Paths.Directories.ArtifactsBinFullFxCmdline, + ["GitVersion.Portable"] = Paths.Directories.ArtifactsBinFullFxPortable, + }; + + Credentials = BuildCredentials.GetCredentials(context); + + IsMainRepo = IsOnMainRepo(context); + IsMainBranch = IsOnMainBranch(context); + IsTagged = IsBuildTagged(context, gitVersion); + } + + private static bool IsOnMainRepo(ICakeContext context) + { + var buildSystem = context.BuildSystem(); + string repositoryName = null; + if (buildSystem.IsRunningOnAppVeyor) + { + repositoryName = buildSystem.AppVeyor.Environment.Repository.Name; + } + else if (buildSystem.IsRunningOnTravisCI) + { + repositoryName = buildSystem.TravisCI.Environment.Repository.Slug; + } + else if (buildSystem.IsRunningOnVSTS) + { + repositoryName = buildSystem.TFBuild.Environment.Repository.RepoName; + } + + context.Information("Repository Name: {0}" , repositoryName); + + return !string.IsNullOrWhiteSpace(repositoryName) && StringComparer.OrdinalIgnoreCase.Equals("gittools/gitversion", repositoryName); + } + + private static bool IsOnMainBranch(ICakeContext context) + { + var buildSystem = context.BuildSystem(); + string repositoryBranch = null; + if (buildSystem.IsRunningOnAppVeyor) + { + repositoryBranch = buildSystem.AppVeyor.Environment.Repository.Branch; + } + else if (buildSystem.IsRunningOnTravisCI) + { + repositoryBranch = buildSystem.TravisCI.Environment.Build.Branch; + } + else if (buildSystem.IsRunningOnVSTS) + { + repositoryBranch = buildSystem.TFBuild.Environment.Repository.Branch; + } + + context.Information("Repository Branch: {0}" , repositoryBranch); + + return !string.IsNullOrWhiteSpace(repositoryBranch) && StringComparer.OrdinalIgnoreCase.Equals("master", repositoryBranch); + } + + private static bool IsBuildTagged(ICakeContext context, GitVersion gitVersion) + { + var gitPath = context.Tools.Resolve(context.IsRunningOnWindows() ? "git.exe" : "git"); + context.StartProcess(gitPath, new ProcessSettings { Arguments = "tag --points-at " + gitVersion.Sha, RedirectStandardOutput = true }, out var redirectedOutput); + + return redirectedOutput.Any(); + } + + private static bool IsDisabled(ICakeContext context, string envVar) + { + var value = context.EnvironmentVariable(envVar); + + return !string.IsNullOrWhiteSpace(value) && bool.Parse(value); + } +} diff --git a/build/paths.cake b/build/paths.cake new file mode 100644 index 0000000000..9c89c5a5df --- /dev/null +++ b/build/paths.cake @@ -0,0 +1,151 @@ +public class BuildPaths +{ + public BuildFiles Files { get; private set; } + public BuildDirectories Directories { get; private set; } + + public static BuildPaths GetPaths( + ICakeContext context, + string configuration, + BuildVersion version + ) + { + if (context == null) + { + throw new ArgumentNullException(nameof(context)); + } + if (string.IsNullOrEmpty(configuration)) + { + throw new ArgumentNullException(nameof(configuration)); + } + if (version == null) + { + throw new ArgumentNullException(nameof(version)); + } + + var semVersion = version.SemVersion; + + var artifactsDir = (DirectoryPath)(context.Directory("./artifacts") + context.Directory("v" + semVersion)); + var artifactsBinDir = artifactsDir.Combine("bin"); + var artifactsBinFullFxDir = artifactsBinDir.Combine("net40"); + var artifactsBinFullFxILMergeDir = artifactsBinFullFxDir.Combine("il-merge"); + var artifactsBinFullFxPortableDir = artifactsBinFullFxDir.Combine("portable"); + var artifactsBinFullFxCmdlineDir = artifactsBinFullFxDir.Combine("cmdline"); + var artifactsBinNetCoreDir = artifactsBinDir.Combine("netcoreapp2.0"); + var nugetRootDir = artifactsDir.Combine("nuget"); + var buildArtifactDir = artifactsDir.Combine("build-artifact"); + + var zipArtifactPathCoreClr = artifactsDir.CombineWithFilePath("GitVersion-bin-coreclr-v" + semVersion + ".zip"); + var zipArtifactPathDesktop = artifactsDir.CombineWithFilePath("GitVersion-bin-net40-v" + semVersion + ".zip"); + + var testCoverageOutputFilePath = buildArtifactDir.CombineWithFilePath("TestResult.xml"); + var releaseNotesOutputFilePath = buildArtifactDir.CombineWithFilePath("releasenotes.md"); + var vsixOutputFilePath = buildArtifactDir.CombineWithFilePath("gittools.gitversion-" + version.Version + ".vsix"); + + var gemVersion = version.GemVersion.Replace("-", ".pre."); + var gemOutputFilePath = buildArtifactDir.CombineWithFilePath("testgw-" + gemVersion + ".gem"); + + // Directories + var buildDirectories = new BuildDirectories( + artifactsDir, + buildArtifactDir, + nugetRootDir, + artifactsBinDir, + artifactsBinFullFxDir, + artifactsBinFullFxPortableDir, + artifactsBinFullFxCmdlineDir, + artifactsBinFullFxILMergeDir, + artifactsBinNetCoreDir); + + // Files + var buildFiles = new BuildFiles( + context, + zipArtifactPathCoreClr, + zipArtifactPathDesktop, + testCoverageOutputFilePath, + releaseNotesOutputFilePath, + vsixOutputFilePath, + gemOutputFilePath); + + return new BuildPaths + { + Files = buildFiles, + Directories = buildDirectories + }; + } +} + +public class BuildFiles +{ + public FilePath ZipArtifactPathCoreClr { get; private set; } + public FilePath ZipArtifactPathDesktop { get; private set; } + public FilePath TestCoverageOutputFilePath { get; private set; } + public FilePath ReleaseNotesOutputFilePath { get; private set; } + public FilePath VsixOutputFilePath { get; private set; } + public FilePath GemOutputFilePath { get; private set; } + + public BuildFiles( + ICakeContext context, + FilePath zipArtifactPathCoreClr, + FilePath zipArtifactPathDesktop, + FilePath testCoverageOutputFilePath, + FilePath releaseNotesOutputFilePath, + FilePath vsixOutputFilePath, + FilePath gemOutputFilePath + ) + { + ZipArtifactPathCoreClr = zipArtifactPathCoreClr; + ZipArtifactPathDesktop = zipArtifactPathDesktop; + TestCoverageOutputFilePath = testCoverageOutputFilePath; + ReleaseNotesOutputFilePath = releaseNotesOutputFilePath; + VsixOutputFilePath = vsixOutputFilePath; + GemOutputFilePath = gemOutputFilePath; + } +} + +public class BuildDirectories +{ + public DirectoryPath Artifacts { get; private set; } + public DirectoryPath NugetRoot { get; private set; } + public DirectoryPath BuildArtifact { get; private set; } + public DirectoryPath ArtifactsBin { get; private set; } + public DirectoryPath ArtifactsBinFullFx { get; private set; } + public DirectoryPath ArtifactsBinFullFxPortable { get; private set; } + public DirectoryPath ArtifactsBinFullFxCmdline { get; private set; } + public DirectoryPath ArtifactsBinFullFxILMerge { get; private set; } + public DirectoryPath ArtifactsBinNetCore { get; private set; } + public ICollection ToClean { get; private set; } + + public BuildDirectories( + DirectoryPath artifactsDir, + DirectoryPath buildArtifactDir, + DirectoryPath nugetRootDir, + DirectoryPath artifactsBinDir, + DirectoryPath artifactsBinFullFxDir, + DirectoryPath artifactsBinFullFxPortableDir, + DirectoryPath artifactsBinFullFxCmdlineDir, + DirectoryPath artifactsBinFullFxILMergeDir, + DirectoryPath artifactsBinNetCoreDir + ) + { + Artifacts = artifactsDir; + BuildArtifact = buildArtifactDir; + NugetRoot = nugetRootDir; + ArtifactsBin = artifactsBinDir; + ArtifactsBinFullFx = artifactsBinFullFxDir; + ArtifactsBinFullFxPortable = artifactsBinFullFxPortableDir; + ArtifactsBinFullFxCmdline = artifactsBinFullFxCmdlineDir; + ArtifactsBinFullFxILMerge = artifactsBinFullFxILMergeDir; + ArtifactsBinNetCore = artifactsBinNetCoreDir; + ToClean = new[] { + Artifacts, + BuildArtifact, + NugetRoot, + ArtifactsBin, + ArtifactsBinFullFx, + ArtifactsBinFullFxPortable, + ArtifactsBinFullFxCmdline, + ArtifactsBinFullFxILMerge, + ArtifactsBinNetCore + }; + } +} diff --git a/build/utils.cake b/build/utils.cake new file mode 100644 index 0000000000..b815a217a1 --- /dev/null +++ b/build/utils.cake @@ -0,0 +1,201 @@ + +FilePath FindToolInPath(string tool) +{ + var pathEnv = EnvironmentVariable("PATH"); + if (string.IsNullOrEmpty(pathEnv) || string.IsNullOrEmpty(tool)) + { + return tool; + } + var paths = pathEnv.Split(new []{ IsRunningOnUnix() ? ':' : ';'}, StringSplitOptions.RemoveEmptyEntries); + return paths.Select(path => new DirectoryPath(path).CombineWithFilePath(tool)).FirstOrDefault(filePath => FileExists(filePath.FullPath)); +} + +void FixForMono(Cake.Core.Tooling.ToolSettings toolSettings, string toolExe) +{ + if (IsRunningOnUnix()) + { + var toolPath = Context.Tools.Resolve(toolExe); + toolSettings.ToolPath = FindToolInPath("mono"); + toolSettings.ArgumentCustomization = args => toolPath.FullPath + " " + args.Render(); + } +} + +DirectoryPath HomePath() +{ + if(IsRunningOnWindows()) { + return new DirectoryPath(EnvironmentVariable("HOMEDRIVE") + EnvironmentVariable("HOMEPATH")); + } else { + return new DirectoryPath(EnvironmentVariable("HOME")); + } +} + +void ReplaceTextInFile(FilePath filePath, string oldValue, string newValue, bool encrypt = false) +{ + Information("Replacing {0} with {1} in {2}", oldValue, !encrypt ? newValue : "******", filePath); + var file = filePath.FullPath.ToString(); + System.IO.File.WriteAllText(file, System.IO.File.ReadAllText(file).Replace(oldValue, newValue)); +} + +void SetRubyGemPushApiKey(string apiKey) +{ + // it's a hack, creating a credentials file to be able to push the gem + var workDir = "./src/GitVersionRubyGem"; + var gemHomeDir = HomePath().Combine(".gem"); + var credentialFile = new FilePath(workDir + "/credentials"); + EnsureDirectoryExists(gemHomeDir); + ReplaceTextInFile(credentialFile, "$api_key$", apiKey, true); + CopyFileToDirectory(credentialFile, gemHomeDir); +} + +GitVersion GetVersion(string dotnetVersion) +{ + var dllFile = GetFiles("**/netcoreapp2.0/GitVersion.dll").FirstOrDefault(); + var settings = new GitVersionSettings + { + OutputType = GitVersionOutput.Json, + ToolPath = FindToolInPath(IsRunningOnUnix() ? "dotnet" : "dotnet.exe"), + ArgumentCustomization = args => dllFile + " " + args.Render() + }; + + var gitVersion = GitVersion(settings); + + settings.UpdateAssemblyInfo = true; + settings.LogFilePath = "console"; + settings.OutputType = GitVersionOutput.BuildServer; + + GitVersion(settings); + + return gitVersion; +} + +void Build(string configuration, GitVersion gitVersion) +{ + DotNetCoreRestore("./src/GitVersion.sln"); + + MSBuild("./src/GitVersion.sln", settings => + { + settings.SetConfiguration(configuration) + .SetVerbosity(Verbosity.Minimal) + .WithTarget("Build") + .WithProperty("POSIX", IsRunningOnUnix().ToString()); + + if (gitVersion != null) { + Information("Building version {0} of GitVersion", gitVersion.LegacySemVerPadded); + + if (!string.IsNullOrWhiteSpace(gitVersion.NuGetVersion)) { + settings.WithProperty("GitVersion_NuGetVersion", gitVersion.NuGetVersion); + } + if (!string.IsNullOrWhiteSpace(gitVersion.LegacySemVerPadded)) { + settings.WithProperty("GitVersion_SemVer", gitVersion.LegacySemVerPadded); + } + if (!string.IsNullOrWhiteSpace(gitVersion.MajorMinorPatch)) { + settings.WithProperty("GitVersion_MajorMinorPatch", gitVersion.MajorMinorPatch); + } + if (!string.IsNullOrWhiteSpace(gitVersion.PreReleaseTag)) { + settings.WithProperty("GitVersion_PreReleaseTag", gitVersion.PreReleaseTag); + } + } + }); +} + +void ILRepackGitVersionExe(bool includeLibGit2Sharp, DirectoryPath target, DirectoryPath ilMerge) +{ + var exeName = "GitVersion.exe"; + var keyFilePath = "./src/key.snk"; + + var targetDir = target + "/"; + var ilMergeDir = ilMerge + "/"; + var targetPath = targetDir + exeName; + string outFilePath = ilMergeDir + exeName; + + CleanDirectory(ilMergeDir); + CreateDirectory(ilMergeDir); + + var sourcePattern = targetDir + "*.dll"; + var sourceFiles = GetFiles(sourcePattern); + + if (!includeLibGit2Sharp) + { + var excludePattern = "**/LibGit2Sharp.dll"; + sourceFiles = sourceFiles - GetFiles(excludePattern); + } + var settings = new ILRepackSettings { AllowDup = "", Keyfile = keyFilePath, Internalize = true, NDebug = true, TargetKind = TargetKind.Exe, TargetPlatform = TargetPlatformVersion.v4, XmlDocs = false }; + FixForMono(settings, "ILRepack.exe"); + ILRepack(outFilePath, targetPath, sourceFiles, settings); + + CopyFileToDirectory("./LICENSE", ilMergeDir); + CopyFileToDirectory(targetDir + "GitVersion.pdb", ilMergeDir); + + Information("Copying libgit2sharp files.."); + + if (!includeLibGit2Sharp) { + CopyFileToDirectory(targetDir + "LibGit2Sharp.dll", ilMergeDir); + } + CopyFileToDirectory(targetDir + "LibGit2Sharp.dll.config", ilMergeDir); + CopyDirectory(targetDir + "/lib/", ilMergeDir + "/lib/"); +} + +void PublishILRepackedGitVersionExe(bool includeLibGit2Sharp, DirectoryPath targetDir, DirectoryPath ilMergDir, DirectoryPath outputDir, string configuration, string dotnetVersion) +{ + ILRepackGitVersionExe(includeLibGit2Sharp, targetDir, ilMergDir); + CopyDirectory(ilMergDir, outputDir); + + if (includeLibGit2Sharp) { + CopyFiles("./src/GitVersionExe/NugetAssets/*.ps1", outputDir); + } + + // Copy license & Copy GitVersion.XML (since publish does not do this anymore) + CopyFileToDirectory("./LICENSE", outputDir); + CopyFileToDirectory("./src/GitVersionExe/bin/" + configuration + "/" + dotnetVersion + "/GitVersion.xml", outputDir); +} + +void DockerBuild(GitVersion version, string platform, string variant) +{ + var name = $"gittools/gitversion-{variant}"; + var workDir = DirectoryPath.FromString($"./src/Docker/{platform}/{variant}"); + + DirectoryPath sourceDir; + if (variant == "dotnetcore") { + sourceDir = parameters.Paths.Directories.ArtifactsBinNetCore.Combine("tools"); + } else { + sourceDir = parameters.Paths.Directories.ArtifactsBinFullFxCmdline.Combine("tools"); + } + CopyDirectory(sourceDir, workDir.Combine("content")); + + var buildSettings = new DockerImageBuildSettings + { + Rm = true, + Tag = new []{ $"{name}:{platform}-{version.MajorMinorPatch}" }, + File = $"{workDir}/Dockerfile", + BuildArg = new []{ $"contentFolder=/content" }, + Pull = true, + // Platform = platform // TODO this one is not supported on docker versions < 18.02 + }; + + DockerBuild(buildSettings, workDir.ToString()); +} + +void DockerPush(GitVersion version, string platform, string variant) +{ + var name = $"gittools/gitversion-{variant}"; + var tag = $"{name}:{platform}-{version.MajorMinorPatch}"; + + Information("Tag Name {0}", tag); + DockerPush(tag); +} + +void GetReleaseNotes(FilePath outputPath, DirectoryPath workDir, string repoToken) +{ + var toolPath = Context.Tools.Resolve("GitReleaseNotes.exe"); + + var arguments = new ProcessArgumentBuilder() + .Append(workDir.ToString()) + .Append("/OutputFile") + .Append(outputPath.ToString()) + .Append("/RepoToken") + .Append(repoToken); + + StartProcess(toolPath, new ProcessSettings { Arguments = arguments, RedirectStandardOutput = true }, out var redirectedOutput); + + Information(string.Join("\n", redirectedOutput)); +} diff --git a/build/version.cake b/build/version.cake new file mode 100644 index 0000000000..adac2b7a59 --- /dev/null +++ b/build/version.cake @@ -0,0 +1,30 @@ +public class BuildVersion +{ + public string Version { get; private set; } + public string SemVersion { get; private set; } + public string NuGetVersion { get; private set; } + public string DotNetAsterix { get; private set; } + public string PreReleaseTag { get; private set; } + public string GemVersion { get; private set; } + + public static BuildVersion Calculate(ICakeContext context, BuildParameters parameters, GitVersion gitVersion) + { + var semVersion = gitVersion.LegacySemVerPadded; + var version = gitVersion.MajorMinorPatch; + var preReleaseTag = gitVersion.PreReleaseTag; + + var gemVersion = string.IsNullOrEmpty(preReleaseTag) + ? version + : version + "." + preReleaseTag + "." + gitVersion.BuildMetaDataPadded; + + return new BuildVersion + { + Version = version, + SemVersion = semVersion, + NuGetVersion = gitVersion.NuGetVersion, + DotNetAsterix = semVersion.Substring(version.Length).TrimStart('-'), + PreReleaseTag = preReleaseTag, + GemVersion = gemVersion + }; + } +} diff --git a/nuspec/GitVersion.CommandLine.DotNetCore.nuspec b/nuspec/GitVersion.CommandLine.DotNetCore.nuspec new file mode 100644 index 0000000000..bd1bc66925 --- /dev/null +++ b/nuspec/GitVersion.CommandLine.DotNetCore.nuspec @@ -0,0 +1,19 @@ + + + + GitVersion.CommandLine.DotNetCore + $version$ + GitVersion.CommandLine.DotNetCore + GitTools and Contributors + GitTools and Contributors + http://www.opensource.org/licenses/mit-license.php + https://github.com/GitTools/GitVersion + https://raw.githubusercontent.com/GitTools/GitVersion/master/docs/img/package_icon.png + false + Derives SemVer information from a repository following GitFlow or GitHubFlow. + en-AU + Git Versioning GitVersion GitFlowVersion GitFlow GitHubFlow SemVer + true + https://github.com/GitTools/GitVersion/releases + + diff --git a/nuspec/GitVersion.CommandLine.nuspec b/nuspec/GitVersion.CommandLine.nuspec new file mode 100644 index 0000000000..e511d0a845 --- /dev/null +++ b/nuspec/GitVersion.CommandLine.nuspec @@ -0,0 +1,19 @@ + + + + GitVersion.CommandLine + $version$ + GitVersion.CommandLine + GitTools and Contributors + GitTools and Contributors + http://www.opensource.org/licenses/mit-license.php + https://github.com/GitTools/GitVersion + https://raw.githubusercontent.com/GitTools/GitVersion/master/docs/img/package_icon.png + false + Derives SemVer information from a repository following GitFlow or GitHubFlow. + en-AU + Git Versioning GitVersion GitFlowVersion GitFlow GitHubFlow SemVer + true + https://github.com/GitTools/GitVersion/releases + + diff --git a/nuspec/GitVersion.Portable.nuspec b/nuspec/GitVersion.Portable.nuspec new file mode 100644 index 0000000000..31e0a66ddb --- /dev/null +++ b/nuspec/GitVersion.Portable.nuspec @@ -0,0 +1,18 @@ + + + + GitVersion.Portable + $version$ + GitVersion + GitTools and Contributors + GitTools and Contributors + http://www.opensource.org/licenses/mit-license.php + https://github.com/GitTools/GitVersion + https://raw.githubusercontent.com/GitTools/GitVersion/master/docs/img/package_icon.png + false + Derives SemVer information from a repository following GitFlow or GitHubFlow. + en-AU + Git Versioning GitVersion GitFlowVersion GitFlow GitHubFlow SemVer + https://github.com/GitTools/GitVersion/releases + + diff --git a/nuspec/chocolateyInstall.ps1 b/nuspec/chocolateyInstall.ps1 new file mode 100644 index 0000000000..6d0d8b6d79 --- /dev/null +++ b/nuspec/chocolateyInstall.ps1 @@ -0,0 +1 @@ +Generate-BinFile "gfv" "$packageFolder\Tools\GitVersion.exe" \ No newline at end of file diff --git a/nuspec/chocolateyUninstall.ps1 b/nuspec/chocolateyUninstall.ps1 new file mode 100644 index 0000000000..06198afa27 --- /dev/null +++ b/nuspec/chocolateyUninstall.ps1 @@ -0,0 +1,2 @@ +Remove-BinFile "gfv" "$packageFolder\Tools\GitVersion.exe" +Remove-BinFile "GitVersion" "$packageFolder\Tools\GitVersion.exe" \ No newline at end of file diff --git a/run.cake b/run.cake new file mode 100644 index 0000000000..3db25cdd49 --- /dev/null +++ b/run.cake @@ -0,0 +1,650 @@ + +// Install addins. +#addin "nuget:?package=Cake.Gitter&version=0.9.0" +#addin "nuget:?package=Cake.Docker&version=0.9.6" +#addin "nuget:?package=Cake.Npm&version=0.15.0" +#addin "nuget:?package=Cake.Incubator&version=3.0.0" +#addin "nuget:?package=Cake.Json&version=3.0.0" +#addin "nuget:?package=Cake.Tfx&version=0.8.0" +#addin "nuget:?package=Cake.Gem&version=0.7.0" +#addin "nuget:?package=Newtonsoft.Json&version=9.0.1" + +// Install tools. +#tool "nuget:?package=NUnit.ConsoleRunner&version=3.9.0" +#tool "nuget:?package=GitReleaseNotes&version=0.7.1" +#tool "nuget:?package=ILRepack&version=2.0.16" + +// Load other scripts. +#load "./build/parameters.cake" +#load "./build/utils.cake" + +////////////////////////////////////////////////////////////////////// +// PARAMETERS +////////////////////////////////////////////////////////////////////// + +BuildParameters parameters = BuildParameters.GetParameters(Context); +bool publishingError = false; +DotNetCoreMSBuildSettings msBuildSettings = null; + +string dotnetVersion = "net40"; +GitVersion gitVersion = null; + +/////////////////////////////////////////////////////////////////////////////// +// SETUP / TEARDOWN +/////////////////////////////////////////////////////////////////////////////// + +Setup(context => +{ + Build(parameters.Configuration, null); + gitVersion = GetVersion(dotnetVersion); + parameters.Initialize(context, gitVersion); + + // Increase verbosity? + if (parameters.IsMainBranch && (context.Log.Verbosity != Verbosity.Diagnostic)) { + Information("Increasing verbosity to diagnostic."); + context.Log.Verbosity = Verbosity.Diagnostic; + } + + Information("Building version {0} of GitVersion ({1}, {2})", + parameters.Version.SemVersion, + parameters.Configuration, + parameters.Target); + + Information("Repository info : IsMainRepo {0}, IsMainBranch {1}, IsTagged: {2}", + parameters.IsMainRepo, + parameters.IsMainBranch, + parameters.IsTagged); + + msBuildSettings = new DotNetCoreMSBuildSettings() + .WithProperty("Version", parameters.Version.SemVersion) + .WithProperty("AssemblyVersion", parameters.Version.Version) + .WithProperty("PackageVersion", parameters.Version.NuGetVersion) + .WithProperty("FileVersion", parameters.Version.Version); + if(!parameters.IsRunningOnWindows) + { + var frameworkPathOverride = new FilePath(typeof(object).Assembly.Location).GetDirectory().FullPath + "/"; + + // Use FrameworkPathOverride when not running on Windows. + Information("Build will use FrameworkPathOverride={0} since not building on Windows.", frameworkPathOverride); + msBuildSettings.WithProperty("FrameworkPathOverride", frameworkPathOverride); + } +}); + +Teardown(context => +{ + Information("Starting Teardown..."); + + if(context.Successful) + { + // if(parameters.ShouldPublish) + // { + // if(parameters.CanPostToGitter) + // { + // var message = "@/all Version " + parameters.Version.SemVersion + " of the GitVersion has just been released, https://www.nuget.org/packages/GitVersion."; + + // var postMessageResult = Gitter.Chat.PostMessage( + // message: message, + // messageSettings: new GitterChatMessageSettings { Token = parameters.Gitter.Token, RoomId = parameters.Gitter.RoomId} + // ); + + // if (postMessageResult.Ok) + // { + // Information("Message {0} succcessfully sent", postMessageResult.TimeStamp); + // } + // else + // { + // Error("Failed to send message: {0}", postMessageResult.Error); + // } + // } + // } + } + + Information("Finished running tasks."); +}); + +////////////////////////////////////////////////////////////////////// +// TASKS +////////////////////////////////////////////////////////////////////// + +#region Build + +Task("Clean") + .Does(() => +{ + Information("Cleaning direcories.."); + + CleanDirectories("./src/**/bin/" + parameters.Configuration); + CleanDirectories("./src/**/obj"); + CleanDirectories(parameters.Paths.Directories.ToClean); +}); + +// This build task can be run to just build +Task("DogfoodBuild") + .IsDependentOn("Clean") + .Does(() => +{ + Build(parameters.Configuration, gitVersion); +}); + +Task("Build") + .IsDependentOn("Clean") + .Does(() => +{ + Build(parameters.Configuration, gitVersion); +}); + +#endregion + +#region Tests + +Task("Test") + .WithCriteria(() => !parameters.DisableUnitTests, "Skip unit tests.") + .IsDependentOn("Build") + .Does(() => +{ + var framework = "net461"; + + // run using dotnet test + var projects = GetFiles("./src/**/*.Tests.csproj"); + foreach(var project in projects) + { + var settings = new DotNetCoreTestSettings + { + Framework = framework, + NoBuild = true, + NoRestore = true, + Configuration = parameters.Configuration + }; + + if (IsRunningOnUnix()) + { + settings.Filter = "TestCategory!=NoMono"; + } + + DotNetCoreTest(project.ToString(), settings); + } + + // run using NUnit + var testAssemblies = GetFiles("./src/**/bin/" + parameters.Configuration + "/" + framework + "/*.Tests.dll"); + + var nunitSettings = new NUnit3Settings + { + OutputFile = parameters.Paths.Files.TestCoverageOutputFilePath + }; + + if(IsRunningOnUnix()) { + nunitSettings.Where = "cat != NoMono"; + nunitSettings.Agents = 1; + } + + FixForMono(nunitSettings, "nunit3-console.exe"); + NUnit3(testAssemblies, nunitSettings); +}); + +#endregion + +#region Package + +Task("Copy-Files") + .IsDependentOn("Test") + .Does(() => +{ + var netCoreDir = parameters.Paths.Directories.ArtifactsBinNetCore.Combine("tools"); + // .NET Core + DotNetCorePublish("./src/GitVersionExe/GitVersionExe.csproj", new DotNetCorePublishSettings + { + Framework = "netcoreapp2.0", + NoRestore = true, + Configuration = parameters.Configuration, + OutputDirectory = netCoreDir, + MSBuildSettings = msBuildSettings + }); + + // Copy license & Copy GitVersion.XML (since publish does not do this anymore) + CopyFileToDirectory("./LICENSE", netCoreDir); + CopyFileToDirectory("./src/GitVersionExe/bin/" + parameters.Configuration + "/netcoreapp2.0/GitVersion.xml", netCoreDir); + + // .NET 4.0 + DotNetCorePublish("./src/GitVersionExe/GitVersionExe.csproj", new DotNetCorePublishSettings + { + Framework = dotnetVersion, + NoBuild = true, + NoRestore = true, + VersionSuffix = parameters.Version.DotNetAsterix, + Configuration = parameters.Configuration, + OutputDirectory = parameters.Paths.Directories.ArtifactsBinFullFx, + MSBuildSettings = msBuildSettings + }); + + var ilMergDir = parameters.Paths.Directories.ArtifactsBinFullFxILMerge; + var portableDir = parameters.Paths.Directories.ArtifactsBinFullFxPortable.Combine("tools"); + var cmdlineDir = parameters.Paths.Directories.ArtifactsBinFullFxCmdline.Combine("tools"); + + // Portable + PublishILRepackedGitVersionExe(true, parameters.Paths.Directories.ArtifactsBinFullFx, ilMergDir, portableDir, parameters.Configuration, dotnetVersion); + // Commandline + PublishILRepackedGitVersionExe(false, parameters.Paths.Directories.ArtifactsBinFullFx, ilMergDir, cmdlineDir, parameters.Configuration, dotnetVersion); + + // Vsix + var tfsPath = new DirectoryPath("./src/GitVersionTfsTask"); + CopyFileToDirectory(portableDir + "/" + "LibGit2Sharp.dll.config", tfsPath); + CopyFileToDirectory(portableDir + "/" + "GitVersion.exe", tfsPath); + CopyDirectory(portableDir.Combine("lib"), tfsPath.Combine("lib")); + + // Ruby Gem + var gemPath = new DirectoryPath("./src/GitVersionRubyGem/bin"); + CopyFileToDirectory(portableDir + "/" + "LibGit2Sharp.dll.config", gemPath); + CopyFileToDirectory(portableDir + "/" + "GitVersion.exe", gemPath); + CopyDirectory(portableDir.Combine("lib"), gemPath.Combine("lib")); +}); + +Task("Pack-Tfs") + .IsDependentOn("Copy-Files") + .Does(() => +{ + var workDir = "./src/GitVersionTfsTask"; + + // update version number + ReplaceTextInFile(new FilePath(workDir + "/manifest.json"), "$version$", gitVersion.MajorMinorPatch); + + var taskJson = ParseJsonFromFile(workDir + "/task.json"); + taskJson["version"]["Major"] = gitVersion.Major.ToString(); + taskJson["version"]["Minor"] = gitVersion.Minor.ToString(); + taskJson["version"]["Patch"] = gitVersion.Patch.ToString(); + SerializeJsonToPrettyFile(workDir + "/task.json", taskJson); + + // build and pack + NpmSet("progress", "false"); + NpmInstall(new NpmInstallSettings { WorkingDirectory = workDir, LogLevel = NpmLogLevel.Silent }); + NpmRunScript(new NpmRunScriptSettings { WorkingDirectory = workDir, ScriptName = "build", LogLevel = NpmLogLevel.Silent }); + + TfxExtensionCreate(new TfxExtensionCreateSettings + { + ToolPath = workDir + "/node_modules/.bin/" + (parameters.IsRunningOnWindows ? "tfx.cmd" : "tfx"), + WorkingDirectory = workDir, + ManifestGlobs = new List(){ "manifest.json" }, + OutputPath = parameters.Paths.Directories.BuildArtifact + }); +}); + +Task("Pack-Gem") + .IsDependentOn("Copy-Files") + .Does(() => +{ + var workDir = "./src/GitVersionRubyGem"; + + var gemspecFile = new FilePath(workDir + "/gitversion.gemspec"); + // update version number + ReplaceTextInFile(gemspecFile, "$version$", parameters.Version.GemVersion); + + var toolPath = FindToolInPath(IsRunningOnWindows() ? "gem.cmd" : "gem"); + GemBuild(gemspecFile, new Cake.Gem.Build.GemBuildSettings() + { + WorkingDirectory = workDir, + ToolPath = toolPath + }); + + CopyFiles(workDir + "/*.gem", parameters.Paths.Directories.BuildArtifact); +}); + +Task("Pack-Nuget") + .IsDependentOn("Copy-Files") + .Does(() => +{ + foreach(var package in parameters.Packages.Nuget) + { + if (FileExists(package.NuspecPath)) { + var nugetSettings = new NuGetPackSettings + { + Version = parameters.Version.NuGetVersion, + BasePath = parameters.PackagesBuildMap[package.Id], + OutputDirectory = parameters.Paths.Directories.NugetRoot, + }; + + FixForMono(nugetSettings, "nuget.exe"); + NuGetPack(package.NuspecPath, nugetSettings); + } + } + + var settings = new DotNetCorePackSettings + { + Configuration = parameters.Configuration, + OutputDirectory = parameters.Paths.Directories.NugetRoot, + NoBuild = true, + NoRestore = true, + MSBuildSettings = msBuildSettings + }; + + // GitVersionCore & GitVersionTask + DotNetCorePack("./src/GitVersionCore", settings); + DotNetCorePack("./src/GitVersionTask", settings); +}); + +Task("Pack-Chocolatey") + .WithCriteria(() => parameters.IsRunningOnWindows, "Pack-Chocolatey works only on Windows agents.") + .IsDependentOn("Copy-Files") + .Does(() => +{ + foreach(var package in parameters.Packages.Chocolatey) + { + if (FileExists(package.NuspecPath)) { + var artifactPath = MakeAbsolute(parameters.PackagesBuildMap[package.Id]).FullPath; + + ChocolateyPack(package.NuspecPath, new ChocolateyPackSettings { + Verbose = true, + Version = parameters.Version.NuGetVersion, + OutputDirectory = parameters.Paths.Directories.NugetRoot, + Files = GetFiles(artifactPath + "/**/*.*") + .Select(file => new ChocolateyNuSpecContent { Source = file.FullPath, Target = file.FullPath.Replace(artifactPath, "") }) + .ToArray() + }); + } + } +}); + +Task("Zip-Files") + .IsDependentOn("Copy-Files") + .Does(() => +{ + // .NET 4.0 + var cmdlineDir = parameters.Paths.Directories.ArtifactsBinFullFxCmdline.Combine("tools"); + var fullFxFiles = GetFiles(cmdlineDir.FullPath + "/**/*"); + Zip(cmdlineDir, parameters.Paths.Files.ZipArtifactPathDesktop, fullFxFiles); + + // .NET Core + var netCoreDir = parameters.Paths.Directories.ArtifactsBinNetCore.Combine("tools"); + var coreclrFiles = GetFiles(netCoreDir.FullPath + "/**/*"); + Zip(netCoreDir, parameters.Paths.Files.ZipArtifactPathCoreClr, coreclrFiles); +}); + +Task("Docker-Build") + .WithCriteria(() => !parameters.IsRunningOnMacOS, "Docker can be built only on Windows or Linux agents.") + .WithCriteria(() => parameters.IsStableRelease() || parameters.IsPreRelease(), "Docker-Build works only for releases.") + .IsDependentOn("Copy-Files") + .Does(() => +{ + if (parameters.IsRunningOnWindows) + { + DockerBuild(gitVersion, "windows", "dotnetcore"); + DockerBuild(gitVersion, "windows", "fullfx"); + } + else if (parameters.IsRunningOnLinux) + { + DockerBuild(gitVersion, "linux", "dotnetcore"); + DockerBuild(gitVersion, "linux", "fullfx"); + } +}); + +Task("Pack") + .IsDependentOn("Pack-Tfs") + .IsDependentOn("Pack-Gem") + .IsDependentOn("Pack-Nuget") + .IsDependentOn("Pack-Chocolatey") + .IsDependentOn("Zip-Files") + .ReportError(exception => +{ + Error(exception.Dump()); +}); + +#endregion + +#region Publish + +Task("Release-Notes") + .WithCriteria(() => parameters.IsRunningOnWindows, "Release notes are generated only on Windows agents.") + .WithCriteria(() => parameters.IsRunningOnAppVeyor, "Release notes are generated only on release agents.") + .WithCriteria(() => parameters.IsStableRelease(), "Release notes are generated only for stable releases.") + .IsDependentOn("Clean") + .Does(() => +{ + var outputFile = parameters.Paths.Files.ReleaseNotesOutputFilePath; + var githubToken = parameters.Credentials.GitHub.Token; + + GetReleaseNotes(outputFile, ".", githubToken); +}).ReportError(exception => +{ + Error(exception.Dump()); +}); + +Task("Publish-AppVeyor") + .WithCriteria(() => parameters.IsRunningOnWindows, "Publish-AppVeyor works only on Windows agents.") + .WithCriteria(() => parameters.IsRunningOnAppVeyor, "Publish-AppVeyor works only on AppVeyor.") + .WithCriteria(() => parameters.IsStableRelease() || parameters.IsPreRelease(), "Publish-AppVeyor works only for releases.") + .IsDependentOn("Pack") + .IsDependentOn("Release-Notes") + .Does(() => +{ + foreach(var artifact in parameters.Artifacts.All) + { + if (FileExists(artifact.ArtifactPath)) { AppVeyor.UploadArtifact(artifact.ArtifactPath); } + } + + foreach(var package in parameters.Packages.All) + { + if (FileExists(package.PackagePath)) { AppVeyor.UploadArtifact(package.PackagePath); } + } +}) +.OnError(exception => +{ + Information("Publish-AppVeyor Task failed, but continuing with next Task..."); + publishingError = true; +}); + +Task("Publish-AzurePipeline") + .WithCriteria(() => parameters.IsRunningOnWindows, "Publish-AzurePipeline works only on Windows agents.") + .WithCriteria(() => parameters.IsRunningOnAzurePipeline, "Publish-AzurePipeline works only on AzurePipeline.") + .WithCriteria(() => parameters.IsStableRelease() || parameters.IsPreRelease(), "Publish-AzurePipeline works only for releases.") + .IsDependentOn("Pack") + .IsDependentOn("Release-Notes") + .Does(() => +{ + foreach(var artifact in parameters.Artifacts.All) + { + if (FileExists(artifact.ArtifactPath)) { TFBuild.Commands.UploadArtifact(artifact.ContainerName, artifact.ArtifactPath, artifact.ArtifactName); } + } + foreach(var package in parameters.Packages.All) + { + if (FileExists(package.PackagePath)) { TFBuild.Commands.UploadArtifact("packages", package.PackagePath, package.PackageName); } + } +}) +.OnError(exception => +{ + Information("Publish-AzurePipeline Task failed, but continuing with next Task..."); + publishingError = true; +}); + +Task("Publish-Tfs") + .WithCriteria(() => !parameters.DisablePublishTfs, "Skip publish Tfs.") + .WithCriteria(() => parameters.IsRunningOnWindows, "Publish-Tfs works only on Windows agents.") + .WithCriteria(() => parameters.IsRunningOnAppVeyor, "Publish-Tfs works only on AppVeyor.") + .WithCriteria(() => parameters.IsStableRelease(), "Publish-Tfs works only for stable releases.") + .IsDependentOn("Pack-Tfs") + .Does(() => +{ + Information("Publish-Tfs"); + return; + var token = parameters.Credentials.Tfx.Token; + if(string.IsNullOrEmpty(token)) { + throw new InvalidOperationException("Could not resolve Tfx token."); + } + + var workDir = "./src/GitVersionTfsTask"; + TfxExtensionPublish(parameters.Paths.Files.VsixOutputFilePath, new TfxExtensionPublishSettings + { + ToolPath = workDir + "/node_modules/.bin/" + (parameters.IsRunningOnWindows ? "tfx.cmd" : "tfx"), + AuthType = TfxAuthType.Pat, + Token = token + }); +}) +.OnError(exception => +{ + Information("Publish-Tfs Task failed, but continuing with next Task..."); + publishingError = true; +}); + +Task("Publish-Gem") + .WithCriteria(() => !parameters.DisablePublishGem, "Skip publish Gem.") + .WithCriteria(() => parameters.IsRunningOnWindows, "Publish-Gem works only on Windows agents.") + .WithCriteria(() => parameters.IsRunningOnAppVeyor, "Publish-Gem works only on AppVeyor.") + .WithCriteria(() => parameters.IsStableRelease(), "Publish-Gem works only for stable releases.") + .IsDependentOn("Pack-Gem") + .Does(() => +{ + var apiKey = parameters.Credentials.RubyGem.ApiKey; + if(string.IsNullOrEmpty(apiKey)) { + throw new InvalidOperationException("Could not resolve Ruby Gem Api key."); + } + + SetRubyGemPushApiKey(apiKey); + + var toolPath = FindToolInPath(IsRunningOnWindows() ? "gem.cmd" : "gem"); + GemPush(parameters.Paths.Files.GemOutputFilePath, new Cake.Gem.Push.GemPushSettings() + { + ToolPath = toolPath, + }); +}) +.OnError(exception => +{ + Information("Publish-Gem Task failed, but continuing with next Task..."); + publishingError = true; +}); + +Task("Publish-DockerHub") + .WithCriteria(() => !parameters.DisablePublishDocker, "Skip publish Docker.") + .WithCriteria(() => !parameters.IsRunningOnMacOS, "Publish-DockerHub works only on Windows and Linux agents.") + .WithCriteria(() => parameters.IsRunningOnAppVeyor || (parameters.IsRunningOnTravis && !parameters.IsRunningOnMacOS), "Publish-DockerHub works only on AppVeyor or Travis.") + .WithCriteria(() => parameters.IsStableRelease(), "Publish-DockerHub works only for releases.") + .IsDependentOn("Docker-Build") + .Does(() => +{ + var username = parameters.Credentials.Docker.UserName; + if (string.IsNullOrEmpty(username)) { + throw new InvalidOperationException("Could not resolve Docker user name."); + } + + var password = parameters.Credentials.Docker.Password; + if (string.IsNullOrEmpty(password)) { + throw new InvalidOperationException("Could not resolve Docker password."); + } + + DockerLogin(parameters.Credentials.Docker.UserName, parameters.Credentials.Docker.Password); + + if (parameters.IsRunningOnWindows) + { + DockerPush(gitVersion, "windows", "dotnetcore"); + DockerPush(gitVersion, "windows", "fullfx"); + } + else if (parameters.IsRunningOnLinux) + { + DockerPush(gitVersion, "linux", "dotnetcore"); + DockerPush(gitVersion, "linux", "fullfx"); + } + + DockerLogout(); +}) +.OnError(exception => +{ + Information("Publish-DockerHub Task failed, but continuing with next Task..."); + publishingError = true; +}); + +Task("Publish-NuGet") + .WithCriteria(() => !parameters.DisablePublishNuget, "Skip publish Nuget.") + .WithCriteria(() => parameters.IsRunningOnWindows, "Publish-NuGet works only on Windows agents.") + .WithCriteria(() => parameters.IsRunningOnAppVeyor, "Publish-NuGet works only on AppVeyor.") + .WithCriteria(() => parameters.IsStableRelease(), "Publish-NuGet works only for stable releases.") + .IsDependentOn("Pack-NuGet") + .Does(() => +{ + var apiKey = parameters.Credentials.Nuget.ApiKey; + if(string.IsNullOrEmpty(apiKey)) { + throw new InvalidOperationException("Could not resolve NuGet API key."); + } + + var apiUrl = parameters.Credentials.Nuget.ApiUrl; + if(string.IsNullOrEmpty(apiUrl)) { + throw new InvalidOperationException("Could not resolve NuGet API url."); + } + + foreach(var package in parameters.Packages.Nuget) + { + if (FileExists(package.PackagePath)) + { + // Push the package. + NuGetPush(package.PackagePath, new NuGetPushSettings + { + ApiKey = apiKey, + Source = apiUrl + }); + } + } +}) +.OnError(exception => +{ + Information("Publish-NuGet Task failed, but continuing with next Task..."); + publishingError = true; +}); + +Task("Publish-Chocolatey") + .WithCriteria(() => !parameters.DisablePublishChocolatey, "Skip publish Chocolatey.") + .WithCriteria(() => parameters.IsRunningOnWindows, "Publish-Chocolatey works only on Windows agents.") + .WithCriteria(() => parameters.IsRunningOnAppVeyor, "Publish-Chocolatey works only on AppVeyor.") + .WithCriteria(() => parameters.IsStableRelease(), "Publish-Chocolatey works only for stable releases.") + .IsDependentOn("Pack-Chocolatey") + .Does(() => +{ + var apiKey = parameters.Credentials.Chocolatey.ApiKey; + if(string.IsNullOrEmpty(apiKey)) { + throw new InvalidOperationException("Could not resolve Chocolatey API key."); + } + + var apiUrl = parameters.Credentials.Chocolatey.ApiUrl; + if(string.IsNullOrEmpty(apiUrl)) { + throw new InvalidOperationException("Could not resolve Chocolatey API url."); + } + + foreach(var package in parameters.Packages.Chocolatey) + { + if (FileExists(package.PackagePath)) + { + // Push the package. + ChocolateyPush(package.PackagePath, new ChocolateyPushSettings + { + ApiKey = apiKey, + Source = apiUrl, + Force = true + }); + } + } +}) +.OnError(exception => +{ + Information("Publish-Chocolatey Task failed, but continuing with next Task..."); + publishingError = true; +}); + +Task("Publish") + .IsDependentOn("Publish-AppVeyor") + .IsDependentOn("Publish-AzurePipeline") + .IsDependentOn("Publish-NuGet") + .IsDependentOn("Publish-Chocolatey") + .IsDependentOn("Publish-Tfs") + .IsDependentOn("Publish-Gem") + .IsDependentOn("Publish-DockerHub") + .Finally(() => +{ + if (publishingError) + { + throw new Exception("An error occurred during the publishing of GitVersion. All publishing tasks have been attempted."); + } +}); + +#endregion +Task("Default") + .IsDependentOn("Publish"); + +////////////////////////////////////////////////////////////////////// +// EXECUTION +////////////////////////////////////////////////////////////////////// + +RunTarget(parameters.Target); diff --git a/src/Docker/DotNetCore/Dockerfile b/src/Docker/DotNetCore/Dockerfile deleted file mode 100644 index 62ae308c35..0000000000 --- a/src/Docker/DotNetCore/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM microsoft/dotnet:2.0-runtime -LABEL maintainers="GitTools Maintainers" -ARG contentFolder - -WORKDIR /app -COPY $contentFolder/**/* ./ - -ENTRYPOINT ["dotnet", "GitVersion.dll"] \ No newline at end of file diff --git a/src/Docker/Mono/DockerBase/Dockerfile b/src/Docker/Mono/DockerBase/Dockerfile deleted file mode 100644 index 39d3fcc5c8..0000000000 --- a/src/Docker/Mono/DockerBase/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM ubuntu:16.04 - -MAINTAINER GitTools Maintainers - -# moviong the timezone setting at the top, as this may be the most infrequent change in this file -RUN ln -sfn /usr/share/zoneinfo/GMT /etc/localtime - -# Following current install guide from -# http://www.mono-project.com/download/#download-lin on 2017-12-08 -# regarding to the repository sources -RUN echo "deb http://download.mono-project.com/repo/ubuntu xenial main" |\ - tee /etc/apt/sources.list.d/mono-official.list - -# This will do: -# * Accept the repository key -# * Get the current package inventory state -# * Install given packages only with required dependencies -# * Cleanup to reduce Docker image size -RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF &&\ - apt-get update &&\ - apt-get -y --no-install-recommends install libcurl3 tzdata unzip curl git-all mono-complete &&\ - apt-get -yqq clean &&\ - rm -rf /var/lib/apt/lists/* /tmp/* diff --git a/src/Docker/Mono/DockerBase/readme b/src/Docker/Mono/DockerBase/readme deleted file mode 100644 index a4c2d0b2ff..0000000000 --- a/src/Docker/Mono/DockerBase/readme +++ /dev/null @@ -1,6 +0,0 @@ -# Docker Base -We need a custom docker base image because mono is too old to support libgit2sharp - -## To build/publish -docker build . --tag gittools/libgit2sharp-mono -docker push gittools/libgit2sharp-mono \ No newline at end of file diff --git a/src/Docker/Mono/Dockerfile b/src/Docker/Mono/Dockerfile deleted file mode 100644 index e765eb0be8..0000000000 --- a/src/Docker/Mono/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -FROM gittools/libgit2sharp-mono - -MAINTAINER GitTools Maintainers -ARG contentFolder - -# Copy GitVersion -COPY $contentFolder /usr/lib/GitVersion/ -WORKDIR /usr/lib/GitVersion/ - -# Libgit2 can't resolve relative paths, patch to absolute path -RUN sed -i 's|lib/linux/x86_64|/usr/lib/GitVersion/lib/linux/x86_64|g' /usr/lib/GitVersion/LibGit2Sharp.dll.config - -RUN mkdir /repo -VOLUME /repo - -ENTRYPOINT ["mono", "./GitVersion.exe", "/repo"] diff --git a/src/Docker/Readme.md b/src/Docker/Readme.md new file mode 100644 index 0000000000..de4490b411 --- /dev/null +++ b/src/Docker/Readme.md @@ -0,0 +1,16 @@ +There are 4 variants of docker image : + +- based on **microsoft/dotnet-framework:4.7.2-runtime** - Windows Full FX +- based on **microsoft/dotnet:2.1-runtime** - Windows dotnet core +- based on **microsoft/dotnet-framework:4.7.2-runtime** - linux Full FX - on mono +- based on **microsoft/dotnet:2.1-runtime** - linux dotnet core + +To run on windows container run this +`docker run --rm -v "$(pwd):c:/repo" gittools/gitversion-fullfx:windows-4.0.0 c:/repo` + +`docker run --rm -v "$(pwd):c:/repo" gittools/gitversion-dotnetcore:windows-4.0.0 c:/repo` + +To run on linux container run this +`docker run --rm -v "$(pwd):/repo" gittools/gitversion-fullfx:linux-4.0.0 /repo` + +`docker run --rm -v "$(pwd):/repo" gittools/gitversion-dotnetcore:linux-4.0.0 /repo` diff --git a/src/Docker/linux/dotnetcore/Dockerfile b/src/Docker/linux/dotnetcore/Dockerfile new file mode 100644 index 0000000000..8e68835390 --- /dev/null +++ b/src/Docker/linux/dotnetcore/Dockerfile @@ -0,0 +1,12 @@ +FROM microsoft/dotnet:2.1-runtime +LABEL maintainers="GitTools Maintainers" +ARG contentFolder + +RUN apt-get update && \ + apt-get install -y libgit2-dev && \ + ln -s /usr/lib/x86_64-linux-gnu/libgit2.so /lib/x86_64-linux-gnu/libgit2-15e1193.so + +WORKDIR /app +COPY $contentFolder/ ./ + +ENTRYPOINT ["dotnet", "GitVersion.dll"] diff --git a/src/Docker/linux/fullfx/Dockerfile b/src/Docker/linux/fullfx/Dockerfile new file mode 100644 index 0000000000..a09e6dd8a8 --- /dev/null +++ b/src/Docker/linux/fullfx/Dockerfile @@ -0,0 +1,12 @@ +FROM mono +LABEL maintainers="GitTools Maintainers" +ARG contentFolder + +RUN apt-get update && \ + apt-get install -y libgit2-dev && \ + ln -s /usr/lib/x86_64-linux-gnu/libgit2.so /lib/x86_64-linux-gnu/libgit2-15e1193.so + +WORKDIR /app +COPY $contentFolder/ ./ + +ENTRYPOINT ["mono", "GitVersion.exe"] diff --git a/src/Docker/windows/dotnetcore/Dockerfile b/src/Docker/windows/dotnetcore/Dockerfile new file mode 100644 index 0000000000..5722953251 --- /dev/null +++ b/src/Docker/windows/dotnetcore/Dockerfile @@ -0,0 +1,8 @@ +FROM microsoft/dotnet:2.1-runtime +LABEL maintainers="GitTools Maintainers" +ARG contentFolder + +WORKDIR /app +COPY $contentFolder/ ./ + +ENTRYPOINT ["dotnet", "GitVersion.dll"] diff --git a/src/Docker/windows/fullfx/Dockerfile b/src/Docker/windows/fullfx/Dockerfile new file mode 100644 index 0000000000..2099bfd8ff --- /dev/null +++ b/src/Docker/windows/fullfx/Dockerfile @@ -0,0 +1,8 @@ +FROM microsoft/dotnet-framework:4.7.2-runtime +LABEL maintainers="GitTools Maintainers" +ARG contentFolder + +WORKDIR /app +COPY $contentFolder/ ./ + +ENTRYPOINT ["GitVersion.exe"] diff --git a/src/GitVersionExe/GemAssets/gitversion.gemspec b/src/GitVersionExe/GemAssets/gitversion.gemspec deleted file mode 100644 index 1687ecca43..0000000000 --- a/src/GitVersionExe/GemAssets/gitversion.gemspec +++ /dev/null @@ -1,20 +0,0 @@ -Gem::Specification.new do |spec| - spec.platform = Gem::Platform::RUBY - spec.name = 'gitversion' - spec.licenses = ['MIT'] - spec.version = '$version$' - spec.summary = 'Derives SemVer information from a repository following GitFlow or GitHubFlow.' - spec.description = <<-EOF -Derives SemVer information from a repository following GitFlow or GitHubFlow. -EOF - - spec.authors = ['NServiceBus','Simon Cropp'] - spec.email = 'info@nservicebus.com' - spec.homepage = 'http://github.com/Particular/GitVersion' - spec.rubyforge_project = 'GitVersion' - - spec.files = Dir['bin/**/*', 'lib/**/*', '*.gemspec'].reject { |f| File.directory?(f) } - spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }.reject { |f| f =~ /\.(exe|pdb|dll)$/} - spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) - spec.require_paths = ['lib'] -end diff --git a/src/GitVersionExe/GitVersionExe.csproj b/src/GitVersionExe/GitVersionExe.csproj index 96ad53b903..453b915918 100644 --- a/src/GitVersionExe/GitVersionExe.csproj +++ b/src/GitVersionExe/GitVersionExe.csproj @@ -6,9 +6,9 @@ Exe GitVersion GitVersion - net40;netcoreapp20 + net40;netcoreapp2.0 $(SolutionDir)..\build\ - + false false false @@ -16,14 +16,14 @@ false true - + true full false bin\Debug\ DEBUG;TRACE - + bin\Debug\GitVersion.xml 1591 @@ -32,7 +32,7 @@ true bin\Release\ TRACE - + bin\Release\GitVersion.xml 1591 AnyCPU @@ -41,12 +41,12 @@ NET40;NETDESKTOP - - - + + + - - + + @@ -79,13 +79,13 @@ - - - + + + - + - + @@ -124,7 +124,7 @@ - + @@ -167,5 +167,5 @@ - - \ No newline at end of file + + diff --git a/src/GitVersionExe/GemAssets/.gitignore b/src/GitVersionRubyGem/.gitignore similarity index 100% rename from src/GitVersionExe/GemAssets/.gitignore rename to src/GitVersionRubyGem/.gitignore diff --git a/src/GitVersionExe/GemAssets/.rspec b/src/GitVersionRubyGem/.rspec similarity index 100% rename from src/GitVersionExe/GemAssets/.rspec rename to src/GitVersionRubyGem/.rspec diff --git a/src/GitVersionExe/GemAssets/Gemfile b/src/GitVersionRubyGem/Gemfile similarity index 100% rename from src/GitVersionExe/GemAssets/Gemfile rename to src/GitVersionRubyGem/Gemfile diff --git a/src/GitVersionExe/GemAssets/Guardfile b/src/GitVersionRubyGem/Guardfile similarity index 100% rename from src/GitVersionExe/GemAssets/Guardfile rename to src/GitVersionRubyGem/Guardfile diff --git a/src/GitVersionExe/GemAssets/bin/gitversion b/src/GitVersionRubyGem/bin/gitversion similarity index 100% rename from src/GitVersionExe/GemAssets/bin/gitversion rename to src/GitVersionRubyGem/bin/gitversion diff --git a/src/GitVersionRubyGem/credentials b/src/GitVersionRubyGem/credentials new file mode 100644 index 0000000000..902154e301 --- /dev/null +++ b/src/GitVersionRubyGem/credentials @@ -0,0 +1,2 @@ +--- +:rubygems_api_key: $api_key$ diff --git a/src/GitVersionRubyGem/gitversion.gemspec b/src/GitVersionRubyGem/gitversion.gemspec new file mode 100644 index 0000000000..3f79d9260d --- /dev/null +++ b/src/GitVersionRubyGem/gitversion.gemspec @@ -0,0 +1,18 @@ +Gem::Specification.new do |spec| + spec.platform = Gem::Platform::RUBY + spec.name = 'gitversion' + spec.licenses = ['MIT'] + spec.version = '$version$' + spec.summary = 'Easy Semantic Versioning (http://semver.org) for projects using Git' + spec.description = <<-EOF + Versioning when using git, solved. GitVersion looks at your git history and works out the semantic version of the commit being built. + EOF + + spec.authors = ['GitTools and Contributors'] + spec.homepage = 'https://github.com/GitTools/GitVersion' + + spec.files = Dir['bin/**/*', 'lib/**/*', '*.gemspec'].reject { |f| File.directory?(f) } + spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }.reject { |f| f =~ /\.(exe|pdb|dll|so|dylib)$/} + spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) + spec.require_paths = ['lib'] + end diff --git a/src/GitVersionExe/GemAssets/lib/git_version.rb b/src/GitVersionRubyGem/lib/git_version.rb similarity index 100% rename from src/GitVersionExe/GemAssets/lib/git_version.rb rename to src/GitVersionRubyGem/lib/git_version.rb diff --git a/src/GitVersionExe/GemAssets/lib/git_version/parser.rb b/src/GitVersionRubyGem/lib/git_version/parser.rb similarity index 100% rename from src/GitVersionExe/GemAssets/lib/git_version/parser.rb rename to src/GitVersionRubyGem/lib/git_version/parser.rb diff --git a/src/GitVersionExe/GemAssets/spec/lib/git_version/parser_spec.rb b/src/GitVersionRubyGem/spec/lib/git_version/parser_spec.rb similarity index 100% rename from src/GitVersionExe/GemAssets/spec/lib/git_version/parser_spec.rb rename to src/GitVersionRubyGem/spec/lib/git_version/parser_spec.rb diff --git a/src/GitVersionExe/GemAssets/spec/lib/git_version_spec.rb b/src/GitVersionRubyGem/spec/lib/git_version_spec.rb similarity index 100% rename from src/GitVersionExe/GemAssets/spec/lib/git_version_spec.rb rename to src/GitVersionRubyGem/spec/lib/git_version_spec.rb diff --git a/src/GitVersionExe/GemAssets/spec/spec_helper.rb b/src/GitVersionRubyGem/spec/spec_helper.rb similarity index 100% rename from src/GitVersionExe/GemAssets/spec/spec_helper.rb rename to src/GitVersionRubyGem/spec/spec_helper.rb diff --git a/src/GitVersionTfsTask/GitVersion.ts b/src/GitVersionTfsTask/GitVersion.ts index bd5b129df5..f24c2387c4 100644 --- a/src/GitVersionTfsTask/GitVersion.ts +++ b/src/GitVersionTfsTask/GitVersion.ts @@ -12,7 +12,7 @@ var preferBundledVersion = tl.getBoolInput('preferBundledVersion'); var currentDirectory = __dirname; -var sourcesDirectory = tl.getVariable("Build.SourcesDirectory") +var sourcesDirectory = tl.getVariable("Build.SourcesDirectory") || "."; if (!gitVersionPath) { gitVersionPath = tl.which("GitVersion.exe"); diff --git a/src/GitVersionTfsTask/build-task.png b/src/GitVersionTfsTask/img/build-task.png similarity index 100% rename from src/GitVersionTfsTask/build-task.png rename to src/GitVersionTfsTask/img/build-task.png diff --git a/src/GitVersionTfsTask/builds.png b/src/GitVersionTfsTask/img/builds.png similarity index 100% rename from src/GitVersionTfsTask/builds.png rename to src/GitVersionTfsTask/img/builds.png diff --git a/src/GitVersionTfsTask/manifest.json b/src/GitVersionTfsTask/manifest.json index 719be4aecd..06152f9813 100644 --- a/src/GitVersionTfsTask/manifest.json +++ b/src/GitVersionTfsTask/manifest.json @@ -7,21 +7,23 @@ "author": "GitVersion Contributors", "version": "$version$", "description": "Build task for easy semantic versioning for projects using Git.", - "targets": [ + "targets": [{ + "id": "Microsoft.VisualStudio.Services" + }], + "files": [{ + "path": "GitVersion.exe" + }, { - "id": "Microsoft.VisualStudio.Services" - } - ], - "files": [ + "path": "LibGit2Sharp.dll.config" + }, { - "path": "GitVersionTask" + "path": "lib" } ], "categories": [ "Build and release" ], - "icons": - { + "icons": { "default": "extension-icon.png" }, "tags": [ @@ -45,8 +47,7 @@ "uri": "https://github.com/GitTools/GitVersion/issues" } }, - "screenshots": [ - { + "screenshots": [{ "path": "img/builds.png" }, { @@ -58,16 +59,14 @@ "path": "overview.md" } }, - "contributions": [ - { - "id": "gitversion-task", - "type": "ms.vss-distributed-task.task", - "targets": [ - "ms.vss-distributed-task.tasks" - ], - "properties": { - "name": "GitVersionTask" - } + "contributions": [{ + "id": "gitversion-task", + "type": "ms.vss-distributed-task.task", + "targets": [ + "ms.vss-distributed-task.tasks" + ], + "properties": { + "name": "GitVersionTask" } - ] -} + }] +} \ No newline at end of file diff --git a/src/GitVersionTfsTask/package-lock.json b/src/GitVersionTfsTask/package-lock.json new file mode 100644 index 0000000000..fca3211cf2 --- /dev/null +++ b/src/GitVersionTfsTask/package-lock.json @@ -0,0 +1,1492 @@ +{ + "name": "gitversion", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", + "dev": true + }, + "@types/node": { + "version": "10.11.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.11.0.tgz", + "integrity": "sha512-R4Dvw6KjSYn/SpvjRchBOwXr14vVVcFXCtnM3f0aLvlJS8a599rrcEoihcP2/+Z/f75E5GNPd4aWM7j1yei9og==", + "dev": true + }, + "@types/q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.1.tgz", + "integrity": "sha512-eqz8c/0kwNi/OEHQfvIuJVLTst3in0e7uTKeuY+WL/zfKn0xVujOTp42bS/vUUokhK5P2BppLd9JXMOMHcgbjA==", + "dev": true + }, + "app-root-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-1.0.0.tgz", + "integrity": "sha1-LHKZF0vGHLhv46SnmOAeSTt9U30=", + "dev": true + }, + "arch": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/arch/-/arch-2.1.1.tgz", + "integrity": "sha512-BLM56aPo9vLLFVa8+/+pJLnrZ7QGGTVHWsCwieAWT9o9K8UeGaQbzZbGoabWLOo2ksBCztoXdqBZBplqLDDCSg==", + "dev": true + }, + "archiver": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/archiver/-/archiver-2.0.3.tgz", + "integrity": "sha1-tDYLtYSvFDeZGUJxbyHXxSPR270=", + "dev": true, + "requires": { + "archiver-utils": "^1.3.0", + "async": "^2.0.0", + "buffer-crc32": "^0.2.1", + "glob": "^7.0.0", + "lodash": "^4.8.0", + "readable-stream": "^2.0.0", + "tar-stream": "^1.5.0", + "walkdir": "^0.0.11", + "zip-stream": "^1.2.0" + }, + "dependencies": { + "async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "dev": true, + "requires": { + "lodash": "^4.17.10" + } + } + } + }, + "archiver-utils": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-1.3.0.tgz", + "integrity": "sha1-5QtMCccL89aA4y/xt5lOn52JUXQ=", + "dev": true, + "requires": { + "glob": "^7.0.0", + "graceful-fs": "^4.1.0", + "lazystream": "^1.0.0", + "lodash": "^4.8.0", + "normalize-path": "^2.0.0", + "readable-stream": "^2.0.0" + } + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "base64-js": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", + "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==", + "dev": true + }, + "bl": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", + "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", + "dev": true, + "requires": { + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", + "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", + "dev": true, + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" + } + }, + "buffer-alloc": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", + "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", + "dev": true, + "requires": { + "buffer-alloc-unsafe": "^1.1.0", + "buffer-fill": "^1.0.0" + } + }, + "buffer-alloc-unsafe": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", + "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", + "dev": true + }, + "buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", + "dev": true + }, + "buffer-fill": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", + "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=", + "dev": true + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "camelcase-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", + "dev": true, + "requires": { + "camelcase": "^4.1.0", + "map-obj": "^2.0.0", + "quick-lru": "^1.0.0" + } + }, + "clipboardy": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/clipboardy/-/clipboardy-1.2.3.tgz", + "integrity": "sha512-2WNImOvCRe6r63Gk9pShfkwXsVtKCroMAevIbiae021mS850UkWPbevxsBz3tnvjZIEGvlwaqCPsw+4ulzNgJA==", + "dev": true, + "requires": { + "arch": "^2.1.0", + "execa": "^0.8.0" + } + }, + "colors": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.3.2.tgz", + "integrity": "sha512-rhP0JSBGYvpcNQj4s5AdShMeE5ahMop96cTeDl/v9qQQm2fYClE2QXZRi8wLzc+GmXSxdIqqbOIAhyObEXDbfQ==", + "dev": true + }, + "compress-commons": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-1.2.2.tgz", + "integrity": "sha1-UkqfEJA/OoEzibAiXSfEi7dRiQ8=", + "dev": true, + "requires": { + "buffer-crc32": "^0.2.1", + "crc32-stream": "^2.0.0", + "normalize-path": "^2.0.0", + "readable-stream": "^2.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "core-js": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.3.0.tgz", + "integrity": "sha1-+rg/uwstjchfpjbEudNMdUIMbWU=", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "crc": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/crc/-/crc-3.8.0.tgz", + "integrity": "sha512-iX3mfgcTMIq3ZKLIsVFAbv7+Mc10kxabAGQb8HvjA1o3T1PIYprbakQ65d3I+2HGHt6nSKkM9PYjgoJO2KcFBQ==", + "dev": true, + "requires": { + "buffer": "^5.1.0" + } + }, + "crc32-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-2.0.0.tgz", + "integrity": "sha1-483TtN8xaN10494/u8t7KX/pCPQ=", + "dev": true, + "requires": { + "crc": "^3.4.4", + "readable-stream": "^2.0.0" + } + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "^1.0.1" + } + }, + "cycle": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", + "integrity": "sha1-IegLK+hYD5i0aPN5QwZisEbDStI=", + "dev": true + }, + "dateformat": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.11.tgz", + "integrity": "sha1-8ny+56ASu/uC6gUVYtOXf2CT27E=", + "dev": true, + "requires": { + "get-stdin": "*", + "meow": "*" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decamelize-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", + "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "dev": true, + "requires": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "dependencies": { + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + } + } + }, + "deep-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", + "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", + "dev": true + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", + "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", + "dev": true, + "requires": { + "es-to-primitive": "^1.1.1", + "function-bind": "^1.1.1", + "has": "^1.0.1", + "is-callable": "^1.1.3", + "is-regex": "^1.0.4" + } + }, + "es-to-primitive": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", + "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "es6-promise": { + "version": "3.0.2", + "resolved": "http://registry.npmjs.org/es6-promise/-/es6-promise-3.0.2.tgz", + "integrity": "sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y=", + "dev": true + }, + "execa": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.8.0.tgz", + "integrity": "sha1-2NdrvBtVIX7RkP1t1J08d07PyNo=", + "dev": true, + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "eyes": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", + "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=", + "dev": true + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "dev": true + }, + "hosted-git-info": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", + "dev": true + }, + "i": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/i/-/i-0.3.6.tgz", + "integrity": "sha1-2WyScyB28HJxG2sQ/X1PZa2O4j0=", + "dev": true + }, + "ieee754": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz", + "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==", + "dev": true + }, + "immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=", + "dev": true + }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true, + "requires": { + "builtin-modules": "^1.0.0" + } + }, + "is-callable": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "dev": true + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "^1.0.1" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-symbol": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", + "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "json-in-place": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-in-place/-/json-in-place-1.0.1.tgz", + "integrity": "sha1-ih7NJaac4ZAFUs1xUr2TdU3k4fA=", + "dev": true, + "requires": { + "json-lexer": "1.1.1" + } + }, + "json-lexer": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/json-lexer/-/json-lexer-1.1.1.tgz", + "integrity": "sha1-vT7V1+Vgudma0iNPKMpwb7N3t9Q=", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "jszip": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.1.5.tgz", + "integrity": "sha512-5W8NUaFRFRqTOL7ZDDrx5qWHJyBXy6velVudIzQUSoqAAYqzSh2Z7/m0Rf1QbmQJccegD0r+YZxBjzqoBiEeJQ==", + "dev": true, + "requires": { + "core-js": "~2.3.0", + "es6-promise": "~3.0.2", + "lie": "~3.1.0", + "pako": "~1.0.2", + "readable-stream": "~2.0.6" + }, + "dependencies": { + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "dev": true + }, + "readable-stream": { + "version": "2.0.6", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "string_decoder": "~0.10.x", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "lazystream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", + "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=", + "dev": true, + "requires": { + "readable-stream": "^2.0.5" + } + }, + "lie": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz", + "integrity": "sha1-mkNrLMd0bKWd56QfpGmz77dr2H4=", + "dev": true, + "requires": { + "immediate": "~3.0.5" + } + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" + } + }, + "lru-cache": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", + "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "map-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", + "dev": true + }, + "meow": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-5.0.0.tgz", + "integrity": "sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig==", + "dev": true, + "requires": { + "camelcase-keys": "^4.0.0", + "decamelize-keys": "^1.0.0", + "loud-rejection": "^1.0.0", + "minimist-options": "^3.0.1", + "normalize-package-data": "^2.3.4", + "read-pkg-up": "^3.0.0", + "redent": "^2.0.0", + "trim-newlines": "^2.0.0", + "yargs-parser": "^10.0.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "minimist-options": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", + "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0" + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } + } + }, + "mockery": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/mockery/-/mockery-1.7.0.tgz", + "integrity": "sha1-9O3g2HUMHJcnwnLqLGBiniyaHE8=" + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "ncp": { + "version": "0.4.2", + "resolved": "http://registry.npmjs.org/ncp/-/ncp-0.4.2.tgz", + "integrity": "sha1-q8xsvT7C7Spyn/bnwfqPAXhKhXQ=", + "dev": true + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "object-keys": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", + "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", + "dev": true + }, + "object.getownpropertydescriptors": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", + "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.5.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "onecolor": { + "version": "2.5.0", + "resolved": "http://registry.npmjs.org/onecolor/-/onecolor-2.5.0.tgz", + "integrity": "sha1-Ila2UdyAfBAfAK7b1JklxXpEMcE=", + "dev": true + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "pako": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz", + "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==", + "dev": true + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "pkginfo": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.4.1.tgz", + "integrity": "sha1-tUGO8EOd5UJfxJlQQtztFPsqhP8=", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, + "prompt": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/prompt/-/prompt-0.2.14.tgz", + "integrity": "sha1-V3VPZPVD/XsIRXB8gY7OYY8F/9w=", + "dev": true, + "requires": { + "pkginfo": "0.x.x", + "read": "1.0.x", + "revalidator": "0.1.x", + "utile": "0.2.x", + "winston": "0.8.x" + } + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" + }, + "quick-lru": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", + "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", + "dev": true + }, + "read": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", + "integrity": "sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ=", + "dev": true, + "requires": { + "mute-stream": "~0.0.4" + } + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "redent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", + "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", + "dev": true, + "requires": { + "indent-string": "^3.0.0", + "strip-indent": "^2.0.0" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "revalidator": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/revalidator/-/revalidator-0.1.8.tgz", + "integrity": "sha1-/s5hv6DBtSoga9axgZgYS91SOjs=", + "dev": true + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "^7.0.5" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true + }, + "semver": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz", + "integrity": "sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw==" + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "shelljs": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz", + "integrity": "sha1-NZbmMHp4FUT1kfN9phg2DzHbV7E=" + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "spdx-correct": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.1.tgz", + "integrity": "sha512-hxSPZbRZvSDuOvADntOElzJpenIR7wXJkuoUcUtS0erbgt2fgeaoPIYretfKpslMhfFDY4k0MZ2F5CUzhBsSvQ==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", + "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.1.tgz", + "integrity": "sha512-TfOfPcYGBB5sDuPn3deByxPhmfegAhpDYKSOXZQN81Oyrrif8ZCodOLzK3AesELnCx03kikhyDwh0pfvvQvF8w==", + "dev": true + }, + "stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "strip-indent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", + "dev": true + }, + "tar-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", + "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", + "dev": true, + "requires": { + "bl": "^1.0.0", + "buffer-alloc": "^1.2.0", + "end-of-stream": "^1.0.0", + "fs-constants": "^1.0.0", + "readable-stream": "^2.3.0", + "to-buffer": "^1.1.1", + "xtend": "^4.0.0" + } + }, + "tfx-cli": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/tfx-cli/-/tfx-cli-0.6.3.tgz", + "integrity": "sha512-58sLayoikjA2jXrnv9pYsbkkLEwaips9qS6r+sPulVUywiom5PFnaNVRkD7bPSBIxZt1nwa/NbITVTZIzLvtRw==", + "dev": true, + "requires": { + "app-root-path": "1.0.0", + "archiver": "2.0.3", + "async": "^1.4.0", + "clipboardy": "~1.2.3", + "colors": "~1.3.0", + "glob": "7.1.2", + "json-in-place": "^1.0.1", + "jszip": "~3.1.5", + "lodash": "~4.17.0", + "minimist": "^1.1.2", + "mkdirp": "^0.5.1", + "onecolor": "^2.5.0", + "os-homedir": "^1.0.1", + "prompt": "^0.2.14", + "read": "^1.0.6", + "shelljs": "^0.5.1", + "tmp": "0.0.26", + "tracer": "0.7.4", + "util.promisify": "^1.0.0", + "uuid": "^3.0.1", + "validator": "^3.43.0", + "vso-node-api": "^5.0.0", + "winreg": "0.0.12", + "xml2js": "^0.4.16" + }, + "dependencies": { + "shelljs": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.5.3.tgz", + "integrity": "sha1-xUmCuZbHbvDB5rWfvcWCX1txMRM=", + "dev": true + } + } + }, + "tinytim": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/tinytim/-/tinytim-0.1.1.tgz", + "integrity": "sha1-yWih5VWa2VUyJO92J7qzTjyu+Kg=", + "dev": true + }, + "tmp": { + "version": "0.0.26", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.26.tgz", + "integrity": "sha1-nvqCDOKhD4H4l5VVus4/FVJs4fI=", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.0" + } + }, + "to-buffer": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz", + "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==", + "dev": true + }, + "tracer": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/tracer/-/tracer-0.7.4.tgz", + "integrity": "sha1-d/oEN8+Ct2vNvNRLhHRHcuWeUlk=", + "dev": true, + "requires": { + "colors": "1.0.3", + "dateformat": "1.0.11", + "tinytim": "0.1.1" + }, + "dependencies": { + "colors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", + "dev": true + } + } + }, + "trim-newlines": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", + "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", + "dev": true + }, + "tunnel": { + "version": "0.0.4", + "resolved": "http://registry.npmjs.org/tunnel/-/tunnel-0.0.4.tgz", + "integrity": "sha1-LTeFoVjBdMmhbcLARuxfxfF0IhM=", + "dev": true + }, + "typescript": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.0.3.tgz", + "integrity": "sha512-kk80vLW9iGtjMnIv11qyxLqZm20UklzuR2tL0QAnDIygIUIemcZMxlMWudl9OOt76H3ntVzcTiddQ1/pAAJMYg==", + "dev": true + }, + "underscore": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", + "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "util.promisify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz", + "integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "object.getownpropertydescriptors": "^2.0.3" + } + }, + "utile": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/utile/-/utile-0.2.1.tgz", + "integrity": "sha1-kwyI6ZCY1iIINMNWy9mncFItkNc=", + "dev": true, + "requires": { + "async": "~0.2.9", + "deep-equal": "*", + "i": "0.3.x", + "mkdirp": "0.x.x", + "ncp": "0.4.x", + "rimraf": "2.x.x" + }, + "dependencies": { + "async": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", + "dev": true + } + } + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "validator": { + "version": "3.43.0", + "resolved": "http://registry.npmjs.org/validator/-/validator-3.43.0.tgz", + "integrity": "sha1-lkZLmS1BloM9l6GUv0Cxn/VLrgU=", + "dev": true + }, + "vso-node-api": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/vso-node-api/-/vso-node-api-5.1.2.tgz", + "integrity": "sha1-gXtm/+1uEcvXH5O5FvSxicljQls=", + "dev": true, + "requires": { + "q": "^1.0.1", + "tunnel": "0.0.4", + "underscore": "^1.8.3" + } + }, + "vsts-task-lib": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/vsts-task-lib/-/vsts-task-lib-2.6.1.tgz", + "integrity": "sha512-/UAmGzJjEbzky6J8nhvEBTuSnGN+2wXkODJZ65fLAObhIr0aDc1NcxGXv/iNDy0AyPOowwhj1wO0VGHNP/3Xmw==", + "requires": { + "minimatch": "3.0.4", + "mockery": "^1.7.0", + "q": "^1.1.2", + "semver": "^5.1.0", + "shelljs": "^0.3.0", + "uuid": "^3.0.1" + } + }, + "walkdir": { + "version": "0.0.11", + "resolved": "https://registry.npmjs.org/walkdir/-/walkdir-0.0.11.tgz", + "integrity": "sha1-oW0CXrkxvQO1LzCMrtD0D86+lTI=", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "winreg": { + "version": "0.0.12", + "resolved": "https://registry.npmjs.org/winreg/-/winreg-0.0.12.tgz", + "integrity": "sha1-BxBVVLoanQiXklHRKUdb/64wBrc=", + "dev": true + }, + "winston": { + "version": "0.8.3", + "resolved": "http://registry.npmjs.org/winston/-/winston-0.8.3.tgz", + "integrity": "sha1-ZLar9M0Brcrv1QCTk7HY6L7BnbA=", + "dev": true, + "requires": { + "async": "0.2.x", + "colors": "0.6.x", + "cycle": "1.0.x", + "eyes": "0.1.x", + "isstream": "0.1.x", + "pkginfo": "0.3.x", + "stack-trace": "0.0.x" + }, + "dependencies": { + "async": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", + "dev": true + }, + "colors": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", + "integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w=", + "dev": true + }, + "pkginfo": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.3.1.tgz", + "integrity": "sha1-Wyn2qB9wcXFC4J52W76rl7T4HiE=", + "dev": true + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "xml2js": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz", + "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==", + "dev": true, + "requires": { + "sax": ">=0.6.0", + "xmlbuilder": "~9.0.1" + } + }, + "xmlbuilder": { + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", + "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=", + "dev": true + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + }, + "yargs-parser": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", + "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", + "dev": true, + "requires": { + "camelcase": "^4.1.0" + } + }, + "zip-stream": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-1.2.0.tgz", + "integrity": "sha1-qLxF9MG0lpnGuQGYuqyqzbzUugQ=", + "dev": true, + "requires": { + "archiver-utils": "^1.3.0", + "compress-commons": "^1.2.0", + "lodash": "^4.8.0", + "readable-stream": "^2.0.0" + } + } + } +} diff --git a/src/GitVersionTfsTask/package.json b/src/GitVersionTfsTask/package.json index 7112dbaa55..2a76dd257f 100644 --- a/src/GitVersionTfsTask/package.json +++ b/src/GitVersionTfsTask/package.json @@ -1,22 +1,25 @@ { - "name": "gitversion", - "version": "1.0.0", - "private": true, - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "MIT", - "dependencies": { - "vsts-task-lib": "1.1.0", - "q": "1.4.1" - }, - "devDependencies": { - "@types/minimatch": "^2.0.29", - "@types/node": "^7.0.5", - "@types/q": "0.0.32", - "typescript": "^2.3.2" - } + "name": "gitversion", + "version": "1.0.0", + "private": true, + "description": "", + "main": "index.js", + "scripts": { + "build": "tsc", + "test": "echo \"Error: no test specified\" && exit 1", + "package": "tfx extension create --manifest-globs manifest.json" + }, + "author": "", + "license": "MIT", + "dependencies": { + "q": "1.5.1", + "vsts-task-lib": "2.6.1" + }, + "devDependencies": { + "@types/minimatch": "3.0.3", + "@types/node": "10.11.0", + "@types/q": "1.5.1", + "tfx-cli": "^0.6.1", + "typescript": "^3.0.3" + } } diff --git a/src/GitVersionTfsTask/task.json b/src/GitVersionTfsTask/task.json index 58f8c6b6b4..120cbab0b7 100644 --- a/src/GitVersionTfsTask/task.json +++ b/src/GitVersionTfsTask/task.json @@ -1,76 +1,76 @@ { - "id": "e5983830-3f75-11e5-82ed-81492570a08e", - "name": "GitVersion", - "friendlyName": "GitVersion Task", - "description": "Easy Semantic Versioning (http://semver.org) for projects using Git", - "author": "GitVersion Contributors", - "helpMarkDown": "See the [documentation](http://gitversion.readthedocs.org/en/latest/) for help", - "category": "Build", - "demands": [ ], - "version": { - "Major": "0", - "Minor": "0", - "Patch": "0" + "id": "e5983830-3f75-11e5-82ed-81492570a08e", + "name": "GitVersion", + "friendlyName": "GitVersion Task", + "description": "Easy Semantic Versioning (http://semver.org) for projects using Git", + "author": "GitVersion Contributors", + "helpMarkDown": "See the [documentation](http://gitversion.readthedocs.org/en/latest/) for help", + "category": "Build", + "demands": [], + "version": { + "Major": "4", + "Minor": "0", + "Patch": "0" + }, + "minimumAgentVersion": "1.83.0", + "groups": [ + { + "name": "additional", + "displayName": "Additional Options", + "isExpanded": false + } + ], + "instanceNameFormat": "GitVersion", + "inputs": [ + { + "name": "updateAssemblyInfo", + "type": "boolean", + "label": "Update AssemblyInfo files", + "defaultValue": "false", + "required": false, + "helpMarkDown": "Whether to update versions in the AssemblyInfo files" + }, + { + "name": "updateAssemblyInfoFilename", + "type": "string", + "label": "Update Assembly File", + "defaultValue": "", + "required": false, + "helpMarkDown": "Update versions in specified file", + "groupName": "additional" + }, + { + "name": "additionalArguments", + "type": "string", + "label": "Additional GitVersion.exe arguments", + "defaultValue": "", + "required": false, + "helpMarkDown": "Additional arguments to send to GitVersion.exe", + "groupName": "additional" }, - "minimumAgentVersion": "1.83.0", - "groups": [ - { - "name": "additional", - "displayName": "Additional Options", - "isExpanded": false - } - ], - "instanceNameFormat": "GitVersion", - "inputs": [ - { - "name": "updateAssemblyInfo", - "type": "boolean", - "label": "Update AssemblyInfo files", - "defaultValue": "false", - "required": false, - "helpMarkDown": "Whether to update versions in the AssemblyInfo files" - }, - { - "name": "updateAssemblyInfoFilename", - "type": "string", - "label": "Update Assembly File", - "defaultValue": "", - "required": false, - "helpMarkDown": "Update versions in specified file", - "groupName": "additional" - }, - { - "name": "additionalArguments", - "type": "string", - "label": "Additional GitVersion.exe arguments", - "defaultValue": "", - "required": false, - "helpMarkDown": "Additional arguments to send to GitVersion.exe", - "groupName": "additional" - }, - { - "name": "gitVersionPath", - "type": "string", - "label": "Path to GitVersion.exe", - "defaultValue": "", - "required": false, - "helpMarkDown": "Optionally supply the path to GitVersion.exe", - "groupName": "additional" - }, - { - "name": "preferBundledVersion", - "type": "boolean", - "label": "Prefer bundled GiVersion.exe", - "required": false, - "helpMarkDown": "If checked it will prefer the bundled version over a version found in path", - "groupName": "additional" - } - ], - "execution": { - "Node": { - "target": "GitVersion.js", - "argumentFormat": "", - "workingDirectory": "" - } + { + "name": "gitVersionPath", + "type": "string", + "label": "Path to GitVersion.exe", + "defaultValue": "", + "required": false, + "helpMarkDown": "Optionally supply the path to GitVersion.exe", + "groupName": "additional" + }, + { + "name": "preferBundledVersion", + "type": "boolean", + "label": "Prefer bundled GiVersion.exe", + "required": false, + "helpMarkDown": "If checked it will prefer the bundled version over a version found in path", + "groupName": "additional" + } + ], + "execution": { + "Node": { + "target": "GitVersion.js", + "argumentFormat": "", + "workingDirectory": "." } -} + } +} \ No newline at end of file From e73b7caf4834dc9af6c3908542dd988322263c94 Mon Sep 17 00:00:00 2001 From: Artur Stolear Date: Sun, 30 Sep 2018 16:46:27 +0300 Subject: [PATCH 07/13] trying to fix Pack-Gem --- build/version.cake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/version.cake b/build/version.cake index adac2b7a59..a0eac72514 100644 --- a/build/version.cake +++ b/build/version.cake @@ -24,7 +24,7 @@ public class BuildVersion NuGetVersion = gitVersion.NuGetVersion, DotNetAsterix = semVersion.Substring(version.Length).TrimStart('-'), PreReleaseTag = preReleaseTag, - GemVersion = gemVersion + GemVersion = gemVersion.TrimEnd('.') }; } } From 807f48a35668bb17118e9a4827ddd6e4300bdb4a Mon Sep 17 00:00:00 2001 From: Artur Stolear Date: Tue, 2 Oct 2018 20:04:33 +0300 Subject: [PATCH 08/13] fix chocolatey BinFile name --- nuspec/chocolateyInstall.ps1 | 2 +- nuspec/chocolateyUninstall.ps1 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nuspec/chocolateyInstall.ps1 b/nuspec/chocolateyInstall.ps1 index 6d0d8b6d79..6227375d8b 100644 --- a/nuspec/chocolateyInstall.ps1 +++ b/nuspec/chocolateyInstall.ps1 @@ -1 +1 @@ -Generate-BinFile "gfv" "$packageFolder\Tools\GitVersion.exe" \ No newline at end of file +Generate-BinFile "gv" "$packageFolder\Tools\GitVersion.exe" diff --git a/nuspec/chocolateyUninstall.ps1 b/nuspec/chocolateyUninstall.ps1 index 06198afa27..ddace64230 100644 --- a/nuspec/chocolateyUninstall.ps1 +++ b/nuspec/chocolateyUninstall.ps1 @@ -1,2 +1,2 @@ -Remove-BinFile "gfv" "$packageFolder\Tools\GitVersion.exe" -Remove-BinFile "GitVersion" "$packageFolder\Tools\GitVersion.exe" \ No newline at end of file +Remove-BinFile "gv" "$packageFolder\Tools\GitVersion.exe" +Remove-BinFile "GitVersion" "$packageFolder\Tools\GitVersion.exe" From 5eca89779d6644d81afb80dce515ba952668858f Mon Sep 17 00:00:00 2001 From: Artur Stolear Date: Tue, 2 Oct 2018 20:13:38 +0300 Subject: [PATCH 09/13] cleanup GitVersionExe.csproj --- src/GitVersionExe/GitVersionExe.csproj | 104 ------------------ .../GitVersion.CommandLine.DotNetCore.nuspec | 19 ---- .../NugetAssets/GitVersion.CommandLine.nuspec | 19 ---- .../NugetAssets/GitVersion.Portable.nuspec | 18 --- .../NugetAssets/chocolateyInstall.ps1 | 1 - .../NugetAssets/chocolateyUninstall.ps1 | 2 - 6 files changed, 163 deletions(-) delete mode 100644 src/GitVersionExe/NugetAssets/GitVersion.CommandLine.DotNetCore.nuspec delete mode 100644 src/GitVersionExe/NugetAssets/GitVersion.CommandLine.nuspec delete mode 100644 src/GitVersionExe/NugetAssets/GitVersion.Portable.nuspec delete mode 100644 src/GitVersionExe/NugetAssets/chocolateyInstall.ps1 delete mode 100644 src/GitVersionExe/NugetAssets/chocolateyUninstall.ps1 diff --git a/src/GitVersionExe/GitVersionExe.csproj b/src/GitVersionExe/GitVersionExe.csproj index 453b915918..a9be0afdb3 100644 --- a/src/GitVersionExe/GitVersionExe.csproj +++ b/src/GitVersionExe/GitVersionExe.csproj @@ -59,113 +59,9 @@ - - - - - - - - - - - - Designer - - - Designer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - mono - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(GitVersion_MajorMinorPatch) - $(GitVersion_MajorMinorPatch).$(GitVersion_PreReleaseTag) - - - - - - - diff --git a/src/GitVersionExe/NugetAssets/GitVersion.CommandLine.DotNetCore.nuspec b/src/GitVersionExe/NugetAssets/GitVersion.CommandLine.DotNetCore.nuspec deleted file mode 100644 index bd1bc66925..0000000000 --- a/src/GitVersionExe/NugetAssets/GitVersion.CommandLine.DotNetCore.nuspec +++ /dev/null @@ -1,19 +0,0 @@ - - - - GitVersion.CommandLine.DotNetCore - $version$ - GitVersion.CommandLine.DotNetCore - GitTools and Contributors - GitTools and Contributors - http://www.opensource.org/licenses/mit-license.php - https://github.com/GitTools/GitVersion - https://raw.githubusercontent.com/GitTools/GitVersion/master/docs/img/package_icon.png - false - Derives SemVer information from a repository following GitFlow or GitHubFlow. - en-AU - Git Versioning GitVersion GitFlowVersion GitFlow GitHubFlow SemVer - true - https://github.com/GitTools/GitVersion/releases - - diff --git a/src/GitVersionExe/NugetAssets/GitVersion.CommandLine.nuspec b/src/GitVersionExe/NugetAssets/GitVersion.CommandLine.nuspec deleted file mode 100644 index e511d0a845..0000000000 --- a/src/GitVersionExe/NugetAssets/GitVersion.CommandLine.nuspec +++ /dev/null @@ -1,19 +0,0 @@ - - - - GitVersion.CommandLine - $version$ - GitVersion.CommandLine - GitTools and Contributors - GitTools and Contributors - http://www.opensource.org/licenses/mit-license.php - https://github.com/GitTools/GitVersion - https://raw.githubusercontent.com/GitTools/GitVersion/master/docs/img/package_icon.png - false - Derives SemVer information from a repository following GitFlow or GitHubFlow. - en-AU - Git Versioning GitVersion GitFlowVersion GitFlow GitHubFlow SemVer - true - https://github.com/GitTools/GitVersion/releases - - diff --git a/src/GitVersionExe/NugetAssets/GitVersion.Portable.nuspec b/src/GitVersionExe/NugetAssets/GitVersion.Portable.nuspec deleted file mode 100644 index 31e0a66ddb..0000000000 --- a/src/GitVersionExe/NugetAssets/GitVersion.Portable.nuspec +++ /dev/null @@ -1,18 +0,0 @@ - - - - GitVersion.Portable - $version$ - GitVersion - GitTools and Contributors - GitTools and Contributors - http://www.opensource.org/licenses/mit-license.php - https://github.com/GitTools/GitVersion - https://raw.githubusercontent.com/GitTools/GitVersion/master/docs/img/package_icon.png - false - Derives SemVer information from a repository following GitFlow or GitHubFlow. - en-AU - Git Versioning GitVersion GitFlowVersion GitFlow GitHubFlow SemVer - https://github.com/GitTools/GitVersion/releases - - diff --git a/src/GitVersionExe/NugetAssets/chocolateyInstall.ps1 b/src/GitVersionExe/NugetAssets/chocolateyInstall.ps1 deleted file mode 100644 index 6d0d8b6d79..0000000000 --- a/src/GitVersionExe/NugetAssets/chocolateyInstall.ps1 +++ /dev/null @@ -1 +0,0 @@ -Generate-BinFile "gfv" "$packageFolder\Tools\GitVersion.exe" \ No newline at end of file diff --git a/src/GitVersionExe/NugetAssets/chocolateyUninstall.ps1 b/src/GitVersionExe/NugetAssets/chocolateyUninstall.ps1 deleted file mode 100644 index 06198afa27..0000000000 --- a/src/GitVersionExe/NugetAssets/chocolateyUninstall.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -Remove-BinFile "gfv" "$packageFolder\Tools\GitVersion.exe" -Remove-BinFile "GitVersion" "$packageFolder\Tools\GitVersion.exe" \ No newline at end of file From fd0c83ac80071677bdda2b44860bc2aa8bf5c403 Mon Sep 17 00:00:00 2001 From: Artur Stolear Date: Wed, 3 Oct 2018 21:51:26 +0300 Subject: [PATCH 10/13] IsStableRelease and IsPreRelease should be true only if it's master branch and not PR, reviewed the versioning of artifacts --- build/parameters.cake | 61 ++++++++++++++++-------- build/paths.cake | 6 +-- build/utils.cake | 36 ++++++++++---- build/version.cake | 18 ++++--- run.cake | 76 +++++++++++++++++------------- src/Docker/linux/fullfx/Dockerfile | 2 +- 6 files changed, 126 insertions(+), 73 deletions(-) diff --git a/build/parameters.cake b/build/parameters.cake index c84a367d8b..ef8f0c00c5 100644 --- a/build/parameters.cake +++ b/build/parameters.cake @@ -8,12 +8,13 @@ public class BuildParameters public string Target { get; private set; } public string Configuration { get; private set; } - public bool DisableUnitTests { get; private set; } - public bool DisablePublishGem { get; private set; } - public bool DisablePublishTfs { get; private set; } - public bool DisablePublishNuget { get; private set; } - public bool DisablePublishChocolatey { get; private set; } - public bool DisablePublishDocker { get; private set; } + public bool EnabledUnitTests { get; private set; } + public bool EnabledPublishGem { get; private set; } + public bool EnabledPublishTfs { get; private set; } + public bool EnabledPublishNuget { get; private set; } + public bool EnabledPublishChocolatey { get; private set; } + public bool EnabledPublishDocker { get; private set; } + public bool EnabledPullRequestPublish { get; private set; } public bool IsRunningOnUnix { get; private set; } public bool IsRunningOnWindows { get; private set; } @@ -28,6 +29,7 @@ public class BuildParameters public bool IsMainRepo { get; private set; } public bool IsMainBranch { get; private set; } public bool IsTagged { get; private set; } + public bool IsPullRequest { get; private set; } public BuildCredentials Credentials { get; private set; } public BuildVersion Version { get; private set; } @@ -36,8 +38,8 @@ public class BuildParameters public BuildArtifacts Artifacts { get; private set; } public Dictionary PackagesBuildMap { get; private set; } - public bool IsStableRelease() => !IsLocalBuild && IsMainRepo && IsMainBranch && IsTagged; - public bool IsPreRelease() => !IsLocalBuild && IsMainRepo && IsMainBranch && !IsTagged; + public bool IsStableRelease() => !IsLocalBuild && IsMainRepo && IsMainBranch && !IsPullRequest && IsTagged; + public bool IsPreRelease() => !IsLocalBuild && IsMainRepo && IsMainBranch && !IsPullRequest && !IsTagged; public bool CanPostToGitter => !string.IsNullOrWhiteSpace(Credentials.Gitter.Token) && !string.IsNullOrWhiteSpace(Credentials.Gitter.RoomId); @@ -55,12 +57,13 @@ public class BuildParameters Target = target, Configuration = context.Argument("configuration", "Release"), - DisableUnitTests = IsDisabled(context, "DISABLE_UNIT_TESTS"), - DisablePublishGem = IsDisabled(context, "DISABLE_PUBLISH_GEM"), - DisablePublishTfs = IsDisabled(context, "DISABLE_PUBLISH_TFS"), - DisablePublishNuget = IsDisabled(context, "DISABLE_PUBLISH_NUGET"), - DisablePublishChocolatey = IsDisabled(context, "DISABLE_PUBLISH_CHOCOLATEY"), - DisablePublishDocker = IsDisabled(context, "DISABLE_PUBLISH_DOCKER"), + EnabledUnitTests = IsEnabled(context, "ENABLED_UNIT_TESTS"), + EnabledPublishGem = IsEnabled(context, "ENABLED_PUBLISH_GEM"), + EnabledPublishTfs = IsEnabled(context, "ENABLED_PUBLISH_TFS"), + EnabledPublishNuget = IsEnabled(context, "ENABLED_PUBLISH_NUGET"), + EnabledPublishChocolatey = IsEnabled(context, "ENABLED_PUBLISH_CHOCOLATEY"), + EnabledPublishDocker = IsEnabled(context, "ENABLED_PUBLISH_DOCKER"), + EnabledPullRequestPublish = IsEnabled(context, "ENABLED_PULL_REQUEST_PUBLISH", false), IsRunningOnUnix = context.IsRunningOnUnix(), IsRunningOnWindows = context.IsRunningOnWindows(), @@ -105,9 +108,10 @@ public class BuildParameters Credentials = BuildCredentials.GetCredentials(context); - IsMainRepo = IsOnMainRepo(context); - IsMainBranch = IsOnMainBranch(context); - IsTagged = IsBuildTagged(context, gitVersion); + IsMainRepo = IsOnMainRepo(context); + IsMainBranch = IsOnMainBranch(context); + IsPullRequest = IsPullRequestBuild(context); + IsTagged = IsBuildTagged(context, gitVersion); } private static bool IsOnMainRepo(ICakeContext context) @@ -154,6 +158,25 @@ public class BuildParameters return !string.IsNullOrWhiteSpace(repositoryBranch) && StringComparer.OrdinalIgnoreCase.Equals("master", repositoryBranch); } + private static bool IsPullRequestBuild(ICakeContext context) + { + var buildSystem = context.BuildSystem(); + if (buildSystem.IsRunningOnAppVeyor) + { + return buildSystem.AppVeyor.Environment.PullRequest.IsPullRequest; + } + if (buildSystem.IsRunningOnTravisCI) + { + return !string.IsNullOrWhiteSpace(buildSystem.TravisCI.Environment.Repository.PullRequest) + && !string.Equals(buildSystem.TravisCI.Environment.Repository.PullRequest, false.ToString(), StringComparison.InvariantCultureIgnoreCase); + } + else if (buildSystem.IsRunningOnVSTS) + { + return false; // need a way to check if it is from a PR on azure pipelines + } + return false; + } + private static bool IsBuildTagged(ICakeContext context, GitVersion gitVersion) { var gitPath = context.Tools.Resolve(context.IsRunningOnWindows() ? "git.exe" : "git"); @@ -162,10 +185,10 @@ public class BuildParameters return redirectedOutput.Any(); } - private static bool IsDisabled(ICakeContext context, string envVar) + private static bool IsEnabled(ICakeContext context, string envVar, bool nullOrEmptyAsEnabled = true) { var value = context.EnvironmentVariable(envVar); - return !string.IsNullOrWhiteSpace(value) && bool.Parse(value); + return string.IsNullOrWhiteSpace(value) ? nullOrEmptyAsEnabled : bool.Parse(value); } } diff --git a/build/paths.cake b/build/paths.cake index 9c89c5a5df..62744d6f10 100644 --- a/build/paths.cake +++ b/build/paths.cake @@ -39,10 +39,10 @@ public class BuildPaths var testCoverageOutputFilePath = buildArtifactDir.CombineWithFilePath("TestResult.xml"); var releaseNotesOutputFilePath = buildArtifactDir.CombineWithFilePath("releasenotes.md"); - var vsixOutputFilePath = buildArtifactDir.CombineWithFilePath("gittools.gitversion-" + version.Version + ".vsix"); + var vsixOutputFilePath = buildArtifactDir.CombineWithFilePath("gittools.gitversion-" + semVersion + ".vsix"); - var gemVersion = version.GemVersion.Replace("-", ".pre."); - var gemOutputFilePath = buildArtifactDir.CombineWithFilePath("testgw-" + gemVersion + ".gem"); + var gemVersion = version.SemVersion.Replace("-", ".pre."); + var gemOutputFilePath = buildArtifactDir.CombineWithFilePath("gitversion-" + gemVersion + ".gem"); // Directories var buildDirectories = new BuildDirectories( diff --git a/build/utils.cake b/build/utils.cake index b815a217a1..a9ec19b854 100644 --- a/build/utils.cake +++ b/build/utils.cake @@ -149,9 +149,8 @@ void PublishILRepackedGitVersionExe(bool includeLibGit2Sharp, DirectoryPath targ CopyFileToDirectory("./src/GitVersionExe/bin/" + configuration + "/" + dotnetVersion + "/GitVersion.xml", outputDir); } -void DockerBuild(GitVersion version, string platform, string variant) +void DockerBuild(GitVersion gitVersion, string platform, string variant, bool isStableRelease = false) { - var name = $"gittools/gitversion-{variant}"; var workDir = DirectoryPath.FromString($"./src/Docker/{platform}/{variant}"); DirectoryPath sourceDir; @@ -162,26 +161,47 @@ void DockerBuild(GitVersion version, string platform, string variant) } CopyDirectory(sourceDir, workDir.Combine("content")); + var tags = GetDockerTags(gitVersion, platform, variant, isStableRelease); + var buildSettings = new DockerImageBuildSettings { Rm = true, - Tag = new []{ $"{name}:{platform}-{version.MajorMinorPatch}" }, + Tag = tags, File = $"{workDir}/Dockerfile", BuildArg = new []{ $"contentFolder=/content" }, - Pull = true, + // Pull = true, // Platform = platform // TODO this one is not supported on docker versions < 18.02 }; DockerBuild(buildSettings, workDir.ToString()); } -void DockerPush(GitVersion version, string platform, string variant) +void DockerPush(GitVersion gitVersion, string platform, string variant, bool isStableRelease = false) { + var tags = GetDockerTags(gitVersion, platform, variant, isStableRelease); + + foreach (var tag in tags) + { + DockerPush(tag); + } +} + +string[] GetDockerTags(GitVersion gitVersion, string platform, string variant, bool isStableRelease = false) { var name = $"gittools/gitversion-{variant}"; - var tag = $"{name}:{platform}-{version.MajorMinorPatch}"; - Information("Tag Name {0}", tag); - DockerPush(tag); + var tags = new List { + $"{name}:{platform}-{gitVersion.LegacySemVerPadded}" + }; + + if (!string.IsNullOrWhiteSpace(gitVersion.BuildMetaDataPadded)) { + tags.Add($"{name}:{platform}-{gitVersion.LegacySemVerPadded}.{gitVersion.BuildMetaDataPadded}"); + } + + if (variant == "dotnetcore" && isStableRelease) { + tags.Add($"{name}:latest"); + } + + return tags.ToArray(); } void GetReleaseNotes(FilePath outputPath, DirectoryPath workDir, string repoToken) diff --git a/build/version.cake b/build/version.cake index a0eac72514..8d659f879d 100644 --- a/build/version.cake +++ b/build/version.cake @@ -5,26 +5,24 @@ public class BuildVersion public string NuGetVersion { get; private set; } public string DotNetAsterix { get; private set; } public string PreReleaseTag { get; private set; } - public string GemVersion { get; private set; } public static BuildVersion Calculate(ICakeContext context, BuildParameters parameters, GitVersion gitVersion) { - var semVersion = gitVersion.LegacySemVerPadded; var version = gitVersion.MajorMinorPatch; var preReleaseTag = gitVersion.PreReleaseTag; + var semVersion = gitVersion.LegacySemVerPadded; - var gemVersion = string.IsNullOrEmpty(preReleaseTag) - ? version - : version + "." + preReleaseTag + "." + gitVersion.BuildMetaDataPadded; + if (!string.IsNullOrWhiteSpace(gitVersion.BuildMetaDataPadded)) { + semVersion += "." + gitVersion.BuildMetaDataPadded; + } return new BuildVersion { - Version = version, - SemVersion = semVersion, - NuGetVersion = gitVersion.NuGetVersion, + Version = version, + SemVersion = semVersion, + NuGetVersion = gitVersion.NuGetVersion, DotNetAsterix = semVersion.Substring(version.Length).TrimStart('-'), - PreReleaseTag = preReleaseTag, - GemVersion = gemVersion.TrimEnd('.') + PreReleaseTag = preReleaseTag }; } } diff --git a/run.cake b/run.cake index 3db25cdd49..e23458b4f9 100644 --- a/run.cake +++ b/run.cake @@ -50,16 +50,18 @@ Setup(context => parameters.Configuration, parameters.Target); - Information("Repository info : IsMainRepo {0}, IsMainBranch {1}, IsTagged: {2}", + Information("Repository info : IsMainRepo {0}, IsMainBranch {1}, IsTagged: {2}, IsPullRequest: {3}", parameters.IsMainRepo, parameters.IsMainBranch, - parameters.IsTagged); + parameters.IsTagged, + parameters.IsPullRequest); msBuildSettings = new DotNetCoreMSBuildSettings() .WithProperty("Version", parameters.Version.SemVersion) .WithProperty("AssemblyVersion", parameters.Version.Version) .WithProperty("PackageVersion", parameters.Version.NuGetVersion) .WithProperty("FileVersion", parameters.Version.Version); + if(!parameters.IsRunningOnWindows) { var frameworkPathOverride = new FilePath(typeof(object).Assembly.Location).GetDirectory().FullPath + "/"; @@ -115,6 +117,9 @@ Task("Clean") CleanDirectories("./src/**/bin/" + parameters.Configuration); CleanDirectories("./src/**/obj"); + + DeleteFiles("src/GitVersionRubyGem/*.gem"); + CleanDirectories(parameters.Paths.Directories.ToClean); }); @@ -138,7 +143,7 @@ Task("Build") #region Tests Task("Test") - .WithCriteria(() => !parameters.DisableUnitTests, "Skip unit tests.") + .WithCriteria(() => parameters.EnabledUnitTests, "Unit tests were disabled.") .IsDependentOn("Build") .Does(() => { @@ -245,7 +250,7 @@ Task("Pack-Tfs") var workDir = "./src/GitVersionTfsTask"; // update version number - ReplaceTextInFile(new FilePath(workDir + "/manifest.json"), "$version$", gitVersion.MajorMinorPatch); + ReplaceTextInFile(new FilePath(workDir + "/manifest.json"), "$version$", parameters.Version.SemVersion); var taskJson = ParseJsonFromFile(workDir + "/task.json"); taskJson["version"]["Major"] = gitVersion.Major.ToString(); @@ -275,7 +280,7 @@ Task("Pack-Gem") var gemspecFile = new FilePath(workDir + "/gitversion.gemspec"); // update version number - ReplaceTextInFile(gemspecFile, "$version$", parameters.Version.GemVersion); + ReplaceTextInFile(gemspecFile, "$version$", parameters.Version.SemVersion); var toolPath = FindToolInPath(IsRunningOnWindows() ? "gem.cmd" : "gem"); GemBuild(gemspecFile, new Cake.Gem.Build.GemBuildSettings() @@ -359,19 +364,20 @@ Task("Zip-Files") Task("Docker-Build") .WithCriteria(() => !parameters.IsRunningOnMacOS, "Docker can be built only on Windows or Linux agents.") - .WithCriteria(() => parameters.IsStableRelease() || parameters.IsPreRelease(), "Docker-Build works only for releases.") + .WithCriteria(() => parameters.IsStableRelease() || parameters.IsPreRelease() || parameters.EnabledPullRequestPublish, "Docker-Build works only for releases.") .IsDependentOn("Copy-Files") .Does(() => { + var version = gitVersion; if (parameters.IsRunningOnWindows) { - DockerBuild(gitVersion, "windows", "dotnetcore"); - DockerBuild(gitVersion, "windows", "fullfx"); + DockerBuild(version, "windows", "dotnetcore", parameters.IsStableRelease()); + DockerBuild(version, "windows", "fullfx"); } else if (parameters.IsRunningOnLinux) { - DockerBuild(gitVersion, "linux", "dotnetcore"); - DockerBuild(gitVersion, "linux", "fullfx"); + DockerBuild(version, "linux", "dotnetcore", parameters.IsStableRelease()); + DockerBuild(version, "linux", "fullfx"); } }); @@ -391,9 +397,9 @@ Task("Pack") #region Publish Task("Release-Notes") - .WithCriteria(() => parameters.IsRunningOnWindows, "Release notes are generated only on Windows agents.") + .WithCriteria(() => parameters.IsRunningOnWindows, "Release notes are generated only on Windows agents.") .WithCriteria(() => parameters.IsRunningOnAppVeyor, "Release notes are generated only on release agents.") - .WithCriteria(() => parameters.IsStableRelease(), "Release notes are generated only for stable releases.") + .WithCriteria(() => parameters.IsStableRelease(), "Release notes are generated only for stable releases.") .IsDependentOn("Clean") .Does(() => { @@ -409,7 +415,6 @@ Task("Release-Notes") Task("Publish-AppVeyor") .WithCriteria(() => parameters.IsRunningOnWindows, "Publish-AppVeyor works only on Windows agents.") .WithCriteria(() => parameters.IsRunningOnAppVeyor, "Publish-AppVeyor works only on AppVeyor.") - .WithCriteria(() => parameters.IsStableRelease() || parameters.IsPreRelease(), "Publish-AppVeyor works only for releases.") .IsDependentOn("Pack") .IsDependentOn("Release-Notes") .Does(() => @@ -427,13 +432,13 @@ Task("Publish-AppVeyor") .OnError(exception => { Information("Publish-AppVeyor Task failed, but continuing with next Task..."); + Error(exception.Dump()); publishingError = true; }); Task("Publish-AzurePipeline") - .WithCriteria(() => parameters.IsRunningOnWindows, "Publish-AzurePipeline works only on Windows agents.") + .WithCriteria(() => parameters.IsRunningOnWindows, "Publish-AzurePipeline works only on Windows agents.") .WithCriteria(() => parameters.IsRunningOnAzurePipeline, "Publish-AzurePipeline works only on AzurePipeline.") - .WithCriteria(() => parameters.IsStableRelease() || parameters.IsPreRelease(), "Publish-AzurePipeline works only for releases.") .IsDependentOn("Pack") .IsDependentOn("Release-Notes") .Does(() => @@ -450,14 +455,15 @@ Task("Publish-AzurePipeline") .OnError(exception => { Information("Publish-AzurePipeline Task failed, but continuing with next Task..."); + Error(exception.Dump()); publishingError = true; }); Task("Publish-Tfs") - .WithCriteria(() => !parameters.DisablePublishTfs, "Skip publish Tfs.") + .WithCriteria(() => parameters.EnabledPublishTfs, "Publish-Tfs was disabled.") .WithCriteria(() => parameters.IsRunningOnWindows, "Publish-Tfs works only on Windows agents.") .WithCriteria(() => parameters.IsRunningOnAppVeyor, "Publish-Tfs works only on AppVeyor.") - .WithCriteria(() => parameters.IsStableRelease(), "Publish-Tfs works only for stable releases.") + .WithCriteria(() => parameters.IsStableRelease() || parameters.IsPreRelease() || parameters.EnabledPullRequestPublish, "Publish-Tfs works only for releases.") .IsDependentOn("Pack-Tfs") .Does(() => { @@ -479,14 +485,15 @@ Task("Publish-Tfs") .OnError(exception => { Information("Publish-Tfs Task failed, but continuing with next Task..."); + Error(exception.Dump()); publishingError = true; }); Task("Publish-Gem") - .WithCriteria(() => !parameters.DisablePublishGem, "Skip publish Gem.") + .WithCriteria(() => parameters.EnabledPublishGem, "Publish-Gem was disabled.") .WithCriteria(() => parameters.IsRunningOnWindows, "Publish-Gem works only on Windows agents.") .WithCriteria(() => parameters.IsRunningOnAppVeyor, "Publish-Gem works only on AppVeyor.") - .WithCriteria(() => parameters.IsStableRelease(), "Publish-Gem works only for stable releases.") + .WithCriteria(() => parameters.IsStableRelease() || parameters.IsPreRelease() || parameters.EnabledPullRequestPublish, "Publish-Gem works only for releases.") .IsDependentOn("Pack-Gem") .Does(() => { @@ -506,14 +513,15 @@ Task("Publish-Gem") .OnError(exception => { Information("Publish-Gem Task failed, but continuing with next Task..."); + Error(exception.Dump()); publishingError = true; }); Task("Publish-DockerHub") - .WithCriteria(() => !parameters.DisablePublishDocker, "Skip publish Docker.") - .WithCriteria(() => !parameters.IsRunningOnMacOS, "Publish-DockerHub works only on Windows and Linux agents.") + .WithCriteria(() => parameters.EnabledPublishDocker, "Publish-DockerHub was disabled.") + .WithCriteria(() => !parameters.IsRunningOnMacOS, "Publish-DockerHub works only on Windows and Linux agents.") .WithCriteria(() => parameters.IsRunningOnAppVeyor || (parameters.IsRunningOnTravis && !parameters.IsRunningOnMacOS), "Publish-DockerHub works only on AppVeyor or Travis.") - .WithCriteria(() => parameters.IsStableRelease(), "Publish-DockerHub works only for releases.") + .WithCriteria(() => parameters.IsStableRelease() || parameters.IsPreRelease() || parameters.EnabledPullRequestPublish, "Publish-DockerHub works only for releases.") .IsDependentOn("Docker-Build") .Does(() => { @@ -527,17 +535,18 @@ Task("Publish-DockerHub") throw new InvalidOperationException("Could not resolve Docker password."); } + var version = gitVersion; DockerLogin(parameters.Credentials.Docker.UserName, parameters.Credentials.Docker.Password); if (parameters.IsRunningOnWindows) { - DockerPush(gitVersion, "windows", "dotnetcore"); - DockerPush(gitVersion, "windows", "fullfx"); + DockerPush(version, "windows", "dotnetcore", parameters.IsStableRelease()); + DockerPush(version, "windows", "fullfx"); } else if (parameters.IsRunningOnLinux) { - DockerPush(gitVersion, "linux", "dotnetcore"); - DockerPush(gitVersion, "linux", "fullfx"); + DockerPush(version, "linux", "dotnetcore", parameters.IsStableRelease()); + DockerPush(version, "linux", "fullfx"); } DockerLogout(); @@ -545,14 +554,15 @@ Task("Publish-DockerHub") .OnError(exception => { Information("Publish-DockerHub Task failed, but continuing with next Task..."); + Error(exception.Dump()); publishingError = true; }); Task("Publish-NuGet") - .WithCriteria(() => !parameters.DisablePublishNuget, "Skip publish Nuget.") + .WithCriteria(() => parameters.EnabledPublishNuget, "Publish-NuGet was disabled.") .WithCriteria(() => parameters.IsRunningOnWindows, "Publish-NuGet works only on Windows agents.") .WithCriteria(() => parameters.IsRunningOnAppVeyor, "Publish-NuGet works only on AppVeyor.") - .WithCriteria(() => parameters.IsStableRelease(), "Publish-NuGet works only for stable releases.") + .WithCriteria(() => parameters.IsStableRelease() || parameters.IsPreRelease() || parameters.EnabledPullRequestPublish, "Publish-NuGet works only for releases.") .IsDependentOn("Pack-NuGet") .Does(() => { @@ -582,14 +592,15 @@ Task("Publish-NuGet") .OnError(exception => { Information("Publish-NuGet Task failed, but continuing with next Task..."); + Error(exception.Dump()); publishingError = true; }); Task("Publish-Chocolatey") - .WithCriteria(() => !parameters.DisablePublishChocolatey, "Skip publish Chocolatey.") - .WithCriteria(() => parameters.IsRunningOnWindows, "Publish-Chocolatey works only on Windows agents.") - .WithCriteria(() => parameters.IsRunningOnAppVeyor, "Publish-Chocolatey works only on AppVeyor.") - .WithCriteria(() => parameters.IsStableRelease(), "Publish-Chocolatey works only for stable releases.") + .WithCriteria(() => parameters.EnabledPublishChocolatey, "Publish-Chocolatey was disabled.") + .WithCriteria(() => parameters.IsRunningOnWindows, "Publish-Chocolatey works only on Windows agents.") + .WithCriteria(() => parameters.IsRunningOnAppVeyor, "Publish-Chocolatey works only on AppVeyor.") + .WithCriteria(() => parameters.IsStableRelease() || parameters.IsPreRelease() || parameters.EnabledPullRequestPublish, "Publish-Chocolatey works only for releases.") .IsDependentOn("Pack-Chocolatey") .Does(() => { @@ -620,6 +631,7 @@ Task("Publish-Chocolatey") .OnError(exception => { Information("Publish-Chocolatey Task failed, but continuing with next Task..."); + Error(exception.Dump()); publishingError = true; }); diff --git a/src/Docker/linux/fullfx/Dockerfile b/src/Docker/linux/fullfx/Dockerfile index a09e6dd8a8..441c78954c 100644 --- a/src/Docker/linux/fullfx/Dockerfile +++ b/src/Docker/linux/fullfx/Dockerfile @@ -1,4 +1,4 @@ -FROM mono +FROM mono:5.14 LABEL maintainers="GitTools Maintainers" ARG contentFolder From 9be0054d183039ef6a4f459cf8b83d41550bc92b Mon Sep 17 00:00:00 2001 From: Artur Stolear Date: Thu, 4 Oct 2018 09:54:22 +0300 Subject: [PATCH 11/13] re-structured TFS task --- .gitignore | 4 +-- build/paths.cake | 5 ++-- build/version.cake | 4 +++ run.cake | 17 ++++++----- src/Docker/Readme.md | 2 +- src/GitVersionTfsTask/BuildTs.ps1 | 16 ----------- src/GitVersionTfsTask/Create-Vsix.ps1 | 13 --------- .../{ => GitVersionTask}/task.json | 0 .../Update-GitVersionTfsTaskVersion.ps1 | 27 ------------------ src/GitVersionTfsTask/icon.png | Bin 1189 -> 0 bytes .../{img => images}/build-task.png | Bin .../{img => images}/builds.png | Bin .../{ => images}/extension-icon.png | Bin src/GitVersionTfsTask/package.json | 2 +- src/GitVersionTfsTask/tsconfig.json | 5 ++-- .../{manifest.json => vss-extension.json} | 16 +++++------ 16 files changed, 31 insertions(+), 80 deletions(-) delete mode 100644 src/GitVersionTfsTask/BuildTs.ps1 delete mode 100644 src/GitVersionTfsTask/Create-Vsix.ps1 rename src/GitVersionTfsTask/{ => GitVersionTask}/task.json (100%) delete mode 100644 src/GitVersionTfsTask/Update-GitVersionTfsTaskVersion.ps1 delete mode 100644 src/GitVersionTfsTask/icon.png rename src/GitVersionTfsTask/{img => images}/build-task.png (100%) rename src/GitVersionTfsTask/{img => images}/builds.png (100%) rename src/GitVersionTfsTask/{ => images}/extension-icon.png (100%) rename src/GitVersionTfsTask/{manifest.json => vss-extension.json} (84%) diff --git a/.gitignore b/.gitignore index a38e8d819a..8da99d0340 100644 --- a/.gitignore +++ b/.gitignore @@ -121,9 +121,7 @@ releaseArtifacts .cake artifacts /src/Docker/**/content -/src/GitVersionTfsTask/lib -/src/GitVersionTfsTask/GitVersion.exe -/src/GitVersionTfsTask/LibGit2Sharp.dll.config +/src/GitVersionTfsTask/scripts /src/GitVersionTfsTask/*.vsix /src/GitVersionRubyGem/*.gem /src/GitVersionRubyGem/bin/lib diff --git a/build/paths.cake b/build/paths.cake index 62744d6f10..a627c8ce2b 100644 --- a/build/paths.cake +++ b/build/paths.cake @@ -36,10 +36,11 @@ public class BuildPaths var zipArtifactPathCoreClr = artifactsDir.CombineWithFilePath("GitVersion-bin-coreclr-v" + semVersion + ".zip"); var zipArtifactPathDesktop = artifactsDir.CombineWithFilePath("GitVersion-bin-net40-v" + semVersion + ".zip"); - var testCoverageOutputFilePath = buildArtifactDir.CombineWithFilePath("TestResult.xml"); var releaseNotesOutputFilePath = buildArtifactDir.CombineWithFilePath("releasenotes.md"); - var vsixOutputFilePath = buildArtifactDir.CombineWithFilePath("gittools.gitversion-" + semVersion + ".vsix"); + + var vsixVersion = version.DotNetVersion; + var vsixOutputFilePath = buildArtifactDir.CombineWithFilePath("gittools.gitversion-" + vsixVersion + ".vsix"); var gemVersion = version.SemVersion.Replace("-", ".pre."); var gemOutputFilePath = buildArtifactDir.CombineWithFilePath("gitversion-" + gemVersion + ".gem"); diff --git a/build/version.cake b/build/version.cake index 8d659f879d..1cc36a7382 100644 --- a/build/version.cake +++ b/build/version.cake @@ -4,6 +4,7 @@ public class BuildVersion public string SemVersion { get; private set; } public string NuGetVersion { get; private set; } public string DotNetAsterix { get; private set; } + public string DotNetVersion { get; private set; } public string PreReleaseTag { get; private set; } public static BuildVersion Calculate(ICakeContext context, BuildParameters parameters, GitVersion gitVersion) @@ -11,9 +12,11 @@ public class BuildVersion var version = gitVersion.MajorMinorPatch; var preReleaseTag = gitVersion.PreReleaseTag; var semVersion = gitVersion.LegacySemVerPadded; + var dotnetVersion = version; if (!string.IsNullOrWhiteSpace(gitVersion.BuildMetaDataPadded)) { semVersion += "." + gitVersion.BuildMetaDataPadded; + dotnetVersion += "." + gitVersion.BuildMetaDataPadded; } return new BuildVersion @@ -22,6 +25,7 @@ public class BuildVersion SemVersion = semVersion, NuGetVersion = gitVersion.NuGetVersion, DotNetAsterix = semVersion.Substring(version.Length).TrimStart('-'), + DotNetVersion = dotnetVersion, PreReleaseTag = preReleaseTag }; } diff --git a/run.cake b/run.cake index e23458b4f9..d331a29a06 100644 --- a/run.cake +++ b/run.cake @@ -117,7 +117,9 @@ Task("Clean") CleanDirectories("./src/**/bin/" + parameters.Configuration); CleanDirectories("./src/**/obj"); + CleanDirectories("./src/GitVersionTfsTask/scripts/**"); + DeleteFiles("src/GitVersionTfsTask/*.vsix"); DeleteFiles("src/GitVersionRubyGem/*.gem"); CleanDirectories(parameters.Paths.Directories.ToClean); @@ -231,13 +233,15 @@ Task("Copy-Files") PublishILRepackedGitVersionExe(false, parameters.Paths.Directories.ArtifactsBinFullFx, ilMergDir, cmdlineDir, parameters.Configuration, dotnetVersion); // Vsix - var tfsPath = new DirectoryPath("./src/GitVersionTfsTask"); + var tfsPath = new DirectoryPath("./src/GitVersionTfsTask/scripts"); + EnsureDirectoryExists(tfsPath); CopyFileToDirectory(portableDir + "/" + "LibGit2Sharp.dll.config", tfsPath); CopyFileToDirectory(portableDir + "/" + "GitVersion.exe", tfsPath); CopyDirectory(portableDir.Combine("lib"), tfsPath.Combine("lib")); // Ruby Gem var gemPath = new DirectoryPath("./src/GitVersionRubyGem/bin"); + EnsureDirectoryExists(gemPath); CopyFileToDirectory(portableDir + "/" + "LibGit2Sharp.dll.config", gemPath); CopyFileToDirectory(portableDir + "/" + "GitVersion.exe", gemPath); CopyDirectory(portableDir.Combine("lib"), gemPath.Combine("lib")); @@ -250,13 +254,14 @@ Task("Pack-Tfs") var workDir = "./src/GitVersionTfsTask"; // update version number - ReplaceTextInFile(new FilePath(workDir + "/manifest.json"), "$version$", parameters.Version.SemVersion); + ReplaceTextInFile(new FilePath(workDir + "/vss-extension.json"), "$version$", parameters.Version.DotNetVersion); - var taskJson = ParseJsonFromFile(workDir + "/task.json"); + var taskJsonFile = new FilePath(workDir + "/GitVersionTask/task.json"); + var taskJson = ParseJsonFromFile(taskJsonFile); taskJson["version"]["Major"] = gitVersion.Major.ToString(); taskJson["version"]["Minor"] = gitVersion.Minor.ToString(); taskJson["version"]["Patch"] = gitVersion.Patch.ToString(); - SerializeJsonToPrettyFile(workDir + "/task.json", taskJson); + SerializeJsonToPrettyFile(taskJsonFile, taskJson); // build and pack NpmSet("progress", "false"); @@ -267,7 +272,7 @@ Task("Pack-Tfs") { ToolPath = workDir + "/node_modules/.bin/" + (parameters.IsRunningOnWindows ? "tfx.cmd" : "tfx"), WorkingDirectory = workDir, - ManifestGlobs = new List(){ "manifest.json" }, + ManifestGlobs = new List(){ "vss-extension.json" }, OutputPath = parameters.Paths.Directories.BuildArtifact }); }); @@ -467,8 +472,6 @@ Task("Publish-Tfs") .IsDependentOn("Pack-Tfs") .Does(() => { - Information("Publish-Tfs"); - return; var token = parameters.Credentials.Tfx.Token; if(string.IsNullOrEmpty(token)) { throw new InvalidOperationException("Could not resolve Tfx token."); diff --git a/src/Docker/Readme.md b/src/Docker/Readme.md index de4490b411..6aecca9f86 100644 --- a/src/Docker/Readme.md +++ b/src/Docker/Readme.md @@ -1,4 +1,4 @@ -There are 4 variants of docker image : +# There are 4 variants of docker image : - based on **microsoft/dotnet-framework:4.7.2-runtime** - Windows Full FX - based on **microsoft/dotnet:2.1-runtime** - Windows dotnet core diff --git a/src/GitVersionTfsTask/BuildTs.ps1 b/src/GitVersionTfsTask/BuildTs.ps1 deleted file mode 100644 index dc938531c3..0000000000 --- a/src/GitVersionTfsTask/BuildTs.ps1 +++ /dev/null @@ -1,16 +0,0 @@ -param ( -) - -$scriptpath = $MyInvocation.MyCommand.Path -$dir = Split-Path $scriptpath -Push-Location $dir -Write-Host $dir -Try -{ - & npm install - & node_modules/.bin/tsc -} -Finally -{ - Pop-Location -} diff --git a/src/GitVersionTfsTask/Create-Vsix.ps1 b/src/GitVersionTfsTask/Create-Vsix.ps1 deleted file mode 100644 index 3adea9af82..0000000000 --- a/src/GitVersionTfsTask/Create-Vsix.ps1 +++ /dev/null @@ -1,13 +0,0 @@ -param ( -[string] $taskFolder -) - -Push-Location $taskFolder -Try -{ - & tfx extension create --manifest-globs manifest.json -} -Finally -{ - Pop-Location -} diff --git a/src/GitVersionTfsTask/task.json b/src/GitVersionTfsTask/GitVersionTask/task.json similarity index 100% rename from src/GitVersionTfsTask/task.json rename to src/GitVersionTfsTask/GitVersionTask/task.json diff --git a/src/GitVersionTfsTask/Update-GitVersionTfsTaskVersion.ps1 b/src/GitVersionTfsTask/Update-GitVersionTfsTaskVersion.ps1 deleted file mode 100644 index d7a65ce22c..0000000000 --- a/src/GitVersionTfsTask/Update-GitVersionTfsTaskVersion.ps1 +++ /dev/null @@ -1,27 +0,0 @@ -param ( -[string] $filePath, -[string] $version -) - -if ([string]::IsNullOrWhiteSpace($filePath)) { - throw "File path needs to be provided." -} - -if ([string]::IsNullOrWhiteSpace($version)) { - throw "Version number needs to be provided." -} - -Write-Host "Set version in '$filePath' to $version" - -$ver = [Version]$version - -# Get the task.json as a powershell object -$task = Get-Content -Raw -Path $filePath | ConvertFrom-Json - -$task.version.Major = $ver.Major -$task.version.Minor = $ver.Minor -$task.version.Patch = $ver.Build - -# get this as a string again - -ConvertTo-Json $task -Depth 100 | Set-Content -Path $filePath \ No newline at end of file diff --git a/src/GitVersionTfsTask/icon.png b/src/GitVersionTfsTask/icon.png deleted file mode 100644 index fe52c661cbb5aa655290eda965c5618210948522..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1189 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyEa{HEjtmSN`?>!lvVtU&J%W50 z7^>757#dm_7=8hT8eT9klo~KFyh>nTu$sZZAYL$MSD+081LK|mpAc7|f>AI;L!e!Q zI~VBm$t6L4!3_52-c>U1e%={hcJz-8<1G*NQ=XgTR#b%>oZ0f8PsnQZKhxjSxG!d^ zif6sJ6fCRd?tM4K_0?7d(V4&6!z5yPHmB~i+wr>fFh`F6*`G7=Zhm+?hjo@z+V*`3 zaXJ&`ihcghcH%)pp^^E#rmtT@RP;kH7(Nw#`{xtCl z=k1y-@0|FO@sZpvpz|1$yxm;OkH}(RdcF?Aj7}P}D}V}?d%8G=Se&j6 zObvH(6p1;K$CD$Fvr#nKFpzQg0hVZy-NL(z|7|#3{f1fO{$B&@^0IUDZdP*&dI>Q& zNJ+T-Tba<(($?y(V07wzX$en~rBb)^9(!jdA<3!AnwC$$*NRNC_0>At6cFzmwJTit zbbyBO!k}vDO`GcX&z$_4?`Zjn&*Iwg4_Gz62*(6JF>OwA^Y&uh%JVcYtkKAEt;^H{ zTd#V(JLA%O{cz!m)Gh1wHQr{FntAEU9LJK3#9ZxL8r#ZCg03uHJ$HrTTeT(ZI&F+@ zUA)WUx@!M2dq~R^ojfd|czChZsbdCy7kRkf&u37xG-6dY@I5)f)Bhqz^Y5cGBUd-c zZL>V1ucH^J<{PnWM^mVnS7Lm0xykA^(lycN{?{3od;fT}ExX@(_q)9FC+3S)Y`gEx zJNr<@&5CdQEQb{X4sKqYJjdXx$Y-lgTe~DWM4fLb^2H diff --git a/src/GitVersionTfsTask/img/build-task.png b/src/GitVersionTfsTask/images/build-task.png similarity index 100% rename from src/GitVersionTfsTask/img/build-task.png rename to src/GitVersionTfsTask/images/build-task.png diff --git a/src/GitVersionTfsTask/img/builds.png b/src/GitVersionTfsTask/images/builds.png similarity index 100% rename from src/GitVersionTfsTask/img/builds.png rename to src/GitVersionTfsTask/images/builds.png diff --git a/src/GitVersionTfsTask/extension-icon.png b/src/GitVersionTfsTask/images/extension-icon.png similarity index 100% rename from src/GitVersionTfsTask/extension-icon.png rename to src/GitVersionTfsTask/images/extension-icon.png diff --git a/src/GitVersionTfsTask/package.json b/src/GitVersionTfsTask/package.json index 2a76dd257f..192ddd7aaa 100644 --- a/src/GitVersionTfsTask/package.json +++ b/src/GitVersionTfsTask/package.json @@ -7,7 +7,7 @@ "scripts": { "build": "tsc", "test": "echo \"Error: no test specified\" && exit 1", - "package": "tfx extension create --manifest-globs manifest.json" + "package": "tfx extension create --manifest-globs vss-extension.json" }, "author": "", "license": "MIT", diff --git a/src/GitVersionTfsTask/tsconfig.json b/src/GitVersionTfsTask/tsconfig.json index a4410d2e46..63f6cb30bf 100644 --- a/src/GitVersionTfsTask/tsconfig.json +++ b/src/GitVersionTfsTask/tsconfig.json @@ -8,6 +8,7 @@ "target": "es6", "sourceMap": false, "inlineSourceMap": true, - "declaration": false + "declaration": false, + "outDir": "scripts" } -} \ No newline at end of file +} diff --git a/src/GitVersionTfsTask/manifest.json b/src/GitVersionTfsTask/vss-extension.json similarity index 84% rename from src/GitVersionTfsTask/manifest.json rename to src/GitVersionTfsTask/vss-extension.json index 06152f9813..ab6db2aeda 100644 --- a/src/GitVersionTfsTask/manifest.json +++ b/src/GitVersionTfsTask/vss-extension.json @@ -11,20 +11,17 @@ "id": "Microsoft.VisualStudio.Services" }], "files": [{ - "path": "GitVersion.exe" + "path": "scripts" }, { - "path": "LibGit2Sharp.dll.config" - }, - { - "path": "lib" + "path": "GitVersionTask" } ], "categories": [ "Build and release" ], "icons": { - "default": "extension-icon.png" + "default": "images/extension-icon.png" }, "tags": [ "semver", @@ -43,15 +40,18 @@ "license": { "uri": "https://github.com/GitTools/GitVersion/blob/master/LICENSE" }, + "repository": { + "uri": "https://github.com/GitTools/GitVersion" + }, "support": { "uri": "https://github.com/GitTools/GitVersion/issues" } }, "screenshots": [{ - "path": "img/builds.png" + "path": "images/builds.png" }, { - "path": "img/build-task.png" + "path": "images/build-task.png" } ], "content": { From f35cccce57981e6efdc60e83d89b117c875bfc6e Mon Sep 17 00:00:00 2001 From: Artur Stolear Date: Thu, 4 Oct 2018 16:19:15 +0300 Subject: [PATCH 12/13] disable azure pipeline badges in README for now --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 145a49dddc..2b1739c9c8 100644 --- a/README.md +++ b/README.md @@ -58,8 +58,8 @@ from The Noun Project [gitter-badge]: https://badges.gitter.im/Join+Chat.svg [appveyor]: https://ci.appveyor.com/project/GitTools/gitversion/branch/master [appveyor-badge]: https://ci.appveyor.com/api/projects/status/sxje0wht0cscmn7w/branch/master?svg=true -[azure-pipeline]: https://dev.azure.com/arturcic/OSS/_build/latest?definitionId=2 -[azure-pipeline-badge]: https://dev.azure.com/arturcic/OSS/_apis/build/status/GitVersion + + [travis]: https://travis-ci.org/GitTools/GitVersion [travis-badge]: https://travis-ci.org/GitTools/GitVersion.svg?branch=master [docs]: http://gitversion.readthedocs.org/en/stable/ From 7053806975831e65410c2665cac31e6c500f63a6 Mon Sep 17 00:00:00 2001 From: Artur Stolear Date: Thu, 4 Oct 2018 16:48:03 +0300 Subject: [PATCH 13/13] improve versioning for artifacts --- build/version.cake | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/build/version.cake b/build/version.cake index 1cc36a7382..afd1cf743c 100644 --- a/build/version.cake +++ b/build/version.cake @@ -14,10 +14,8 @@ public class BuildVersion var semVersion = gitVersion.LegacySemVerPadded; var dotnetVersion = version; - if (!string.IsNullOrWhiteSpace(gitVersion.BuildMetaDataPadded)) { - semVersion += "." + gitVersion.BuildMetaDataPadded; - dotnetVersion += "." + gitVersion.BuildMetaDataPadded; - } + semVersion += "." + gitVersion.CommitsSinceVersionSource; + dotnetVersion += "." + gitVersion.CommitsSinceVersionSource; return new BuildVersion {