Skip to content

Commit

Permalink
Update build process (#70)
Browse files Browse the repository at this point in the history
* Update build process

* Update build module version

* Bump build module version

Co-authored-by: James Dawson <james.dawson@endjin.com>
  • Loading branch information
MikeEvansLarah and JamesDawson authored Oct 13, 2022
1 parent 3cf8cad commit 31407c6
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 78 deletions.
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -353,4 +353,12 @@ MigrationBackup/
/Solutions/**/local.settings.json

.docs/
*.feature.cs
*.feature.cs

# Cobertura code coverage file
coverage.cobertura.xml

# Scripted build artifacts
/_codeCoverage
/_packages
*.sbom.*
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,6 @@
"Microsoft.Extensions.Options": "6.0.0"
}
},
"Roslynator.Analyzers": {
"type": "Direct",
"requested": "[4.1.1, )",
"resolved": "4.1.1",
"contentHash": "3cPVlrB1PytlO1ztZZBOExDKQWpMZgI15ZDa0BqLu0l6xv+xIRfEpqjNRcpvUy3aLxWTkPgSKZbbaO+VoFEJ1g=="
},
"StyleCop.Analyzers": {
"type": "Direct",
"requested": "[1.2.0-beta.435, )",
"resolved": "1.2.0-beta.435",
"contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==",
"dependencies": {
"StyleCop.Analyzers.Unstable": "1.2.0.435"
}
},
"System.CommandLine": {
"type": "Direct",
"requested": "[2.0.0-beta4.22272.1, )",
Expand Down Expand Up @@ -701,11 +686,6 @@
"resolved": "4.3.0",
"contentHash": "VB5cn/7OzUfzdnC8tqAIMQciVLiq2epm2NrAm1E9OjNRyG4lVhfR61SMcLizejzQP8R8Uf/0l5qOIbUEi+RdEg=="
},
"StyleCop.Analyzers.Unstable": {
"type": "Transitive",
"resolved": "1.2.0.435",
"contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg=="
},
"System.AppContext": {
"type": "Transitive",
"resolved": "4.3.0",
Expand Down Expand Up @@ -1652,47 +1632,47 @@
"corvus.storage.azure.blobstorage": {
"type": "Project",
"dependencies": {
"Azure.Storage.Blobs": "[12.13.1, )",
"Corvus.Storage.Common": "[1.0.0, )"
"Azure.Storage.Blobs": "12.13.1",
"Corvus.Storage.Common": "1.0.0"
}
},
"corvus.storage.azure.cosmos": {
"type": "Project",
"dependencies": {
"Corvus.Storage.Common": "[1.0.0, )",
"Microsoft.Azure.Cosmos": "[3.30.1, )"
"Corvus.Storage.Common": "1.0.0",
"Microsoft.Azure.Cosmos": "3.30.1"
}
},
"corvus.storage.azure.tablestorage": {
"type": "Project",
"dependencies": {
"Azure.Data.Tables": "[12.6.1, )",
"Corvus.Storage.Common": "[1.0.0, )"
"Azure.Data.Tables": "12.6.1",
"Corvus.Storage.Common": "1.0.0"
}
},
"corvus.storage.common": {
"type": "Project",
"dependencies": {
"Corvus.Identity.Azure": "[3.1.0, )",
"Microsoft.Extensions.Configuration.Binder": "[3.1.*, )"
"Corvus.Identity.Azure": "3.1.0",
"Microsoft.Extensions.Configuration.Binder": "3.1.0"
}
},
"corvus.storage.examples.azure.blobstorage": {
"type": "Project",
"dependencies": {
"Corvus.Storage.Azure.BlobStorage": "[1.0.0, )"
"Corvus.Storage.Azure.BlobStorage": "1.0.0"
}
},
"corvus.storage.examples.azure.cosmos": {
"type": "Project",
"dependencies": {
"Corvus.Storage.Azure.Cosmos": "[1.0.0, )"
"Corvus.Storage.Azure.Cosmos": "1.0.0"
}
},
"corvus.storage.examples.azure.tables": {
"type": "Project",
"dependencies": {
"Corvus.Storage.Azure.TableStorage": "[1.0.0, )"
"Corvus.Storage.Azure.TableStorage": "1.0.0"
}
}
}
Expand Down
50 changes: 15 additions & 35 deletions Solutions/Corvus.Storage.Specs/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,13 @@
"Microsoft.Extensions.DependencyInjection": {
"type": "Direct",
"requested": "[6.0.*, )",
"resolved": "6.0.0",
"contentHash": "k6PWQMuoBDGGHOQTtyois2u4AwyVcIwL2LaSLlTZQm2CYcJ1pxbt6jfAnpWmzENA/wfrYRI/X9DTLoUkE4AsLw==",
"resolved": "6.0.1",
"contentHash": "vWXPg3HJQIpZkENn1KWq8SfbqVujVD7S7vIAyFXXqK5xkf1Vho+vG0bLBCHxU36lD1cLLtmGpfYf0B3MYFi9tQ==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0",
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
},
"Roslynator.Analyzers": {
"type": "Direct",
"requested": "[4.1.1, )",
"resolved": "4.1.1",
"contentHash": "3cPVlrB1PytlO1ztZZBOExDKQWpMZgI15ZDa0BqLu0l6xv+xIRfEpqjNRcpvUy3aLxWTkPgSKZbbaO+VoFEJ1g=="
},
"StyleCop.Analyzers": {
"type": "Direct",
"requested": "[1.2.0-beta.435, )",
"resolved": "1.2.0-beta.435",
"contentHash": "TADk7vdGXtfTnYCV7GyleaaRTQjfoSfZXprQrVMm7cSJtJbFc1QIbWPyLvrgrfGdfHbGmUPvaN4ODKNxg2jgPQ==",
"dependencies": {
"StyleCop.Analyzers.Unstable": "1.2.0.435"
}
},
"Azure.Core": {
"type": "Transitive",
"resolved": "1.25.0",
Expand Down Expand Up @@ -342,10 +327,10 @@
},
"Microsoft.Extensions.Configuration.Binder": {
"type": "Transitive",
"resolved": "3.1.29",
"contentHash": "d0Ceo2dna7Y5gLJo9CCHUdW8NtNd9WX0MBP1pb9w4SPMpp+qVBQhLXpeeA+HNpUpCkSUjk9xKbgOYkFZvVDLPg==",
"resolved": "3.1.30",
"contentHash": "PfIIHuf1NpKzegBw/3FdOcriNqQHxQjQauOBi1RqFgq7Pm99je+tQ9U2P17oc04W7x9CTtDKxefOgjRPADHZsQ==",
"dependencies": {
"Microsoft.Extensions.Configuration": "3.1.29"
"Microsoft.Extensions.Configuration": "3.1.30"
}
},
"Microsoft.Extensions.Configuration.FileExtensions": {
Expand Down Expand Up @@ -815,11 +800,6 @@
"SpecFlow": "[3.9.74]"
}
},
"StyleCop.Analyzers.Unstable": {
"type": "Transitive",
"resolved": "1.2.0.435",
"contentHash": "ouwPWZxbOV3SmCZxIRqHvljkSzkCyi1tDoMzQtDb/bRP8ctASV/iRJr+A2Gdj0QLaLmWnqTWDrH82/iP+X80Lg=="
},
"System.AppContext": {
"type": "Transitive",
"resolved": "4.1.0",
Expand Down Expand Up @@ -1808,36 +1788,36 @@
"corvus.storage.azure.blobstorage": {
"type": "Project",
"dependencies": {
"Azure.Storage.Blobs": "[12.13.1, )",
"Corvus.Storage.Common": "[1.0.0, )"
"Azure.Storage.Blobs": "12.13.1",
"Corvus.Storage.Common": "1.0.0"
}
},
"corvus.storage.azure.cosmos": {
"type": "Project",
"dependencies": {
"Corvus.Storage.Common": "[1.0.0, )",
"Microsoft.Azure.Cosmos": "[3.30.1, )"
"Corvus.Storage.Common": "1.0.0",
"Microsoft.Azure.Cosmos": "3.30.1"
}
},
"corvus.storage.azure.tablestorage": {
"type": "Project",
"dependencies": {
"Azure.Data.Tables": "[12.6.1, )",
"Corvus.Storage.Common": "[1.0.0, )"
"Azure.Data.Tables": "12.6.1",
"Corvus.Storage.Common": "1.0.0"
}
},
"corvus.storage.common": {
"type": "Project",
"dependencies": {
"Corvus.Identity.Azure": "[3.1.0, )",
"Microsoft.Extensions.Configuration.Binder": "[3.1.*, )"
"Corvus.Identity.Azure": "3.1.0",
"Microsoft.Extensions.Configuration.Binder": "3.1.0"
}
},
"corvus.storage.sql": {
"type": "Project",
"dependencies": {
"Corvus.Storage.Common": "[1.0.0, )",
"Microsoft.Data.SqlClient": "[5.0.0, )"
"Corvus.Storage.Common": "1.0.0",
"Microsoft.Data.SqlClient": "5.0.0"
}
}
}
Expand Down
60 changes: 49 additions & 11 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,20 @@
The path to import the Endjin.RecommendedPractices.Build module from. This is useful when
testing pre-release versions of the Endjin.RecommendedPractices.Build that are not yet
available in the PowerShell Gallery.
.PARAMETER BuildModuleVersion
The version of the Endjin.RecommendedPractices.Build module to import. This is useful when
testing pre-release versions of the Endjin.RecommendedPractices.Build that are not yet
available in the PowerShell Gallery.
.PARAMETER InvokeBuildModuleVersion
The version of the InvokeBuild module to be used.
#>
[CmdletBinding()]
param (
[Parameter(Position=0)]
[string[]] $Tasks = @("."),

[Parameter()]
[string] $Configuration = "Release",
[string] $Configuration = "Debug",

[Parameter()]
[string] $BuildRepositoryUri = "",
Expand All @@ -62,17 +68,23 @@ param (
[switch] $Clean,

[Parameter()]
[string] $BuildModulePath
[string] $BuildModulePath,

[Parameter()]
[version] $BuildModuleVersion = "0.2.15",

[Parameter()]
[version] $InvokeBuildModuleVersion = "5.7.1"
)

$ErrorActionPreference = $ErrorActionPreference ? $ErrorActionPreference : 'Stop'
$InformationPreference = $InformationAction ? $InformationAction : 'Continue'
$InformationPreference = 'Continue'

$here = Split-Path -Parent $PSCommandPath

#region InvokeBuild setup
if (!(Get-Module -ListAvailable InvokeBuild)) {
Install-Module InvokeBuild -RequiredVersion 5.7.1 -Scope CurrentUser -Force -Repository PSGallery
Install-Module InvokeBuild -RequiredVersion $InvokeBuildModuleVersion -Scope CurrentUser -Force -Repository PSGallery
}
Import-Module InvokeBuild
# This handles calling the build engine when this file is run like a normal PowerShell script
Expand All @@ -89,52 +101,78 @@ if ($MyInvocation.ScriptName -notlike '*Invoke-Build.ps1') {
}
#endregion

# Import shared tasks and initialise build framework
#region Import shared tasks and initialise build framework
if (!($BuildModulePath)) {
if (!(Get-Module -ListAvailable Endjin.RecommendedPractices.Build)) {
if (!(Get-Module -ListAvailable Endjin.RecommendedPractices.Build | ? { $_.Version -eq $BuildModuleVersion })) {
Write-Information "Installing 'Endjin.RecommendedPractices.Build' module..."
Install-Module Endjin.RecommendedPractices.Build -RequiredVersion 0.1.0 -AllowPrerelease -Scope CurrentUser -Force -Repository PSGallery
Install-Module Endjin.RecommendedPractices.Build -RequiredVersion $BuildModuleVersion -Scope CurrentUser -Force -Repository PSGallery
}
$BuildModulePath = "Endjin.RecommendedPractices.Build"
}
else {
Write-Information "BuildModulePath: $BuildModulePath"
}
Import-Module $BuildModulePath -Force
Import-Module $BuildModulePath -RequiredVersion $BuildModuleVersion -Force

# Load the build process & tasks
. Endjin.RecommendedPractices.Build.tasks
#endregion


#
# Build process control options
#
$SkipInit = $false
$SkipVersion = $false
$SkipBuild = $false
$CleanBuild = $false
$CleanBuild = $Clean
$SkipTest = $false
$SkipTestReport = $false
$SkipAnalysis = $false
$SkipPackage = $false
$SkipPublish = $false

# Advanced build settings
$EnableGitVersionAdoVariableWorkaround = $false

#
# Build process configuration
#
$SolutionToBuild = (Resolve-Path (Join-Path $here ".\Solutions\Corvus.Storage.sln")).Path
$ProjectsToPublish = @(
# "Solutions/MySolution/MyWebSite/MyWebSite.csproj"
)
$NuSpecFilesToPackage = @(
# "Solutions/MySolution/MyProject/MyProject.nuspec"
)

#
# Specify files to exclude from code coverage
# This option is for excluding generated code
# - Use file path or directory path with globbing (e.g dir1/*.cs)
# - Use single or multiple paths (separated by comma) (e.g. **/dir1/class1.cs,**/dir2/*.cs,**/dir3/**/*.cs)
#
$ExcludeFilesFromCodeCoverage = ""

# Synopsis: Build, Test and Package
task . FullBuild


# build extensibility tasks
task RunFirst {}
task PreInit {}
task PostInit {}
task PreVersion {}
task PostVersion {}
task PreBuild {}
task PostBuild {}
task PreTest {}
task PostTest {}
task PreTestReport {}
task PostTestReport {}
task PreAnalysis {}
task PostAnalysis {}
task PrePackage {}
task PostPackage {}
task PrePublish {}
task PostPublish {}
task RunLast {}

0 comments on commit 31407c6

Please sign in to comment.