This feedback is on the experience of using MSBuild, not just on msbuild.exe
Not in any order, I may sort them later.
Today creating and maintaining MSBuild scripts is challenging. Some of the challenges for the user include.
| <configuration> | |
| <connectionStrings> | |
| <clear/> | |
| <add name="Default" connectionString="Data Source=localhost;Initial Catalog=Sample01;Integrated Security=True;" /> | |
| </connectionStrings> | |
| <appSettings> | |
| <add key="contactEmail" value="contact@demo.example.com"/> | |
| <add key="siteUrl" value="http://demo.example.com"/> | |
| </appSettings> |
| <?xml version="1.0" encoding="utf-8"?> | |
| <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
| <!-- | |
| You can use this file to disable pre and post events globally across both MSBuild and Visual Studio. | |
| To use this file, you have two options. | |
| 1. Save this file as C:\Program Files (x86)\MSBuild\v14.0\Custom.After.Microsoft.Common.targets | |
| Or whatever the value of the MSBuild property $(CustomAfterMicrosoftCommonTargets). | |
| 2. Save this file to a random location, lets say C:\temp\msbuild\nopreorpostevents.targets, | |
| then set the CustomAfterMicrosoftCommonTargets env var to point to that file. Then start Visual Studio. |
| function Measure-Directory{ | |
| [cmdletbinding()] | |
| param( | |
| [Parameter(Position=0,ValueFromPipeline=$true)] | |
| [System.IO.DirectoryInfo[]]$path, | |
| [switch]$recurse | |
| ) | |
| process{ | |
| foreach($srcpath in $path){ |
| function Get-ScriptDirectory{ | |
| split-path (((Get-Variable MyInvocation -Scope 1).Value).MyCommand.Path) | |
| } | |
| $scriptDir = ((Get-ScriptDirectory) + "\") | |
| Add-Type -Path (Join-Path $scriptDir 'bin\Geoffry.Watch.dll') | |
| $watcherdef = New-Object -TypeName 'Geoffry.Watch.WatchDefinition' | |
| $watcherdef.GlobbingPattern = '**/*.css' | |
| $watcherdef.RootDirectory = (Join-Path $scriptDir 'src\css') |
| # Based on: | |
| # http://blogs.technet.com/b/heyscriptingguy/archive/2011/07/23/use-powershell-to-modify-your-environmental-path.aspx | |
| # Based on: | |
| # http://blogs.technet.com/b/heyscriptingguy/archive/2011/07/23/use-powershell-to-modify-your-environmental-path.aspx | |
| function Add-Path{ | |
| [cmdletbinding()] | |
| param( | |
| [Parameter(Mandatory=$True,ValueFromPipeline=$True,Position=0)] | |
| [string[]]$pathToAdd | |
| ) |
| { | |
| "Settings": { | |
| "RootUrl": "http://contoso.com", | |
| "AdminEmail": "admin@contoso.com", | |
| "LoggingId": "a4acff0b-c3e3-4344-94eb-264b71840f3e" | |
| }, | |
| "Data": { | |
| "DefaultConnection": { | |
| "ConnectionString": "Server=tcp:contoso.database.windows.net,1433;Database=contoso_db;User ID=contosodbuser@contoso;Password=my-actual-prod-password;Trusted_Connection=False;Encrypt=True;Connection Timeout=30;" | |
| }, |
| <?xml version="1.0" encoding="utf-8"?> | |
| <!-- | |
| This file is used by the publish/package process of your Web project. You can customize the behavior of this process | |
| by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121. | |
| --> | |
| <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
| <PropertyGroup> | |
| <WebPublishMethod>FileSystem</WebPublishMethod> | |
| <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> | |
| <LastUsedPlatform>Any CPU</LastUsedPlatform> |
| # OPTION 1 | |
| $itemTemplate = new-itemtemplate 'aspnet5-empty' 'ASP.NET 5 empty project' -properties @{ | |
| DefaultProjectName = 'MyEmptyProject' | |
| LicenseUrl = 'https://raw.githubusercontent.com/ligershark/pecan-waffle/master/LICENSE' | |
| ProjectUrl = 'https://github.com/ligershark/pecan-waffle' | |
| GitUrl = 'https://github.com/ligershark/pecan-waffle.git' | |
| GitBranch = 'master' | |
| BeforeInstall = { 'before install' | Write-Host -ForegroundColor Cyan} | |
| AfterInstall = { 'after install' | Write-Host -ForegroundColor Cyan} |
| [cmdletbinding()] | |
| param( | |
| [Parameter(Position=0)] | |
| $branch = 'master' | |
| ) | |
| 'Branch [{0}]' -f $branch | Write-Output |