Private GIT

Skip to content
Snippets Groups Projects
Select Git revision
1 result Searching

build.ps1

Blame
  • build.ps1 7.26 KiB
    ##########################################################################
    # 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 ShowDescription
    Shows description about tasks.
    .PARAMETER DryRun
    Performs a dry run.
    .PARAMETER Experimental
    Uses the nightly builds of the Roslyn script engine.
    .PARAMETER Mono
    Uses the Mono Compiler rather than the Roslyn script engine.
    .PARAMETER SkipToolPackageRestore
    Skips restoring of packages.
    .PARAMETER ScriptArgs
    Remaining arguments are added here.
    
    .LINK
    https://cakebuild.net
    
    #>
    
    [CmdletBinding()]
    Param(
        [string]$Script = "build.cake",
        [string]$Target,
        [string]$Configuration,
        [ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")]
        [string]$Verbosity,
        [switch]$ShowDescription,
        [Alias("WhatIf", "Noop")]
        [switch]$DryRun,
        [switch]$Experimental,
        [switch]$Mono,
        [switch]$SkipToolPackageRestore,
        [Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)]
        [string[]]$ScriptArgs
    )
    
    [Reflection.Assembly]::LoadWithPartialName("System.Security") | Out-Null
    function MD5HashFile([string] $filePath)
    {
        if ([string]::IsNullOrEmpty($filePath) -or !(Test-Path $filePath -PathType Leaf))
        {
            return $null
        }
    
        [System.IO.Stream] $file = $null;
        [System.Security.Cryptography.MD5] $md5 = $null;
        try
        {