Skip to content

Latest commit

 

History

History
563 lines (476 loc) · 30.2 KB

Saritasa.Build.md

File metadata and controls

563 lines (476 loc) · 30.2 KB

Saritasa.Build

Copy-DotnetConfig

Synopsis

Creates file from a template.

Syntax

Copy-DotnetConfig [-TemplateFilename] <String> [<CommonParameters>]

Parameters

Name Alias Description Required? Pipeline Input Default Value
TemplateFilename Path to App.config.template or Web.config.template file. true false

Examples

EXAMPLE 1

Copy-DotnetConfig .\..\Web\Web.config.template

Creates a Web.config file in Web folder from template.

Initialize-MSBuild

Synopsis

Adds correct path to MSBuild to Path environment variable.

Syntax

Initialize-MSBuild [<CommonParameters>]

Install-NugetCli

Synopsis

Downloads latest nuget.exe to specified location.

Syntax

Install-NugetCli [-Destination] <String> [<CommonParameters>]

Parameters

Name Alias Description Required? Pipeline Input Default Value
Destination true false

Examples

EXAMPLE 1

Install-NugetCli .

Install nuget into current directory

Invoke-EFMigrate

Synopsis

Run Entity Framework migrations.

Syntax

Invoke-EFMigrate [-MigrationAssembly] <String> [[-ConfigFilename] <String>] [<CommonParameters>]

Parameters

Name Alias Description Required? Pipeline Input Default Value
MigrationAssembly Path to assembly file with migrations. true false
ConfigFilename Path to assembly .config file. If not specified default or parent Web.config will be used. false false

Note

In essential this command tries to find migrate.exe in packages and run it against specified configuration file.

Examples

EXAMPLE 1

Invoke-EFMigrate ..\..\Domain\bin\Debug\Domain.dll

Runs all migrations declared in Domain.dll file, using Domain.dll.config as configuration file

Invoke-NugetRestore

Synopsis

Restores packages for solution, project or packages.config.

Syntax

Invoke-NugetRestore -SolutionPath <String> [<CommonParameters>]

Invoke-NugetRestore -ProjectPath <String> -SolutionDirectory <String> [<CommonParameters>]

Parameters

Name Alias Description Required? Pipeline Input Default Value
SolutionPath Path to solution. All NuGet packages from included projects will be restored. true false
ProjectPath Path to project or packages.config. true false
SolutionDirectory Path to the solution directory. Not valid when restoring packages for a solution. true false

Note

If nuget command is not found - it will be downloaded to current directory.

Examples

EXAMPLE 1

Invoke-NugetRestore .\..\myapp.sln

Restores all packages for myapp solution.

Invoke-ProjectBuild

Synopsis

Builds project.

Syntax

Invoke-ProjectBuild [-ProjectPath] <String> [[-Configuration] <String>] [[-Target] <String>] [[-BuildParams] <String[]>] [<CommonParameters>]

Parameters

Name Alias Description Required? Pipeline Input Default Value
ProjectPath Path to project. true false
Configuration Build configuration \(Release, Debug, etc.\) false false
Target Build the specified targets in the project. Use a semicolon or comma to separate multiple targets. false false Build
BuildParams Additional build parameters. false false

Note

For more information about Target and BuildParams parameters, see MSBuild documentation.

Examples

EXAMPLE 1

Invoke-ProjectBuild .\..\Web\Web.csproj -Configuration 'Release'

Invoke-SolutionBuild

Synopsis

Builds solution.

Syntax

Invoke-SolutionBuild [-SolutionPath] <String> [[-Configuration] <String>] [<CommonParameters>]

Parameters

Name Alias Description Required? Pipeline Input Default Value
SolutionPath Path to solution. true false
Configuration Build configuration \(Release, Debug, etc.\) false false

Examples

EXAMPLE 1

Invoke-SolutionBuild .\..\myapp.sln -Configuration Debug

Merge-PackageConfigs

Synopsis

Loads packages from multiple packages.config and saves to a single file.

Syntax

Merge-PackageConfigs [-SolutionDirectory] <String> [-OutputPath] <String> [[-Framework] <String>] [<CommonParameters>]

Parameters

Name Alias Description Required? Pipeline Input Default Value
SolutionDirectory Directory in which to look for packages.config files. true false
OutputPath Path to file in which results should be saved. If file exists, it will be overridden. true false
Framework If specified, only packages with this framework will be included in the results. false false

Examples

EXAMPLE 1

Merge-PackageConfigs -SolutionDirectory .\src -OutputPath .\src\packages.merged.config

EXAMPLE 2

Merge-PackageConfigs -SolutionDirectory .\src -OutputPath .\src\packages.merged.net40.config -Framework net40

Merge-PackageConfigs -SolutionDirectory .\src -OutputPath .\src\packages.merged.net452.config -Framework net452

Remove-RoslynAnalyzer

Synopsis

Removes Roslyn analyzer references from Visual Studio project.

Syntax

Remove-RoslynAnalyzer [-ProjectPath] <String> [<CommonParameters>]

Parameters

Name Alias Description Required? Pipeline Input Default Value
ProjectPath Path to Visual Studio project. true false

Update-AssemblyInfoFile

Synopsis

Update version numbers of AssemblyInfo.cs and AssemblyInfo.vb.

Syntax

Update-AssemblyInfoFile [-AssemblyVersion] <String> [[-AssemblyInfoVersion] <String>] [[-AssemblyFileVersion] <String>] [[-Path] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]

Parameters

Name Alias Description Required? Pipeline Input Default Value
AssemblyVersion Version Version string in major.minor.build.revision format. true false
AssemblyInfoVersion false false
AssemblyFileVersion false false
Path Path to root directory. false false
WhatIf wi false false
Confirm cf false false

Note

Based on SetVersion script. http://www.luisrocha.net/2009/11/setting-assembly-version-with-windows.html Copyright (c) 2009 Luis Rocha

Based on GitVersion code. https://github.com/GitTools/GitVersion

Examples

EXAMPLE 1

Update-AssemblyInfoFile -AssemblyVersion '6.3.0.0' -AssemblyFileVersion '6.3.1.1' -AssemblyInfoVersion '6.3.0+master.808d1733f5c701c1882816f70c3eafc6e7fce4d4'

Update-VariablesInFile

Synopsis

Replaces placeholders $(UserName) with values from hashtable.

Syntax

Update-VariablesInFile [-Path] <String> [-Variables] <Hashtable> [<CommonParameters>]

Parameters

Name Alias Description Required? Pipeline Input Default Value
Path true false
Variables true false

Examples

EXAMPLE 1

Update-VariablesInFile -Path Config.xml @{UserName='sa'}