Skip to content

Commit eaf2eb2

Browse files
authored
Release 0.11.0
Merge pull request #90 from mgrosperrin/release-0.11.0
2 parents 157c67d + 225d695 commit eaf2eb2

File tree

211 files changed

+4360
-2707
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+4360
-2707
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,4 +186,5 @@ FakesAssemblies/
186186

187187
.vs/
188188
artifacts/
189-
src/CommonFiles/VersionAssemblyInfo.cs
189+
src/CommonFiles/VersionAssemblyInfo.cs
190+
_BuildReports/

.vscode/launch.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
// Use IntelliSense to find out which attributes exist for C# debugging
3+
// Use hover for the description of the existing attributes
4+
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": ".NET Core Launch (console)",
9+
"type": "coreclr",
10+
"request": "launch",
11+
"preLaunchTask": "build",
12+
// If you have changed target frameworks, make sure to update the program path.
13+
"program": "${workspaceFolder}/tests/MGR.CommandLineParser.IntegrationTests/bin/Debug/netcoreapp2.0/MGR.CommandLineParser.IntegrationTests.dll",
14+
"args": [],
15+
"cwd": "${workspaceFolder}/tests/MGR.CommandLineParser.IntegrationTests",
16+
// For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window
17+
"console": "internalConsole",
18+
"stopAtEntry": false,
19+
"internalConsoleOptions": "openOnSessionStart"
20+
},
21+
{
22+
"name": ".NET Core Attach",
23+
"type": "coreclr",
24+
"request": "attach",
25+
"processId": "${command:pickProcess}"
26+
}
27+
,]
28+
}

.vscode/tasks.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "build",
6+
"command": "dotnet",
7+
"type": "process",
8+
"args": [
9+
"build",
10+
"${workspaceFolder}/tests/MGR.CommandLineParser.IntegrationTests/MGR.CommandLineParser.IntegrationTests.csproj"
11+
],
12+
"problemMatcher": "$msCompile"
13+
}
14+
]
15+
}

Directory.Build.props

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<Project>
2+
<PropertyGroup>
3+
<Product>MGR.CommandLineParser</Product>
4+
<TargetFramework>netstandard2.0</TargetFramework>
5+
<DocumentationFile>bin\$(Configuration)\netstandard2.0\$(MSBuildProjectName).xml</DocumentationFile>
6+
<LangVersion>latest</LangVersion>
7+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
8+
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
9+
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
10+
<WarningsAsErrors />
11+
<DebugType>portable</DebugType>
12+
<IsPackable>true</IsPackable>
13+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
14+
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)$(Product).ruleset</CodeAnalysisRuleSet>
15+
16+
<Authors>Matthias GROSPERRIN</Authors>
17+
<Company></Company>
18+
<PackageProjectUrl>https://github.com/mgrosperrin/commandlineparser</PackageProjectUrl>
19+
<RepositoryUrl>https://github.com/mgrosperrin/commandlineparser</RepositoryUrl>
20+
<Description>MGR.CommandLineParser is a multi-command line parser. It uses System.ComponentModel.DataAnnotations to declare the commands.</Description>
21+
<RepositoryType>git</RepositoryType>
22+
<Copyright>Copyright © Matthias GROSPERRIN</Copyright>
23+
<NeutralLanguage>en-US</NeutralLanguage>
24+
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
25+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
26+
</PropertyGroup>
27+
28+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
29+
<Optimize>true</Optimize>
30+
</PropertyGroup>
31+
32+
</Project>

GitVersionConfig.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
branches:
2+
develop:
3+
tag: alpha

MGR.CommandLineParser.sln

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,18 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MGR.CommandLineParser.Integ
1515
EndProject
1616
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleApp", "samples\SimpleApp\SimpleApp.csproj", "{F192F36D-7EDD-4E1E-82A4-95CA11665D2B}"
1717
EndProject
18-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CommonFiles", "CommonFiles", "{B5BDC6B3-1206-4DF3-A76C-22FE55064082}"
18+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SharedFiles", "SharedFiles", "{B5BDC6B3-1206-4DF3-A76C-22FE55064082}"
1919
ProjectSection(SolutionItems) = preProject
20-
src\CommonFiles\CommonAssemblyInfo.cs = src\CommonFiles\CommonAssemblyInfo.cs
21-
src\CommonFiles\VersionAssemblyInfo.cs = src\CommonFiles\VersionAssemblyInfo.cs
20+
src\SharedFiles\CommonAssemblyInfo.cs = src\SharedFiles\CommonAssemblyInfo.cs
21+
src\SharedFiles\VersionAssemblyInfo.cs = src\SharedFiles\VersionAssemblyInfo.cs
2222
EndProjectSection
2323
EndProject
2424
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{EF849FD3-293F-4CC8-B227-9680CF929A66}"
2525
ProjectSection(SolutionItems) = preProject
2626
.editorconfig = .editorconfig
2727
.gitattributes = .gitattributes
2828
.gitignore = .gitignore
29+
Directory.Build.props = Directory.Build.props
2930
LICENSE = LICENSE
3031
MGR.CommandLineParser.ruleset = MGR.CommandLineParser.ruleset
3132
MGR.CommandLineParser.runsettings = MGR.CommandLineParser.runsettings
@@ -35,8 +36,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
3536
EndProject
3637
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{07E4D8F7-2EDA-460D-B8E0-58B1BA42CD46}"
3738
ProjectSection(SolutionItems) = preProject
39+
azure-pipeline-build.yaml = azure-pipeline-build.yaml
3840
build\build.cake = build\build.cake
3941
build.ps1 = build.ps1
42+
GitVersionConfig.yaml = GitVersionConfig.yaml
4043
EndProjectSection
4144
EndProject
4245
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MGR.CommandLineParser.Tests.Commands", "tests\MGR.CommandLineParser.Tests.Commands\MGR.CommandLineParser.Tests.Commands.csproj", "{A422BACE-2758-4ABD-9DAA-ADF289FCCE65}"
@@ -45,11 +48,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{172E24C2-B
4548
ProjectSection(SolutionItems) = preProject
4649
docs\call-command-options.md = docs\call-command-options.md
4750
docs\customize-command-display.md = docs\customize-command-display.md
51+
docs\customize-internal-of-parser.md = docs\customize-internal-of-parser.md
4852
docs\index.md = docs\index.md
4953
EndProjectSection
5054
EndProject
5155
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{FB795A12-C939-492F-9377-4C468D01EF3C}"
5256
EndProject
57+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MGR.CommandLineParser.Command.Lambda", "src\MGR.CommandLineParser.Command.Lambda\MGR.CommandLineParser.Command.Lambda.csproj", "{9F5A0142-E0A1-45A2-961E-55611B4440AD}"
58+
EndProject
59+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MGR.CommandLineParser.Hosting", "src\MGR.CommandLineParser.Hosting\MGR.CommandLineParser.Hosting.csproj", "{40EAA8E2-7AFE-4ED1-A961-35BD7E424985}"
60+
EndProject
5361
Global
5462
GlobalSection(SolutionConfigurationPlatforms) = preSolution
5563
Debug|Any CPU = Debug|Any CPU
@@ -76,6 +84,14 @@ Global
7684
{A422BACE-2758-4ABD-9DAA-ADF289FCCE65}.Debug|Any CPU.Build.0 = Debug|Any CPU
7785
{A422BACE-2758-4ABD-9DAA-ADF289FCCE65}.Release|Any CPU.ActiveCfg = Release|Any CPU
7886
{A422BACE-2758-4ABD-9DAA-ADF289FCCE65}.Release|Any CPU.Build.0 = Release|Any CPU
87+
{9F5A0142-E0A1-45A2-961E-55611B4440AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
88+
{9F5A0142-E0A1-45A2-961E-55611B4440AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
89+
{9F5A0142-E0A1-45A2-961E-55611B4440AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
90+
{9F5A0142-E0A1-45A2-961E-55611B4440AD}.Release|Any CPU.Build.0 = Release|Any CPU
91+
{40EAA8E2-7AFE-4ED1-A961-35BD7E424985}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
92+
{40EAA8E2-7AFE-4ED1-A961-35BD7E424985}.Debug|Any CPU.Build.0 = Debug|Any CPU
93+
{40EAA8E2-7AFE-4ED1-A961-35BD7E424985}.Release|Any CPU.ActiveCfg = Release|Any CPU
94+
{40EAA8E2-7AFE-4ED1-A961-35BD7E424985}.Release|Any CPU.Build.0 = Release|Any CPU
7995
EndGlobalSection
8096
GlobalSection(SolutionProperties) = preSolution
8197
HideSolutionNode = FALSE
@@ -85,7 +101,10 @@ Global
85101
{22F60D05-F6DB-4410-80AD-E558EF1BDF6F} = {569ED12A-DA23-4457-B304-6B00C0CB335E}
86102
{7FD4CEB3-040B-4581-9B7C-EF8CB99B0951} = {569ED12A-DA23-4457-B304-6B00C0CB335E}
87103
{F192F36D-7EDD-4E1E-82A4-95CA11665D2B} = {0B84161D-C735-43F0-A525-4ED42CC4B17C}
104+
{B5BDC6B3-1206-4DF3-A76C-22FE55064082} = {FB795A12-C939-492F-9377-4C468D01EF3C}
88105
{A422BACE-2758-4ABD-9DAA-ADF289FCCE65} = {569ED12A-DA23-4457-B304-6B00C0CB335E}
106+
{9F5A0142-E0A1-45A2-961E-55611B4440AD} = {FB795A12-C939-492F-9377-4C468D01EF3C}
107+
{40EAA8E2-7AFE-4ED1-A961-35BD7E424985} = {FB795A12-C939-492F-9377-4C468D01EF3C}
89108
EndGlobalSection
90109
GlobalSection(ExtensibilityGlobals) = postSolution
91110
SolutionGuid = {827031C5-AE76-4B4C-9503-E13F15B497E9}

MGR.CommandLineParser.sln.DotSettings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
4949
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
5050
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpRenamePlacementToArrangementMigration/@EntryIndexedValue">True</s:Boolean>
51+
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
5152
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAddAccessorOwnerDeclarationBracesMigration/@EntryIndexedValue">True</s:Boolean>
5253
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002ECSharpPlaceAttributeOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
5354
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>

README.md

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,26 @@ _**Build status**_
1515
MGR.CommandLineParser is a multi-command line parser. It uses [System.ComponentModel.DataAnnotations](http://msdn.microsoft.com/fr-fr/library/system.componentmodel.dataannotations.aspx) to declare and validate the commands.
1616

1717
# How to use it ?
18-
You can find more docs [here](docs/index.md)
18+
You can find **more docs [here](docs/index.md)**
1919

20-
I. **Install MGR.CommandLineParser**
20+
**I. Install MGR.CommandLineParser**
2121

2222
MGR.CommandLineParser is available through [NuGet][nuget]:
2323

2424
PM> Install-Package MGR.CommandLineParser
2525

26-
II. **Declare your own commands**
26+
**II. Declare your own commands**
2727

28-
After adding MGR.CommandLineParser to your project, you have to define your own commands:
28+
After adding `MGR.CommandLineParser` to your project, you have to define your own commands:
2929

3030
* by implementing the interface `MGR.CommandLineParser.Command.ICommand`;
3131
* by extending the abstract class `MGR.CommandLineParser.Command.CommandBase`.
3232

3333
To personnalize your commands, you add some properties to your class, and implement `Execute` (if you directly implement `ICommand`), or override `ExecuteCommand` (if you override `CommandBase`).
34+
3435
For example :
3536
via `MGR.CommandLineParser.Command.ICommand`;
36-
```
37+
``` c#
3738
public class HelloWorldCommand : ICommand
3839
{
3940
[Display(ShortName = "n", Description = "The name to display")]
@@ -42,42 +43,42 @@ public class HelloWorldCommand : ICommand
4243

4344
public IList<string> Arguments {get; set;}
4445

45-
public int Execute()
46+
public Task<int> ExecuteAsync()
4647
{
4748
Console.WriteLine("Hello world {0} !", Name);
4849
if(Arguments.Count > 0)
4950
{
5051
Console.WriteLine("Arguments : {0}", string.Join("," Arguments));
5152
}
52-
return 0;
53+
return Task.FromResult(0);
5354
}
5455
}
5556
```
57+
5658
Via `MGR.CommandLineParser.Command.CommandBase`.
57-
```
59+
```c#
5860
public class HelloWorldCommand : CommandBase
5961
{
6062
[Display(ShortName = "n", Description = "The name to display")]
6163
[Required]
6264
public string Name {get; set;}
6365

64-
protected override int ExecuteCommand()
66+
protected override Task<int> ExecuteCommandasync()
6567
{
6668
Console.WriteLine("Hello world {0} !", Name);
6769
if(Arguments.Count > 0)
6870
{
6971
Console.WriteLine("Arguments : {0}", string.Join("," Arguments));
7072
}
71-
return 0;
73+
return Task.FromResult(0);
7274
}
7375
}
7476
```
7577

76-
III. **Parse the command line**
78+
**III. Parse the command line**
7779

78-
Then simplest way to parse the command line is to call the `Parse` method on a `IParser` instance :
79-
Then call the `Parse` method on a `IParser` instance :
80-
```
80+
The simplest way to parse the command line is to call the `Parse` method on a `IParser` instance :
81+
```c#
8182
var parserBuilder = new ParserBuilder();
8283
IParser parser = parserBuilder.BuildParser();
8384
CommandResult<ICommand> commandResult = parser.Parse(args);
@@ -87,28 +88,31 @@ if(commandResult.IsValid)
8788
}
8889
return commandResult.ReturnCode;
8990
```
91+
9092
Or if you have define only one command for your program :
91-
```
93+
```c#
9294
var parserBuilder = new ParserBuilder();
9395
IParser parser = parserBuilder.BuildParser();
9496
CommandResult<HelloWorldCommand> commandResult = parser.Parse<HelloWorldCommand>(args);
9597
if(commandResult.IsValid)
9698
{
97-
return commandResult.Execute();
99+
return commandResult.ExecuteAsync();
98100
}
99101
return commandResult.ReturnCode;
100102
```
101103

102104
In the first case, the first item in the `args` parameter must be the name of the command (the name of the type, minus the suffix `Command` if present).
103105
In the other case, the name of the command should be omitted.
104106

105-
Depending on the value of `args`, the result will be (when not providing the type of the command to the `Parse` method) :
107+
Depending on the value of `args`, the result will be (when not providing the type of the command to the `Parse` method):
106108

107-
* `args` is null : return code is `CommandResultCode.NoArgs` (-100);
108-
* `args` is an empty enumeration of string : return code is `CommandResultCode.NoCommandName` (-200) and the global help is printed to the console;
109-
* `args` doesn't begin by `HelloWorld` or `Help` (the default help command) : return code is `CommandResultCode.NoCommandFound` (-300) and the global help is printed to the console;
110-
* `args` is just `HelloWorld` : return code is `CommandResultCode.CommandParameterNotValid` (-400) and the help for the `HelloWorldCommand` is printed to the console;
111-
* `args` is `HelloWorld -n Matthias` : return code is `CommandResultCode.Ok` (0) and `Hello world Matthias !` is printed to the console.
109+
| Value of args | Result |
110+
|------|--------|
111+
|`null`|return code is `CommandResultCode.NoArgs` (-100)|
112+
|empty enumeration of string|return code is `CommandResultCode.NoCommandName` (-200) and the global help is printed to the console|
113+
|doesn't begin by `HelloWorld` or `Help` (the default help command)|return code is `CommandResultCode.NoCommandFound` (-300) and the global help is printed to the console|
114+
|`HelloWorld`|return code is `CommandResultCode.CommandParameterNotValid` (-400) and the help for the `HelloWorldCommand` is printed to the console|
115+
|`HelloWorld --name Matthias` or `HelloWorld -n Matthias`|return code is `CommandResultCode.Ok` (0) and `Hello world Matthias !` is printed to the console|
112116

113117

114118
[appveyor-dev]: https://ci.appveyor.com/project/mgrosperrin/commandlineparser

azure-pipeline-build.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: MGR.CommandLineParser - $(GitVersion.SemVer)$(rev:.r)
2+
3+
variables:
4+
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
5+
value: 1
6+
- name: System.Configuration
7+
value: Release
8+
- name: GitVersion.SemVer
9+
value: 1.0.0
10+
11+
jobs:
12+
- job: Main
13+
pool:
14+
vmImage: vs2017-win2016
15+
steps:
16+
- task: gittools.gitversion.gitversion-task.GitVersion@4
17+
displayName: 'Get version from Git'
18+
inputs:
19+
preferBundledVersion: false
20+
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'), or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['Build.SourceBranch'], 'refs/heads/dev'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release-')))
21+
22+
- task: DotNetCoreCLI@2
23+
displayName: 'dotnet build'
24+
inputs:
25+
arguments: '-c $(System.Configuration) -p:Version=$(GitVersion.SemVer)'
26+
27+
- task: DotNetCoreCLI@2
28+
displayName: 'dotnet test'
29+
inputs:
30+
command: test
31+
projects: 'tests/**Tests/*.csproj'
32+
arguments: '-c $(System.Configuration) --no-build /p:CollectCoverage=true /p:CoverletOutput=_BuildReports\Coverage\ /p:CoverletOutputFormat=cobertura /p:Exclude="[xunit.*]*%2c[*]JetBrains.*%2c[*Tests*]*"'
33+
34+
- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@1
35+
displayName: 'Generate code coverage report'
36+
inputs:
37+
reports: '**/*.IntegrationTests/_BuildReports/Coverage/coverage.cobertura.xml;**/*.UnitTests/_BuildReports/Coverage/coverage.cobertura.xml'
38+
targetdir: '$(Build.ArtifactStagingDirectory)/Coverage'
39+
condition: succeededOrFailed()
40+
41+
- task: PublishCodeCoverageResults@1
42+
displayName: 'Publish code coverage from $(Build.ArtifactStagingDirectory)/Coverage/Cobertura.xml'
43+
inputs:
44+
codeCoverageTool: Cobertura
45+
summaryFileLocation: '$(Build.ArtifactStagingDirectory)/Coverage/Cobertura.xml'
46+
reportDirectory: '$(Build.ArtifactStagingDirectory)/Coverage'
47+
condition: succeededOrFailed()
48+
49+
- task: CopyFiles@2
50+
displayName: 'Copy Files to artifacts folder'
51+
inputs:
52+
SourceFolder: src/
53+
Contents: '**/MGR.CommandLineParser.*.nupkg'
54+
TargetFolder: '$(Build.ArtifactStagingDirectory)/nuget'
55+
flattenFolders: true
56+
57+
- task: PublishBuildArtifacts@1
58+
displayName: 'Publish Artifact: packages'
59+
inputs:
60+
PathtoPublish: '$(Build.ArtifactStagingDirectory)/nuget'
61+
ArtifactName: packages
62+
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'), or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['Build.SourceBranch'], 'refs/heads/dev'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release-')))

build.ps1

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ Param(
55
[string]$Configuration = "Release",
66
[ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")]
77
[string]$Verbosity = "Minimal",
8-
[string]$MyGetFeed,
9-
[string]$BuildNumber,
8+
[string]$MyGetFeed,
9+
[string]$BuildNumber,
1010
[switch]$Experimental,
1111
[switch]$WhatIf
1212
)
13+
$env:DOTNET_CLI_TELEMETRY_OPTOUT = "1"
1314

1415
$BUILD_DIR = Join-Path $PSScriptRoot "build"
1516
$ARTIFACTS_DIR = Join-Path $PSScriptRoot "artifacts"
@@ -18,8 +19,8 @@ $NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe"
1819
$CAKE_EXE = Join-Path $TOOLS_DIR "Cake/Cake.exe"
1920

2021
if(!(Test-Path $TOOLS_DIR)){
21-
Write-Host "Create tools directory"
22-
New-Item -ItemType Directory $TOOLS_DIR
22+
Write-Host "Create tools directory"
23+
New-Item -ItemType Directory $TOOLS_DIR
2324
}
2425

2526
# Should we use experimental build of Roslyn?
@@ -36,7 +37,7 @@ if($WhatIf.IsPresent) {
3637

3738
# Try download NuGet.exe if do not exist.
3839
if (!(Test-Path $NUGET_EXE)) {
39-
Write-Host "Download Nuget.exe"
40+
Write-Host "Download Nuget.exe"
4041
Invoke-WebRequest -Uri https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -OutFile $NUGET_EXE
4142
}
4243

0 commit comments

Comments
 (0)