Skip to content

Commit

Permalink
code cleanup (#305)
Browse files Browse the repository at this point in the history
* Updated lps settings

* updated editor config

* ran code cleanup to get files in sync with the general rules

* make cancellation tests more reslient for failure

* Updated tools and remove grm (global tool is used elsewhere)

* Updated readme

* Update azure-pipelines

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
david-driscoll and mergify[bot] authored Aug 11, 2020
1 parent 6c3a7fc commit 6371386
Show file tree
Hide file tree
Showing 1,024 changed files with 15,629 additions and 13,716 deletions.
202 changes: 93 additions & 109 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,123 +1,107 @@
trigger:
batch: true
branches:
include:
- master
- refs/tags/*
paths:
exclude:
- '**/*.md'
- '.appveyor.yml'
- '.codecov.yml'
- 'GitVersion.yml'
- 'GitReleaseManager.yaml'
- .vscode/*
- .git*
- .editorconfig
- .nuke
- LICENSE
batch: true
branches:
include:
- master
- next
- refs/tags/*
paths:
exclude:
- '**/*.md'
- '.appveyor.yml'
- '.codecov.yml'
- 'GitVersion.yml'
- 'GitReleaseManager.yaml'
- .vscode/*
- .git*
- .editorconfig
- .nuke
- LICENSE

pr:
autoCancel: true
branches:
include:
- master
autoCancel: true
branches:
include:
- master
- next

resources:
repositories:
- repository: rsg
type: github
name: RocketSurgeonsGuild/AzureDevopsTemplates
ref: refs/tags/v0.12.0
endpoint: github
repositories:
- repository: rsg
type: github
name: RocketSurgeonsGuild/AzureDevopsTemplates
ref: refs/tags/v0.13.0
endpoint: github

variables:
- name: CONFIGURATION
value: Release
- name: VERBOSITY
value: Normal
- name: COVERAGE
value: '$(Agent.BuildDirectory)/c'
- name: ARTIFACTS
value: $(Build.ArtifactStagingDirectory)
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
value: 'true'
- name: CodeCovToken
value: 'd122bf99-4ca6-4a7c-a7ff-90468bcc7703'
# Fixes the github package repo warnings on restore
- name: EmitAssetsLogMessages
value: false
- name: HideWarningsAndErrors
value: true
- name: CONFIGURATION
value: Release
- name: VERBOSITY
value: Normal
- name: COVERAGE
value: '$(Agent.BuildDirectory)/c'
- name: ARTIFACTS
value: $(Build.ArtifactStagingDirectory)
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
value: 'true'
- name: CodeCovToken
value: 'd122bf99-4ca6-4a7c-a7ff-90468bcc7703'

jobs:
- template: jobs/gitversion.yml@rsg
- template: jobs/publish-release.yml@rsg
parameters:
GitHubPackages: false
PublishNuGetPackagesFromArtifact: 'NuGet - Windows'

- job: Build
strategy:
matrix:
Windows:
BuildName: 'Windows'
ImageName: 'windows-latest'
Linux:
BuildName: 'Linux'
ImageName: 'ubuntu-latest'
macOS:
BuildName: 'macOS'
ImageName: 'macOS-latest'
pool:
vmImage: $(ImageName)
steps:
- template: support/mono.yml@rsg
- template: support/install-dotnet.yml@rsg
parameters:
DotNetSdk:
- '2.x'
- '3.x'
- template: support/gitversion-hack.yml@rsg
- job: Build
strategy:
matrix:
Windows:
BuildName: 'Windows'
ImageName: 'windows-latest'
Linux:
BuildName: 'Linux'
ImageName: 'ubuntu-latest'
macOS:
BuildName: 'macOS'
ImageName: 'macOS-latest'
pool:
vmImage: $(ImageName)
steps:
- template: support/mono.yml@rsg
# - ${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags/v') }}:
# - template: support/download-release-notes.yml@rsg
- template: support/install-dotnet.yml@rsg
parameters:
DotNetSdk:
- '2.x'
- '3.x'

- task: DotNetCoreCLI@2
displayName: 'dotnet tool restore'
inputs:
command: custom
custom: tool
arguments: 'restore'
- task: DotNetCoreCLI@2
displayName: 'dotnet tool restore'
inputs:
command: custom
custom: tool
arguments: 'restore'

- task: DotNetCoreCLI@2
displayName: 'dotnet restore'
inputs:
command: restore
feedsToUse: config
nugetConfigPath: NuGet.config
verbosityRestore: Minimal
- task: DotNetCoreCLI@2
displayName: 'dotnet restore'
inputs:
command: restore
feedsToUse: config
nugetConfigPath: NuGet.config
verbosityRestore: Minimal

- template: ./azure-pipelines.nuke.yml
parameters:
Artifacts: $(Artifacts)
Configuration: $(Configuration)
Coverage: $(Coverage)
- template: ./azure-pipelines.nuke.yml
parameters:
Artifacts: $(Artifacts)
Configuration: $(Configuration)
Coverage: $(Coverage)

- template: support/publish-artifacts.yml@rsg
parameters:
Artifacts: $(Artifacts)
Configuration: $(Configuration)
Coverage: $(Coverage)
Postfix: ' - $(BuildName)'
PublishVSTest: true
- ${{ if and(or(startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), eq(variables['Build.SourceBranch'], 'refs/heads/master')), ne(variables['System.PullRequest.IsFork'], 'true')) }}:
- job: Publish_NuGet_Packages
displayName: "Publish NuGet Packages"
pool:
vmImage: "windows-latest"
dependsOn:
- Build
steps:
- checkout: none
- download: current
displayName: "Download NuGet Packages"
artifact: 'NuGet - Windows'
- template: support/nuget-push.yml@rsg
parameters:
Artifacts: "$(Pipeline.Workspace)"
GitHubPackages: false
MyGetPackages: true
- template: support/publish-artifacts.yml@rsg
parameters:
Artifacts: $(Artifacts)
Configuration: $(Configuration)
Coverage: $(Coverage)
Postfix: ' - $(BuildName)'
PublishVSTest: true
47 changes: 22 additions & 25 deletions .build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@
[MSBuildVerbosityMapping]
[NuGetVerbosityMapping]
public partial class Solution : NukeBuild,
ICanRestoreWithDotNetCore,
ICanBuildWithDotNetCore,
ICanTestWithDotNetCore,
ICanPackWithDotNetCore,
IHaveDataCollector,
ICanClean,
ICanUpdateReadme,
IGenerateCodeCoverageReport,
IGenerateCodeCoverageSummary,
IGenerateCodeCoverageBadges,
IHaveConfiguration<Configuration>,
ICanLint
ICanRestoreWithDotNetCore,
ICanBuildWithDotNetCore,
ICanTestWithDotNetCore,
ICanPackWithDotNetCore,
IHaveDataCollector,
ICanClean,
ICanUpdateReadme,
IGenerateCodeCoverageReport,
IGenerateCodeCoverageSummary,
IGenerateCodeCoverageBadges,
IHaveConfiguration<Configuration>,
ICanLint
{
/// <summary>
/// Support plugins are available for:
Expand All @@ -40,31 +40,28 @@ public partial class Solution : NukeBuild,
/// </summary>
public static int Main() => Execute<Solution>(x => x.Default);

[OptionalGitRepository]
public GitRepository? GitRepository { get; }
[OptionalGitRepository] public GitRepository? GitRepository { get; }

private Target Default => _ => _
.DependsOn(Restore)
.DependsOn(Build)
.DependsOn(Test)
.DependsOn(Pack);
.DependsOn(Restore)
.DependsOn(Build)
.DependsOn(Test)
.DependsOn(Pack);

public Target Build => _ => _.Inherit<ICanBuildWithDotNetCore>(x => x.CoreBuild);

public Target Pack => _ => _.Inherit<ICanPackWithDotNetCore>(x => x.CorePack)
.DependsOn(Clean);
.DependsOn(Clean);

[ComputedGitVersion]
public GitVersion GitVersion { get; } = null!;
[ComputedGitVersion] public GitVersion GitVersion { get; } = null!;

public Target Clean => _ => _.Inherit<ICanClean>(x => x.Clean);
public Target Restore => _ => _.Inherit<ICanRestoreWithDotNetCore>(x => x.CoreRestore);
public Target Test => _ => _.Inherit<ICanTestWithDotNetCore>(x => x.CoreTest);

public Target BuildVersion => _ => _.Inherit<IHaveBuildVersion>(x => x.BuildVersion)
.Before(Default)
.Before(Clean);
.Before(Default)
.Before(Clean);

[Parameter("Configuration to build")]
public Configuration Configuration { get; } = IsLocalBuild ? Configuration.Debug : Configuration.Release;
[Parameter("Configuration to build")] public Configuration Configuration { get; } = IsLocalBuild ? Configuration.Debug : Configuration.Release;
}
2 changes: 1 addition & 1 deletion .build/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ public class Configuration : Enumeration
public static readonly Configuration Release = new Configuration { Value = nameof(Release) };

public static implicit operator string(Configuration configuration) => configuration.Value;
}
}
Loading

0 comments on commit 6371386

Please sign in to comment.