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..8da99d0340 100644 --- a/.gitignore +++ b/.gitignore @@ -117,3 +117,13 @@ GitVersion.CommandLine/*/ releaseArtifacts /ILMergeTemp +.dotnet +.cake +artifacts +/src/Docker/**/content +/src/GitVersionTfsTask/scripts +/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 5259e80a37..b09687cd3b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,20 @@ 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 + - 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: - - ./build.sh -v Diagnostic + - pwsh ./run.ps1 -script run.cake -target Default 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/README.md b/README.md index 930de3dbe2..2b1739c9c8 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 + + +[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/ diff --git a/appveyor.yml b/appveyor.yml index 6df9d5c357..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: - - ps: .\build.ps1 + - 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 \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000000..fb30cc68a7 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,37 @@ +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 run.cake -target Default + 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 + - task: UseRubyVersion@0 + inputs: + addToPath: true # Optional + - powershell: ./run.ps1 -script run.cake -target Default + 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 + - task: UseRubyVersion@0 + inputs: + addToPath: true # Optional + - powershell: ./run.ps1 -script run.cake -target Default + displayName: 'Cake build' 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") 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..ef8f0c00c5 --- /dev/null +++ b/build/parameters.cake @@ -0,0 +1,194 @@ +#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 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; } + 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 bool IsPullRequest { 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 && !IsPullRequest && IsTagged; + public bool IsPreRelease() => !IsLocalBuild && IsMainRepo && IsMainBranch && !IsPullRequest && !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"), + + 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(), + 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); + IsPullRequest = IsPullRequestBuild(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 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"); + context.StartProcess(gitPath, new ProcessSettings { Arguments = "tag --points-at " + gitVersion.Sha, RedirectStandardOutput = true }, out var redirectedOutput); + + return redirectedOutput.Any(); + } + + private static bool IsEnabled(ICakeContext context, string envVar, bool nullOrEmptyAsEnabled = true) + { + var value = context.EnvironmentVariable(envVar); + + return string.IsNullOrWhiteSpace(value) ? nullOrEmptyAsEnabled : bool.Parse(value); + } +} diff --git a/build/paths.cake b/build/paths.cake new file mode 100644 index 0000000000..a627c8ce2b --- /dev/null +++ b/build/paths.cake @@ -0,0 +1,152 @@ +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 vsixVersion = version.DotNetVersion; + var vsixOutputFilePath = buildArtifactDir.CombineWithFilePath("gittools.gitversion-" + vsixVersion + ".vsix"); + + var gemVersion = version.SemVersion.Replace("-", ".pre."); + var gemOutputFilePath = buildArtifactDir.CombineWithFilePath("gitversion-" + 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..a9ec19b854 --- /dev/null +++ b/build/utils.cake @@ -0,0 +1,221 @@ + +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 gitVersion, string platform, string variant, bool isStableRelease = false) +{ + 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 tags = GetDockerTags(gitVersion, platform, variant, isStableRelease); + + var buildSettings = new DockerImageBuildSettings + { + Rm = true, + Tag = tags, + 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 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 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) +{ + 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..afd1cf743c --- /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 DotNetVersion { get; private set; } + public string PreReleaseTag { get; private set; } + + public static BuildVersion Calculate(ICakeContext context, BuildParameters parameters, GitVersion gitVersion) + { + var version = gitVersion.MajorMinorPatch; + var preReleaseTag = gitVersion.PreReleaseTag; + var semVersion = gitVersion.LegacySemVerPadded; + var dotnetVersion = version; + + semVersion += "." + gitVersion.CommitsSinceVersionSource; + dotnetVersion += "." + gitVersion.CommitsSinceVersionSource; + + return new BuildVersion + { + Version = version, + SemVersion = semVersion, + NuGetVersion = gitVersion.NuGetVersion, + DotNetAsterix = semVersion.Substring(version.Length).TrimStart('-'), + DotNetVersion = dotnetVersion, + PreReleaseTag = preReleaseTag + }; + } +} diff --git a/src/GitVersionExe/NugetAssets/GitVersion.CommandLine.DotNetCore.nuspec b/nuspec/GitVersion.CommandLine.DotNetCore.nuspec similarity index 100% rename from src/GitVersionExe/NugetAssets/GitVersion.CommandLine.DotNetCore.nuspec rename to nuspec/GitVersion.CommandLine.DotNetCore.nuspec diff --git a/src/GitVersionExe/NugetAssets/GitVersion.CommandLine.nuspec b/nuspec/GitVersion.CommandLine.nuspec similarity index 100% rename from src/GitVersionExe/NugetAssets/GitVersion.CommandLine.nuspec rename to nuspec/GitVersion.CommandLine.nuspec diff --git a/src/GitVersionExe/NugetAssets/GitVersion.Portable.nuspec b/nuspec/GitVersion.Portable.nuspec similarity index 100% rename from src/GitVersionExe/NugetAssets/GitVersion.Portable.nuspec rename to nuspec/GitVersion.Portable.nuspec diff --git a/nuspec/chocolateyInstall.ps1 b/nuspec/chocolateyInstall.ps1 new file mode 100644 index 0000000000..6227375d8b --- /dev/null +++ b/nuspec/chocolateyInstall.ps1 @@ -0,0 +1 @@ +Generate-BinFile "gv" "$packageFolder\Tools\GitVersion.exe" diff --git a/src/GitVersionExe/NugetAssets/chocolateyUninstall.ps1 b/nuspec/chocolateyUninstall.ps1 similarity index 51% rename from src/GitVersionExe/NugetAssets/chocolateyUninstall.ps1 rename to nuspec/chocolateyUninstall.ps1 index 06198afa27..ddace64230 100644 --- a/src/GitVersionExe/NugetAssets/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" diff --git a/run.cake b/run.cake new file mode 100644 index 0000000000..d331a29a06 --- /dev/null +++ b/run.cake @@ -0,0 +1,665 @@ + +// 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}, IsPullRequest: {3}", + parameters.IsMainRepo, + parameters.IsMainBranch, + 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 + "/"; + + // 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("./src/GitVersionTfsTask/scripts/**"); + + DeleteFiles("src/GitVersionTfsTask/*.vsix"); + DeleteFiles("src/GitVersionRubyGem/*.gem"); + + 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.EnabledUnitTests, "Unit tests were disabled.") + .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/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")); +}); + +Task("Pack-Tfs") + .IsDependentOn("Copy-Files") + .Does(() => +{ + var workDir = "./src/GitVersionTfsTask"; + + // update version number + ReplaceTextInFile(new FilePath(workDir + "/vss-extension.json"), "$version$", parameters.Version.DotNetVersion); + + 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(taskJsonFile, 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(){ "vss-extension.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.SemVersion); + + 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() || parameters.EnabledPullRequestPublish, "Docker-Build works only for releases.") + .IsDependentOn("Copy-Files") + .Does(() => +{ + var version = gitVersion; + if (parameters.IsRunningOnWindows) + { + DockerBuild(version, "windows", "dotnetcore", parameters.IsStableRelease()); + DockerBuild(version, "windows", "fullfx"); + } + else if (parameters.IsRunningOnLinux) + { + DockerBuild(version, "linux", "dotnetcore", parameters.IsStableRelease()); + DockerBuild(version, "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.") + .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..."); + Error(exception.Dump()); + publishingError = true; +}); + +Task("Publish-AzurePipeline") + .WithCriteria(() => parameters.IsRunningOnWindows, "Publish-AzurePipeline works only on Windows agents.") + .WithCriteria(() => parameters.IsRunningOnAzurePipeline, "Publish-AzurePipeline works only on AzurePipeline.") + .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..."); + Error(exception.Dump()); + publishingError = true; +}); + +Task("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() || parameters.IsPreRelease() || parameters.EnabledPullRequestPublish, "Publish-Tfs works only for releases.") + .IsDependentOn("Pack-Tfs") + .Does(() => +{ + 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..."); + Error(exception.Dump()); + publishingError = true; +}); + +Task("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() || parameters.IsPreRelease() || parameters.EnabledPullRequestPublish, "Publish-Gem works only for 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..."); + Error(exception.Dump()); + publishingError = true; +}); + +Task("Publish-DockerHub") + .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() || parameters.IsPreRelease() || parameters.EnabledPullRequestPublish, "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."); + } + + var version = gitVersion; + DockerLogin(parameters.Credentials.Docker.UserName, parameters.Credentials.Docker.Password); + + if (parameters.IsRunningOnWindows) + { + DockerPush(version, "windows", "dotnetcore", parameters.IsStableRelease()); + DockerPush(version, "windows", "fullfx"); + } + else if (parameters.IsRunningOnLinux) + { + DockerPush(version, "linux", "dotnetcore", parameters.IsStableRelease()); + DockerPush(version, "linux", "fullfx"); + } + + DockerLogout(); +}) +.OnError(exception => +{ + Information("Publish-DockerHub Task failed, but continuing with next Task..."); + Error(exception.Dump()); + publishingError = true; +}); + +Task("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() || parameters.IsPreRelease() || parameters.EnabledPullRequestPublish, "Publish-NuGet works only for 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..."); + Error(exception.Dump()); + publishingError = true; +}); + +Task("Publish-Chocolatey") + .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(() => +{ + 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..."); + Error(exception.Dump()); + 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/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/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..6aecca9f86 --- /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..441c78954c --- /dev/null +++ b/src/Docker/linux/fullfx/Dockerfile @@ -0,0 +1,12 @@ +FROM mono:5.14 +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/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 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/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..a9be0afdb3 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 - - - + + + - - + + @@ -59,113 +59,9 @@ - - - - - - - - - - - - Designer - - - Designer - - - + - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - mono - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(GitVersion_MajorMinorPatch) - $(GitVersion_MajorMinorPatch).$(GitVersion_PreReleaseTag) - - - - - - - - \ No newline at end of file + 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/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/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 @@ - + 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/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/GitVersionTask/task.json b/src/GitVersionTfsTask/GitVersionTask/task.json new file mode 100644 index 0000000000..120cbab0b7 --- /dev/null +++ b/src/GitVersionTfsTask/GitVersionTask/task.json @@ -0,0 +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": "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" + }, + { + "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 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 fe52c661cb..0000000000 Binary files a/src/GitVersionTfsTask/icon.png and /dev/null differ diff --git a/src/GitVersionTfsTask/build-task.png b/src/GitVersionTfsTask/images/build-task.png similarity index 100% rename from src/GitVersionTfsTask/build-task.png rename to src/GitVersionTfsTask/images/build-task.png diff --git a/src/GitVersionTfsTask/builds.png b/src/GitVersionTfsTask/images/builds.png similarity index 100% rename from src/GitVersionTfsTask/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-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..192ddd7aaa 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 vss-extension.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 deleted file mode 100644 index 58f8c6b6b4..0000000000 --- a/src/GitVersionTfsTask/task.json +++ /dev/null @@ -1,76 +0,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": "0", - "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" - }, - { - "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": "" - } - } -} 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 64% rename from src/GitVersionTfsTask/manifest.json rename to src/GitVersionTfsTask/vss-extension.json index 719be4aecd..ab6db2aeda 100644 --- a/src/GitVersionTfsTask/manifest.json +++ b/src/GitVersionTfsTask/vss-extension.json @@ -7,12 +7,12 @@ "author": "GitVersion Contributors", "version": "$version$", "description": "Build task for easy semantic versioning for projects using Git.", - "targets": [ - { - "id": "Microsoft.VisualStudio.Services" - } - ], - "files": [ + "targets": [{ + "id": "Microsoft.VisualStudio.Services" + }], + "files": [{ + "path": "scripts" + }, { "path": "GitVersionTask" } @@ -20,9 +20,8 @@ "categories": [ "Build and release" ], - "icons": - { - "default": "extension-icon.png" + "icons": { + "default": "images/extension-icon.png" }, "tags": [ "semver", @@ -41,16 +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" + "screenshots": [{ + "path": "images/builds.png" }, { - "path": "img/build-task.png" + "path": "images/build-task.png" } ], "content": { @@ -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/tools/packages.config b/tools/packages.config deleted file mode 100644 index 0f070f2afe..0000000000 --- a/tools/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - -