From 2edc336ff6d04aa087c15605037cb55f382ca696 Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Tue, 29 Sep 2020 14:15:47 +0100 Subject: [PATCH 01/31] move nuspecs next to csproj --- build/Nuspecs/Our.ModelsBuilder.Web.nuspec | 44 --- build/build-bootstrap.ps1 | 92 ----- build/build.ps1 | 321 ------------------ build/sem.ver | 1 + .../Nuget/Our.ModelsBuilder.Web.nuspec | 44 +++ .../Nuget}/web.config.install.xdt | 0 .../Nuget}/web.config.uninstall.xdt | 0 .../Our.ModelsBuilder.Web.csproj | 3 + src/Our.ModelsBuilder.sln | 10 - .../Nuget}/Our.ModelsBuilder.nuspec | 4 +- .../Our.ModelsBuilder.csproj | 4 +- .../Our.ModelsBuilder.nuspec | 33 ++ 12 files changed, 86 insertions(+), 470 deletions(-) delete mode 100644 build/Nuspecs/Our.ModelsBuilder.Web.nuspec delete mode 100644 build/build-bootstrap.ps1 create mode 100644 build/sem.ver create mode 100644 src/Our.ModelsBuilder.Web/Nuget/Our.ModelsBuilder.Web.nuspec rename {build/Nuspecs/ModelsBuilder => src/Our.ModelsBuilder.Web/Nuget}/web.config.install.xdt (100%) rename {build/Nuspecs/ModelsBuilder => src/Our.ModelsBuilder.Web/Nuget}/web.config.uninstall.xdt (100%) rename {build/Nuspecs => src/Our.ModelsBuilder/Nuget}/Our.ModelsBuilder.nuspec (84%) create mode 100644 src/Our.ModelsBuilder/Our.ModelsBuilder.nuspec diff --git a/build/Nuspecs/Our.ModelsBuilder.Web.nuspec b/build/Nuspecs/Our.ModelsBuilder.Web.nuspec deleted file mode 100644 index 28bfc8e8..00000000 --- a/build/Nuspecs/Our.ModelsBuilder.Web.nuspec +++ /dev/null @@ -1,44 +0,0 @@ - - - - Our.ModelsBuilder.Web - $version$ - Our ModelsBuilder Web - The Umbraco Community - The Umbraco Community - MIT - false - https://raw.githubusercontent.com/ZpqrtBnk/Our.ModelsBuilder/v4/dev/etc/logo.png - - Our ModelsBuilder Web Integration for Umbraco. - https://github.com/ZpqrtBnk/Our.ModelsBuilder - $copyright$ - en-US - umbraco - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/build/build-bootstrap.ps1 b/build/build-bootstrap.ps1 deleted file mode 100644 index 71a25bfd..00000000 --- a/build/build-bootstrap.ps1 +++ /dev/null @@ -1,92 +0,0 @@ - - # this script should be dot-sourced into the build.ps1 scripts - # right after the parameters declaration - # ie - # . "$PSScriptRoot\build-bootstrap.ps1" - - # THIS FILE IS DISTRIBUTED AS PART OF UMBRACO.BUILD - # DO NOT MODIFY IT - ALWAYS USED THE COMMON VERSION - - # ################################################################ - # BOOTSTRAP - # ################################################################ - - # reset errors - $error.Clear() - - # ensure we have temp folder for downloads - $scriptRoot = "$PSScriptRoot" - $scriptTemp = "$scriptRoot\temp" - if (-not (test-path $scriptTemp)) { mkdir $scriptTemp > $null } - - # get NuGet - $cache = 4 - $nuget = "$scriptTemp\nuget.exe" - if (-not $local) - { - $source = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" - if ((test-path $nuget) -and ((ls $nuget).CreationTime -lt [DateTime]::Now.AddDays(-$cache))) - { - Remove-Item $nuget -force -errorAction SilentlyContinue > $null - } - if (-not (test-path $nuget)) - { - Write-Host "Download NuGet..." - Invoke-WebRequest $source -OutFile $nuget - if (-not $?) { throw "Failed to download NuGet." } - } - } - elseif (-not (test-path $nuget)) - { - throw "Failed to locate NuGet.exe." - } - - # NuGet notes - # As soon as we use -ConfigFile, NuGet uses that file, and only that file, and does not - # merge configuration from system level. See comments in NuGet.Client solution, class - # NuGet.Configuration.Settings, method LoadDefaultSettings. - # For NuGet to merge configurations, it needs to "find" the file in the current directory, - # or above. Which means we cannot really use -ConfigFile but instead have to have Umbraco's - # NuGet.config file at root, and always run NuGet.exe while at root or in a directory below - # root. - - $solutionRoot = "$scriptRoot\.." - $testPwd = [System.IO.Path]::GetFullPath($pwd.Path) + "\" - $testRoot = [System.IO.Path]::GetFullPath($solutionRoot) + "\" - if (-not $testPwd.ToLower().StartsWith($testRoot.ToLower())) - { - throw "Cannot run outside of the solution's root." - } - - # get the build system - if (-not $local) - { - $params = "-OutputDirectory", $scriptTemp, "-Verbosity", "quiet", "-PreRelease" - &$nuget install Umbraco.Build @params - if (-not $?) { throw "Failed to download Umbraco.Build." } - } - - # ensure we have the build system - $ubuildPath = ls "$scriptTemp\Umbraco.Build.*" | sort -property CreationTime -descending | select -first 1 - if (-not $ubuildPath) - { - throw "Failed to locate the build system." - } - - # boot the build system - # this creates $global:ubuild - return &"$ubuildPath\ps\Boot.ps1" - - # at that point the build.ps1 script must boot the build system - # eg - # $ubuild.Boot($ubuildPath.FullName, [System.IO.Path]::GetFullPath("$scriptRoot\.."), - # @{ Local = $local; With7Zip = $false; WithNode = $false }, - # @{ continue = $continue }) - # if (-not $?) { throw "Failed to boot the build system." } - # - # and it's good practice to report - # eg - # Write-Host "Umbraco.Whatever Build" - # Write-Host "Umbraco.Build v$($ubuild.BuildVersion)" - - # eof diff --git a/build/build.ps1 b/build/build.ps1 index 00e1e1ea..e69de29b 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -1,321 +0,0 @@ - - param ( - # get, don't execute - [Parameter(Mandatory=$false)] - [Alias("g")] - [switch] $get = $false, - - # run local, don't download, assume everything is ready - [Parameter(Mandatory=$false)] - [Alias("l")] - [Alias("loc")] - [switch] $local = $false, - - # keep the build directories, don't clear them - [Parameter(Mandatory=$false)] - [Alias("c")] - [Alias("cont")] - [switch] $continue = $false, - - # execute a command - [Parameter(Mandatory=$false, ValueFromRemainingArguments=$true)] - [String[]] - $command - ) - - # ################################################################ - # BOOTSTRAP - # ################################################################ - - # create and boot the buildsystem - $ubuild = &"$PSScriptRoot\build-bootstrap.ps1" - if (-not $?) { return } - $ubuild.Boot($PSScriptRoot, - @{ Local = $local; With7Zip = $false; WithNode = $false; VsMajor = "15"; VsPreview = $false; }, - @{ Continue = $continue }) - if ($ubuild.OnError()) { return } - - Write-Host "Our.ModelsBuilder Build" - Write-Host "Umbraco.Build v$($ubuild.BuildVersion)" - - # ################################################################ - # TASKS - # ################################################################ - - $ubuild.DefineMethod("ClearBuild", - { - if (test-path $this.BuildTemp) { remove-item $this.BuildTemp -force -recurse -errorAction SilentlyContinue > $null } - if (test-path $this.BuildOutput) { remove-item $this.BuildOutput -force -recurse -errorAction SilentlyContinue > $null } - - mkdir $this.BuildTemp > $null - mkdir $this.BuildOutput > $null - }) - - $ubuild.DefineMethod("SetMoreUmbracoVersion", - { - param ( $semver ) - - # Edit VSIX - Write-Host "Update VSIX manifest." - $vsixFile = "$($this.SolutionRoot)\src\Our.ModelsBuilder.Extension\source.extension.vsixmanifest" - [xml] $vsixXml = Get-Content $vsixFile - $xmlNameTable = New-Object System.Xml.NameTable - $xmlNameSpace = New-Object System.Xml.XmlNamespaceManager($xmlNameTable) - $xmlNameSpace.AddNamespace("vsx", "http://schemas.microsoft.com/developer/vsx-schema/2011") - $xmlNameSpace.AddNamespace("d", "http://schemas.microsoft.com/developer/vsx-schema-design/2011") - $versionNode = $vsixXml.SelectSingleNode("/vsx:PackageManifest/vsx:Metadata/vsx:Identity/@Version", $xmlNameSpace) - - # cannot be semver because it has to be a.b.c.d format - # so we have to invent some sort of "build" - the spaghetti way - $current = $versionNode.Value - $pos = $current.LastIndexOf('.') - $current = $current.Substring($pos + 1) - $now = [DateTime]::Now.ToString("yyMMdd") - if ($current.Length -ne 9) - { - $build = $now + "001" - } - else - { - if (-not $current.StartsWith($now)) - { - $build = $now + "001" - } - else - { - $i = 0 - if ([int]::TryParse($current.Substring(6), [ref]$i)) - { - $i += 1 - $build = $now + $i.ToString("000") - } - else - { - $build = $now + "666" - } - } - } - - $release = "" + $semver.Major + "." + $semver.Minor + "." + $semver.Patch - $versionNode.Value = "$release.$build" - $vsixXml.Save($vsixFile) - }) - - $ubuild.DefineMethod("RestoreNuGet", - { - Write-Host "Restore NuGet" - Write-Host "Logging to $($this.BuildTemp)\nuget.restore.log" - &$this.BuildEnv.NuGet restore "$($this.SolutionRoot)\src\Our.ModelsBuilder.sln" > "$($this.BuildTemp)\nuget.restore.log" - # temp - ignore errors, because of a circular dependency between U and MB - # we'll eventually move Our.ModelsBuilder (and only that one) into Core, - # once I have decided what to do with the work-in-progress stuff - #if (-not $?) { throw "Failed to restore NuGet packages." } - $error.Clear() - }) - - $ubuild.DefineMethod("Compile", - { - $buildConfiguration = "Release" - - $src = "$($this.SolutionRoot)\src" - $log = "$($this.BuildTemp)\msbuild.log" - - if ($this.BuildEnv.VisualStudio -eq $null) - { - throw "Build environment does not provide VisualStudio." - } - - Write-Host "Compile" - Write-Host "Logging to $log" - - # beware of the weird double \\ at the end of paths - # see http://edgylogic.com/blog/powershell-and-external-commands-done-right/ - &$this.BuildEnv.VisualStudio.MsBuild "$src\Our.ModelsBuilder.sln" ` - /p:WarningLevel=0 ` - /p:Configuration=$buildConfiguration ` - /p:Platform="Any CPU" ` - /p:UseWPP_CopyWebApplication=True ` - /p:PipelineDependsOnBuild=False ` - /p:OutDir="$($this.BuildTemp)\bin\\" ` - /p:Verbosity=minimal ` - /t:Clean`;Rebuild ` - /tv:"$($this.BuildEnv.VisualStudio.ToolsVersion)" ` - /p:UmbracoBuild=True ` - > $log - - if (-not $?) { throw "Failed to compile." } - - # /p:UmbracoBuild tells the csproj that we are building from PS, not VS - }) - - $ubuild.DefineMethod("PackageCore", - { - Write-Host "Package Our.ModelsBuilder" - $nuspecs = "$($this.SolutionRoot)\build\NuSpecs" - $copyright = "Copyright (C) Our $((Get-Date).Year)" - &$this.BuildEnv.NuGet pack "$nuspecs\Our.ModelsBuilder.nuspec" ` - -Properties copyright="$Copyright"`;solution="$($this.SolutionRoot)" ` - -Version "$($this.Version.Semver.ToString())" ` - -Verbosity detailed -OutputDirectory "$($this.BuildOutput)" > "$($this.BuildTemp)\nupack.core.log" - if (-not $?) { throw "Failed to pack NuGet Our.ModelsBuilder." } - }) - - $ubuild.DefineMethod("PackageWeb", - { - Write-Host "Package Our.ModelsBuilder.Web" - $nuspecs = "$($this.SolutionRoot)\build\NuSpecs" - $copyright = "Copyright (C) Our $((Get-Date).Year)" - &$this.BuildEnv.NuGet pack "$nuspecs\Our.ModelsBuilder.Web.nuspec" ` - -Properties copyright="$Copyright"`;solution="$($this.SolutionRoot)" ` - -Version "$($this.Version.Semver.ToString())" ` - -Verbosity detailed -OutputDirectory "$($this.BuildOutput)" > "$($this.BuildTemp)\nupack.web.log" - if (-not $?) { throw "Failed to pack NuGet Our.ModelsBuilder.Web." } - }) - - $ubuild.DefineMethod("PackageVsix", - { - Write-Host "Package Our.ModelsBuilder.Extension" - - $vsix = "$($this.SolutionRoot)\build.tmp\bin\Our.ModelsBuilder.Extension.vsix" - $temp = "$($this.SolutionRoot)\build.tmp\bin\Our.ModelsBuilder.Extension.temp" - $target = "$($this.BuildOutput)\Our.ModelsBuilder.Extension-$($this.Version.Semver.ToString()).vsix" - - [Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem") | Out-Null - [System.IO.Compression.ZipFile]::ExtractToDirectory($vsix, $temp) | Out-Null - - Remove-Item -Force -Recurse "$temp/x86" - Remove-Item -Force -Recurse "$temp/amd64" - Remove-Item -Force -Recurse "$temp/cs" - Remove-Item -Force -Recurse "$temp/de" - Remove-Item -Force -Recurse "$temp/es" - Remove-Item -Force -Recurse "$temp/fr" - Remove-Item -Force -Recurse "$temp/it" - Remove-Item -Force -Recurse "$temp/ja" - Remove-Item -Force -Recurse "$temp/ko" - Remove-Item -Force -Recurse "$temp/pl" - Remove-Item -Force -Recurse "$temp/pt-BR" - Remove-Item -Force -Recurse "$temp/ru" - Remove-Item -Force -Recurse "$temp/tr" - Remove-Item -Force -Recurse "$temp/zh-Hans" - Remove-Item -Force -Recurse "$temp/zh-Hant" - - Remove-Item -Force "$temp/ClientDependency.*" - Remove-Item -Force "$temp/CSharpTest.*" - Remove-Item -Force "$temp/HtmlAgilityPack.*" - Remove-Item -Force "$temp/ImageProcessor.*" - Remove-Item -Force "$temp/LightInject.*" - Remove-Item -Force "$temp/Lucene.*" - Remove-Item -Force "$temp/Markdown.*" - Remove-Item -Force "$temp/MiniProfiler.*" - Remove-Item -Force "$temp/NPoco.*" - Remove-Item -Force "$temp/Serilog.*" - Remove-Item -Force "$temp/Superpower.*" - Remove-Item -Force "$temp/Umbraco.Examine.*" - - Remove-Item -Force "$temp/*.pdb" - - $manifest = Get-Content "$temp/manifest.json" | ConvertFrom-Json - - $files = $manifest.files # is an array of objects (fixed size) - $nfiles = @() - - foreach ($file in $files) - { - $fileName = $file.fileName - - if ($fileName.StartsWith("/x86")) { continue } - if ($fileName.StartsWith("/amd64")) { continue } - if ($fileName.StartsWith("/cs")) { continue } - if ($fileName.StartsWith("/de")) { continue } - if ($fileName.StartsWith("/es")) { continue } - if ($fileName.StartsWith("/fr")) { continue } - if ($fileName.StartsWith("/it")) { continue } - if ($fileName.StartsWith("/ja")) { continue } - if ($fileName.StartsWith("/ko")) { continue } - if ($fileName.StartsWith("/pl")) { continue } - if ($fileName.StartsWith("/pt-BR")) { continue } - if ($fileName.StartsWith("/tr")) { continue } - if ($fileName.StartsWith("/zh-Hans")) { continue } - if ($fileName.StartsWith("/zh-Hant")) { continue } - - if ($fileName.StartsWith("/ClientDependency.")) { continue } - if ($fileName.StartsWith("/CSharpTest.")) { continue } - if ($fileName.StartsWith("/HtmlAgilityPack.")) { continue } - if ($fileName.StartsWith("/ImageProcessor.")) { continue } - if ($fileName.StartsWith("/LightInject.")) { continue } - if ($fileName.StartsWith("/Lucene.")) { continue } - if ($fileName.StartsWith("/Markdown.")) { continue } - if ($fileName.StartsWith("/MiniProfiler.")) { continue } - if ($fileName.StartsWith("/NPoco.")) { continue } - if ($fileName.StartsWith("/Serilog.")) { continue } - if ($fileName.StartsWith("/Superpower.")) { continue } - if ($fileName.StartsWith("/Umbraco.Examine.")) { continue } - - if ($fileName.EndsWith(".pdb")) { continue } - - $nfiles += $file - } - - $manifest.files = $nfiles - - $manifest | ConvertTo-Json | Set-Content "$temp/manifest.json" - - [System.IO.Compression.ZipFile]::CreateFromDirectory($temp, $target) - }) - - $ubuild.DefineMethod("VerifyNuGet", - { - $this.VerifyNuGetConsistency( - ("Our.ModelsBuilder", "Our.ModelsBuilder.Web"), - ("Our.ModelsBuilder", "Our.ModelsBuilder.Web", "Our.ModelsBuilder.Extension", "Our.ModelsBuilder.Console")) - }) - - $ubuild.DefineMethod("PostPackageHook", - { - # run hook - if ($this.HasMethod("PostPackage")) - { - Write-Host "Run PostPackage hook" - $this.PostPackage(); - if (-not $?) { throw "Failed to run hook." } - } - }) - - $ubuild.DefineMethod("Build", - { - $this.RestoreNuGet() - if ($this.OnError()) { return } - $this.Compile() - if ($this.OnError()) { return } - #$this.CompileTests() - # not running tests - $this.VerifyNuGet() - if ($this.OnError()) { return } - $this.PackageCore() - if ($this.OnError()) { return } - $this.PackageWeb() - if ($this.OnError()) { return } - $this.PackageVsix() - if ($this.OnError()) { return } - $this.PostPackageHook() - if ($this.OnError()) { return } - }) - - # ################################################################ - # RUN - # ################################################################ - - # configure - $ubuild.ReleaseBranches = @( "master" ) - - # run - if (-not $get) - { - if ($command.Length -eq 0) - { - $command = @( "Build" ) - } - $ubuild.RunMethod($command); - if ($ubuild.OnError()) { return } - } - if ($get) { return $ubuild } diff --git a/build/sem.ver b/build/sem.ver new file mode 100644 index 00000000..41e1400d --- /dev/null +++ b/build/sem.ver @@ -0,0 +1 @@ +4.0.0-alpha.20 \ No newline at end of file diff --git a/src/Our.ModelsBuilder.Web/Nuget/Our.ModelsBuilder.Web.nuspec b/src/Our.ModelsBuilder.Web/Nuget/Our.ModelsBuilder.Web.nuspec new file mode 100644 index 00000000..2e1628ad --- /dev/null +++ b/src/Our.ModelsBuilder.Web/Nuget/Our.ModelsBuilder.Web.nuspec @@ -0,0 +1,44 @@ + + + + Our.ModelsBuilder.Web + + Our ModelsBuilder Web + The Umbraco Community + The Umbraco Community + MIT + false + https://raw.githubusercontent.com/ZpqrtBnk/Our.ModelsBuilder/v4/dev/etc/logo.png + + Our ModelsBuilder Web Integration for Umbraco. + https://github.com/ZpqrtBnk/Our.ModelsBuilder + + en-US + umbraco + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build/Nuspecs/ModelsBuilder/web.config.install.xdt b/src/Our.ModelsBuilder.Web/Nuget/web.config.install.xdt similarity index 100% rename from build/Nuspecs/ModelsBuilder/web.config.install.xdt rename to src/Our.ModelsBuilder.Web/Nuget/web.config.install.xdt diff --git a/build/Nuspecs/ModelsBuilder/web.config.uninstall.xdt b/src/Our.ModelsBuilder.Web/Nuget/web.config.uninstall.xdt similarity index 100% rename from build/Nuspecs/ModelsBuilder/web.config.uninstall.xdt rename to src/Our.ModelsBuilder.Web/Nuget/web.config.uninstall.xdt diff --git a/src/Our.ModelsBuilder.Web/Our.ModelsBuilder.Web.csproj b/src/Our.ModelsBuilder.Web/Our.ModelsBuilder.Web.csproj index a9ff57e8..1c63a848 100644 --- a/src/Our.ModelsBuilder.Web/Our.ModelsBuilder.Web.csproj +++ b/src/Our.ModelsBuilder.Web/Our.ModelsBuilder.Web.csproj @@ -63,6 +63,9 @@ + + + diff --git a/src/Our.ModelsBuilder.sln b/src/Our.ModelsBuilder.sln index 5e9bffa3..5592889c 100644 --- a/src/Our.ModelsBuilder.sln +++ b/src/Our.ModelsBuilder.sln @@ -12,21 +12,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution", "Solution", "{C7 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{42C3FC1A-26BA-4FAB-9585-AC8C25449B8F}" ProjectSection(SolutionItems) = preProject - ..\build\build-bootstrap.ps1 = ..\build\build-bootstrap.ps1 ..\build\build.ps1 = ..\build\build.ps1 EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ModelsBuilder", "ModelsBuilder", "{1FFB7043-4B35-4A92-80FC-A2306511C8D5}" - ProjectSection(SolutionItems) = preProject - ..\build\Nuspecs\ModelsBuilder\web.config.install.xdt = ..\build\Nuspecs\ModelsBuilder\web.config.install.xdt - ..\build\Nuspecs\ModelsBuilder\web.config.uninstall.xdt = ..\build\Nuspecs\ModelsBuilder\web.config.uninstall.xdt - EndProjectSection -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Nuspecs", "Nuspecs", "{30368E85-95E0-4A26-AC5A-D8570DB16FDA}" ProjectSection(SolutionItems) = preProject ..\build\Nuspecs\logo.png = ..\build\Nuspecs\logo.png - ..\build\Nuspecs\Our.ModelsBuilder.nuspec = ..\build\Nuspecs\Our.ModelsBuilder.nuspec - ..\build\Nuspecs\Our.ModelsBuilder.Web.nuspec = ..\build\Nuspecs\Our.ModelsBuilder.Web.nuspec EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Our.ModelsBuilder", "Our.ModelsBuilder\Our.ModelsBuilder.csproj", "{998FB014-303A-4146-B3E4-B927BAB0210F}" @@ -69,7 +60,6 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {1FFB7043-4B35-4A92-80FC-A2306511C8D5} = {30368E85-95E0-4A26-AC5A-D8570DB16FDA} {30368E85-95E0-4A26-AC5A-D8570DB16FDA} = {42C3FC1A-26BA-4FAB-9585-AC8C25449B8F} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution diff --git a/build/Nuspecs/Our.ModelsBuilder.nuspec b/src/Our.ModelsBuilder/Nuget/Our.ModelsBuilder.nuspec similarity index 84% rename from build/Nuspecs/Our.ModelsBuilder.nuspec rename to src/Our.ModelsBuilder/Nuget/Our.ModelsBuilder.nuspec index ab7f0ae8..3d86f985 100644 --- a/build/Nuspecs/Our.ModelsBuilder.nuspec +++ b/src/Our.ModelsBuilder/Nuget/Our.ModelsBuilder.nuspec @@ -23,8 +23,8 @@ - - + + diff --git a/src/Our.ModelsBuilder/Our.ModelsBuilder.csproj b/src/Our.ModelsBuilder/Our.ModelsBuilder.csproj index 3801a81b..5e7adf56 100644 --- a/src/Our.ModelsBuilder/Our.ModelsBuilder.csproj +++ b/src/Our.ModelsBuilder/Our.ModelsBuilder.csproj @@ -123,6 +123,8 @@ - + + + \ No newline at end of file diff --git a/src/Our.ModelsBuilder/Our.ModelsBuilder.nuspec b/src/Our.ModelsBuilder/Our.ModelsBuilder.nuspec new file mode 100644 index 00000000..72766d10 --- /dev/null +++ b/src/Our.ModelsBuilder/Our.ModelsBuilder.nuspec @@ -0,0 +1,33 @@ + + + + Our.ModelsBuilder + + Our ModelsBuilder + The Umbraco Community + The Umbraco Community + MIT + false + https://raw.githubusercontent.com/ZpqrtBnk/Our.ModelsBuilder/v4/dev/etc/logo.png + + Our ModelsBuilder for Umbraco. + https://github.com/ZpqrtBnk/Our.ModelsBuilder + + en-US + umbraco + + + + + + + + + + + + + + + + \ No newline at end of file From 535c98cd05a2b7599a188ca13924a129caf0b118 Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Tue, 29 Sep 2020 16:56:55 +0100 Subject: [PATCH 02/31] use dotnet build and pack packages --- build/build.ps1 | 18 ++++++++++ .../ItemTemplate.Etc/Umbraco Models.zip | Bin 1055 -> 1055 bytes .../Our.ModelsBuilder.Tests.csproj | 2 +- .../Nuget/Our.ModelsBuilder.Web.nuspec | 23 ++++++------ .../Our.ModelsBuilder.Web.csproj | 2 +- .../Nuget/Our.ModelsBuilder.nuspec | 9 +++-- .../Our.ModelsBuilder.csproj | 2 +- .../Our.ModelsBuilder.nuspec | 33 ------------------ 8 files changed, 35 insertions(+), 54 deletions(-) delete mode 100644 src/Our.ModelsBuilder/Our.ModelsBuilder.nuspec diff --git a/build/build.ps1 b/build/build.ps1 index e69de29b..11de98f8 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -0,0 +1,18 @@ +dotnet build ..\src\Our.ModelsBuilder.sln +$version = Get-ChildItem ".\sem.ver" | Get-Content +$version +$nuspecs = Get-ChildItem -Path ..\*\*.nuspec -Recurse -Force; +$nuspecs | Foreach-Object { + [xml]$xml = Get-Content -path $_.FullName -Raw + $ns = [System.Xml.XmlNamespaceManager]::new($xml.NameTable) + $ns.AddNamespace('nuspec', 'http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd') + + write-host [xml]$xml + $xml.package.metadata.version= $version.ToString() + + [xml]$xml.Save($_.FullName) + nuget pack $_.FullName + $xml.package.metadata.version= "" + [xml]$xml.Save($_.FullName) + + } diff --git a/src/Our.ModelsBuilder.Extension/ItemTemplate.Etc/Umbraco Models.zip b/src/Our.ModelsBuilder.Extension/ItemTemplate.Etc/Umbraco Models.zip index d86b9d444f588324ddb292d261be865668df92e0..bb183e1bca4ec31015912bf50e5e7fcbd113e265 100644 GIT binary patch delta 69 zcmbQwF`t7kz?+#xgn@y9gCVd~J8&c4c}5lxWAZ~rLoj2r7*ilrD4W>?BDa{?7{a*4 G>?BDa{?7{a*4 G>3.15.1 - 8.3.1 + 8.7.0 diff --git a/src/Our.ModelsBuilder.Web/Nuget/Our.ModelsBuilder.Web.nuspec b/src/Our.ModelsBuilder.Web/Nuget/Our.ModelsBuilder.Web.nuspec index 2e1628ad..7a277e88 100644 --- a/src/Our.ModelsBuilder.Web/Nuget/Our.ModelsBuilder.Web.nuspec +++ b/src/Our.ModelsBuilder.Web/Nuget/Our.ModelsBuilder.Web.nuspec @@ -2,7 +2,8 @@ Our.ModelsBuilder.Web - + + Our ModelsBuilder Web The Umbraco Community The Umbraco Community @@ -12,7 +13,8 @@ Our ModelsBuilder Web Integration for Umbraco. https://github.com/ZpqrtBnk/Our.ModelsBuilder - + + en-US umbraco @@ -23,22 +25,17 @@ - - - + + - - - - - - + + + + - - \ No newline at end of file diff --git a/src/Our.ModelsBuilder.Web/Our.ModelsBuilder.Web.csproj b/src/Our.ModelsBuilder.Web/Our.ModelsBuilder.Web.csproj index 1c63a848..74d9ab67 100644 --- a/src/Our.ModelsBuilder.Web/Our.ModelsBuilder.Web.csproj +++ b/src/Our.ModelsBuilder.Web/Our.ModelsBuilder.Web.csproj @@ -59,7 +59,7 @@ - 8.3.0-alpha.1 + 8.7.0 diff --git a/src/Our.ModelsBuilder/Nuget/Our.ModelsBuilder.nuspec b/src/Our.ModelsBuilder/Nuget/Our.ModelsBuilder.nuspec index 3d86f985..ff8750a0 100644 --- a/src/Our.ModelsBuilder/Nuget/Our.ModelsBuilder.nuspec +++ b/src/Our.ModelsBuilder/Nuget/Our.ModelsBuilder.nuspec @@ -2,7 +2,8 @@ Our.ModelsBuilder - $version$ + + Our ModelsBuilder The Umbraco Community The Umbraco Community @@ -23,11 +24,9 @@ - - - + + - \ No newline at end of file diff --git a/src/Our.ModelsBuilder/Our.ModelsBuilder.csproj b/src/Our.ModelsBuilder/Our.ModelsBuilder.csproj index 5e7adf56..ad1f98c3 100644 --- a/src/Our.ModelsBuilder/Our.ModelsBuilder.csproj +++ b/src/Our.ModelsBuilder/Our.ModelsBuilder.csproj @@ -41,7 +41,7 @@ - 8.3.0-alpha.1 + 8.7.0 diff --git a/src/Our.ModelsBuilder/Our.ModelsBuilder.nuspec b/src/Our.ModelsBuilder/Our.ModelsBuilder.nuspec deleted file mode 100644 index 72766d10..00000000 --- a/src/Our.ModelsBuilder/Our.ModelsBuilder.nuspec +++ /dev/null @@ -1,33 +0,0 @@ - - - - Our.ModelsBuilder - - Our ModelsBuilder - The Umbraco Community - The Umbraco Community - MIT - false - https://raw.githubusercontent.com/ZpqrtBnk/Our.ModelsBuilder/v4/dev/etc/logo.png - - Our ModelsBuilder for Umbraco. - https://github.com/ZpqrtBnk/Our.ModelsBuilder - - en-US - umbraco - - - - - - - - - - - - - - - - \ No newline at end of file From 6973672dc9d84068226eb7695ff0405306486991 Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Tue, 29 Sep 2020 17:07:25 +0100 Subject: [PATCH 03/31] build nuget packages base on dll --- .gitignore | 1 + build/build.ps1 | 4 ++-- src/SolutionInfo.cs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index d0518a7f..401e13e6 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ build.out/ # eof src/.idea +*/NugetPackages/*.nupkg diff --git a/build/build.ps1 b/build/build.ps1 index 11de98f8..0fc38711 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -1,5 +1,5 @@ dotnet build ..\src\Our.ModelsBuilder.sln -$version = Get-ChildItem ".\sem.ver" | Get-Content +$version = (Get-Command "..\src\Our.ModelsBuilder\bin\Release\Our.ModelsBuilder.dll").FileVersionInfo.ProductVersion $version $nuspecs = Get-ChildItem -Path ..\*\*.nuspec -Recurse -Force; $nuspecs | Foreach-Object { @@ -11,7 +11,7 @@ $nuspecs | Foreach-Object { $xml.package.metadata.version= $version.ToString() [xml]$xml.Save($_.FullName) - nuget pack $_.FullName + nuget pack $_.FullName -OutputDirectory "NugetPackages" $xml.package.metadata.version= "" [xml]$xml.Save($_.FullName) diff --git a/src/SolutionInfo.cs b/src/SolutionInfo.cs index e460fefc..b46227cf 100644 --- a/src/SolutionInfo.cs +++ b/src/SolutionInfo.cs @@ -38,5 +38,5 @@ // Note: could not release "1.8.0" because it was depending on pre-release NuGet packages // for Roslyn, so had to release 1.8.0-final... starting with 2.1.3 Roslyn has a released // 1.0 version, so now we can release "2.1.3" without the "-final" extension. -[assembly: AssemblyInformationalVersion("4.0.0-alpha.20")] +[assembly: AssemblyInformationalVersion("4.0.0-alpha.21")] // Do not remove this line. From ec41630c775eaa13d58202064792a1302b910f78 Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Wed, 30 Sep 2020 11:26:51 +0100 Subject: [PATCH 04/31] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 119 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000..461178a9 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,119 @@ +trigger: +- '*' + +pool: + name: Default + +variables: + image_name: mcr.microsoft.com/businesscentral/sandbox + container_name: Build + company_name: My Company + user_name: admin + password: P@ssword1 + license_file: C:\Users\james.pearson.TECMAN\Desktop\Licence.flf + +stages: +- stage: build + displayName: Build + jobs: + - job: Build + pool: + name: Default + steps: + - task: PowerShell@1 + displayName: Create build container + inputs: + scriptType: inlineScript + inlineScript: > + Import-Module navcontainerhelper; + $Credential = [PSCredential]::new('$(user_name)',(ConvertTo-SecureString '$(password)' -AsPlainText -Force)); + New-NavContainer -accept_eula -accept_outdated -containerName '$(container_name)' -auth NavUserPassword -credential $Credential -image $(image_name) -licenseFile $(license_file) -doNotExportObjectsToText -restart no -shortcuts None -useBestContainerOS -includeTestToolkit -includeTestLibrariesOnly -updateHosts + - task: PowerShell@1 + displayName: Copy source into container folder + inputs: + scriptType: inlineScript + inlineScript: > + $SourceDir = 'C:\ProgramData\NavContainerHelper\Extensions\$(container_name)\Source'; + New-Item $SourceDir -ItemType Directory; + Copy-Item '$(Build.SourcesDirectory)\*' $SourceDir -Recurse -Force; + - task: PowerShell@1 + displayName: Compile app + inputs: + scriptType: inlineScript + inlineScript: > + Import-Module navcontainerhelper; + $SourceDir = 'C:\ProgramData\NavContainerHelper\Extensions\$(container_name)\Source'; + $Credential = [PSCredential]::new('$(user_name)',(ConvertTo-SecureString '$(password)' -AsPlainText -Force)); + Compile-AppInNavContainer -containerName '$(container_name)' -appProjectFolder $SourceDir -credential $Credential -AzureDevOps -FailOn 'error'; + - task: PowerShell@1 + displayName: Copy app into build artifacts staging folder + inputs: + scriptType: inlineScript + inlineScript: > + $SourceDir = 'C:\ProgramData\NavContainerHelper\Extensions\$(container_name)\Source'; + Copy-Item "$SourceDir\output\*.app" '$(Build.ArtifactStagingDirectory)' + - task: PowerShell@1 + displayName: Publish and install app into container + inputs: + scriptType: inlineScript + inlineScript: > + Import-Module navcontainerhelper; + Get-ChildItem '$(Build.ArtifactStagingDirectory)' | % {Publish-NavContainerApp '$(container_name)' -appFile $_.FullName -skipVerification -sync -install} + - task: PowerShell@1 + displayName: Run tests + inputs: + scriptType: inlineScript + inlineScript: > + $Credential = [PSCredential]::new('$(user_name)',(ConvertTo-SecureString '$(password)' -AsPlainText -Force)); + $BuildHelperPath = 'C:\ProgramData\NavContainerHelper\Extensions\$(container_name)\My\BuildHelper.app'; + Download-File 'https://github.com/CleverDynamics/al-build-helper/raw/master/Clever%20Dynamics_Build%20Helper_BC14.app' $BuildHelperPath; + Publish-NavContainerApp $(container_name) -appFile $BuildHelperPath -sync -install; + $Url = "http://{0}:7047/NAV/WS/{1}/Codeunit/AutomatedTestMgt" -f (Get-NavContainerIpAddress -containerName '$(container_name)'), '$(company_name)'; + $AutomatedTestMgt = New-WebServiceProxy -Uri $Url -Credential $Credential; + $AutomatedTestMgt.GetTests('DEFAULT',50100,50199); + Import-Module navcontainerhelper; + $ResultPath = 'C:\ProgramData\NavContainerHelper\Extensions\$(container_name)\my\Results.xml'; + Run-TestsInBcContainer -containerName '$(container_name)' -companyName '$(company_name)' -credential $Credential -detailed -AzureDevOps warning -XUnitResultFileName $ResultPath -debugMode + - task: PublishTestResults@2 + displayName: Upload test results + inputs: + failTaskOnFailedTests: true + testResultsFormat: XUnit + testResultsFiles: '*.xml' + searchFolder: C:\ProgramData\NavContainerHelper\Extensions\$(container_name)\my + + - task: PublishBuildArtifacts@1 + displayName: Publish build artifacts + inputs: + ArtifactName: App Package + PathtoPublish: $(Build.ArtifactStagingDirectory) + + - task: PowerShell@1 + displayName: Remove build container + inputs: + scriptType: inlineScript + inlineScript: > + Import-Module navcontainerhelper; + Remove-NavContainer $(container_name) + condition: always() +- stage: Release + displayName: Release + condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/master')) + jobs: + - deployment: + displayName: Release + pool: + name: Default + environment: Release + strategy: + runOnce: + deploy: + steps: + - task: PowerShell@1 + displayName: Copy artifacts to release directory + inputs: + scriptType: inlineScript + inlineScript: > + $Path = Split-Path '$(System.ArtifactsDirectory)' -Parent; + $Artifact = "$Path\App Package\*.app"; + Copy-Item $Artifact 'C:\Release\'; \ No newline at end of file From a249e6973ea8fc6443d7ed21b57ec4a8b018213f Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Wed, 30 Sep 2020 13:47:43 +0100 Subject: [PATCH 05/31] correct nuspecs, add source links --- build/sem.ver | 1 - .../Nuget/Our.ModelsBuilder.Web.nuspec | 2 +- src/Our.ModelsBuilder.Web/Our.ModelsBuilder.Web.csproj | 5 +++++ src/Our.ModelsBuilder.sln | 1 + src/Our.ModelsBuilder/Nuget/Our.ModelsBuilder.nuspec | 3 ++- src/Our.ModelsBuilder/Our.ModelsBuilder.csproj | 8 ++++++++ 6 files changed, 17 insertions(+), 3 deletions(-) delete mode 100644 build/sem.ver diff --git a/build/sem.ver b/build/sem.ver deleted file mode 100644 index 41e1400d..00000000 --- a/build/sem.ver +++ /dev/null @@ -1 +0,0 @@ -4.0.0-alpha.20 \ No newline at end of file diff --git a/src/Our.ModelsBuilder.Web/Nuget/Our.ModelsBuilder.Web.nuspec b/src/Our.ModelsBuilder.Web/Nuget/Our.ModelsBuilder.Web.nuspec index 7a277e88..d05e5ba7 100644 --- a/src/Our.ModelsBuilder.Web/Nuget/Our.ModelsBuilder.Web.nuspec +++ b/src/Our.ModelsBuilder.Web/Nuget/Our.ModelsBuilder.Web.nuspec @@ -12,11 +12,11 @@ https://raw.githubusercontent.com/ZpqrtBnk/Our.ModelsBuilder/v4/dev/etc/logo.png Our ModelsBuilder Web Integration for Umbraco. - https://github.com/ZpqrtBnk/Our.ModelsBuilder en-US umbraco + https://github.com/modelsbuilder/ModelsBuilder.Original diff --git a/src/Our.ModelsBuilder.Web/Our.ModelsBuilder.Web.csproj b/src/Our.ModelsBuilder.Web/Our.ModelsBuilder.Web.csproj index 74d9ab67..567ee8ad 100644 --- a/src/Our.ModelsBuilder.Web/Our.ModelsBuilder.Web.csproj +++ b/src/Our.ModelsBuilder.Web/Our.ModelsBuilder.Web.csproj @@ -58,6 +58,11 @@ + + 1.0.0 + all + runtime; build; native; contentfiles; analyzers; buildtransitive + 8.7.0 diff --git a/src/Our.ModelsBuilder.sln b/src/Our.ModelsBuilder.sln index 5592889c..ea8a5465 100644 --- a/src/Our.ModelsBuilder.sln +++ b/src/Our.ModelsBuilder.sln @@ -47,6 +47,7 @@ Global {F0B757DF-0CF7-4AAF-8DD0-F46EDF25C3A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F0B757DF-0CF7-4AAF-8DD0-F46EDF25C3A3}.Debug|Any CPU.Build.0 = Debug|Any CPU {F0B757DF-0CF7-4AAF-8DD0-F46EDF25C3A3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F0B757DF-0CF7-4AAF-8DD0-F46EDF25C3A3}.Release|Any CPU.Build.0 = Release|Any CPU {2317BE7F-1723-4512-B863-5B6835E583A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2317BE7F-1723-4512-B863-5B6835E583A2}.Debug|Any CPU.Build.0 = Debug|Any CPU {2317BE7F-1723-4512-B863-5B6835E583A2}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/src/Our.ModelsBuilder/Nuget/Our.ModelsBuilder.nuspec b/src/Our.ModelsBuilder/Nuget/Our.ModelsBuilder.nuspec index ff8750a0..ef131e71 100644 --- a/src/Our.ModelsBuilder/Nuget/Our.ModelsBuilder.nuspec +++ b/src/Our.ModelsBuilder/Nuget/Our.ModelsBuilder.nuspec @@ -12,10 +12,11 @@ https://raw.githubusercontent.com/ZpqrtBnk/Our.ModelsBuilder/v4/dev/etc/logo.png Our ModelsBuilder for Umbraco. - https://github.com/ZpqrtBnk/Our.ModelsBuilder + https://github.com/modelsbuilder/ModelsBuilder.Original $copyright$ en-US umbraco + diff --git a/src/Our.ModelsBuilder/Our.ModelsBuilder.csproj b/src/Our.ModelsBuilder/Our.ModelsBuilder.csproj index ad1f98c3..e9a28984 100644 --- a/src/Our.ModelsBuilder/Our.ModelsBuilder.csproj +++ b/src/Our.ModelsBuilder/Our.ModelsBuilder.csproj @@ -3,6 +3,8 @@ v4.7.2 + true + true false {998FB014-303A-4146-B3E4-B927BAB0210F} Library @@ -32,6 +34,7 @@ 4 bin\Release\Our.ModelsBuilder.xml latest + @@ -40,6 +43,11 @@ + + 1.0.0 + all + runtime; build; native; contentfiles; analyzers; buildtransitive + 8.7.0 From a0b81d809a8a0533bf97b213a3d8408b66665220 Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Wed, 30 Sep 2020 15:30:22 +0100 Subject: [PATCH 06/31] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 103 +++++++------------------------------------- 1 file changed, 15 insertions(+), 88 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 461178a9..feae87c8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -20,82 +20,21 @@ stages: pool: name: Default steps: - - task: PowerShell@1 - displayName: Create build container - inputs: - scriptType: inlineScript - inlineScript: > - Import-Module navcontainerhelper; - $Credential = [PSCredential]::new('$(user_name)',(ConvertTo-SecureString '$(password)' -AsPlainText -Force)); - New-NavContainer -accept_eula -accept_outdated -containerName '$(container_name)' -auth NavUserPassword -credential $Credential -image $(image_name) -licenseFile $(license_file) -doNotExportObjectsToText -restart no -shortcuts None -useBestContainerOS -includeTestToolkit -includeTestLibrariesOnly -updateHosts - - task: PowerShell@1 - displayName: Copy source into container folder - inputs: - scriptType: inlineScript - inlineScript: > - $SourceDir = 'C:\ProgramData\NavContainerHelper\Extensions\$(container_name)\Source'; - New-Item $SourceDir -ItemType Directory; - Copy-Item '$(Build.SourcesDirectory)\*' $SourceDir -Recurse -Force; - - task: PowerShell@1 - displayName: Compile app - inputs: - scriptType: inlineScript - inlineScript: > - Import-Module navcontainerhelper; - $SourceDir = 'C:\ProgramData\NavContainerHelper\Extensions\$(container_name)\Source'; - $Credential = [PSCredential]::new('$(user_name)',(ConvertTo-SecureString '$(password)' -AsPlainText -Force)); - Compile-AppInNavContainer -containerName '$(container_name)' -appProjectFolder $SourceDir -credential $Credential -AzureDevOps -FailOn 'error'; - - task: PowerShell@1 - displayName: Copy app into build artifacts staging folder - inputs: - scriptType: inlineScript - inlineScript: > - $SourceDir = 'C:\ProgramData\NavContainerHelper\Extensions\$(container_name)\Source'; - Copy-Item "$SourceDir\output\*.app" '$(Build.ArtifactStagingDirectory)' - - task: PowerShell@1 - displayName: Publish and install app into container - inputs: - scriptType: inlineScript - inlineScript: > - Import-Module navcontainerhelper; - Get-ChildItem '$(Build.ArtifactStagingDirectory)' | % {Publish-NavContainerApp '$(container_name)' -appFile $_.FullName -skipVerification -sync -install} - - task: PowerShell@1 - displayName: Run tests - inputs: - scriptType: inlineScript - inlineScript: > - $Credential = [PSCredential]::new('$(user_name)',(ConvertTo-SecureString '$(password)' -AsPlainText -Force)); - $BuildHelperPath = 'C:\ProgramData\NavContainerHelper\Extensions\$(container_name)\My\BuildHelper.app'; - Download-File 'https://github.com/CleverDynamics/al-build-helper/raw/master/Clever%20Dynamics_Build%20Helper_BC14.app' $BuildHelperPath; - Publish-NavContainerApp $(container_name) -appFile $BuildHelperPath -sync -install; - $Url = "http://{0}:7047/NAV/WS/{1}/Codeunit/AutomatedTestMgt" -f (Get-NavContainerIpAddress -containerName '$(container_name)'), '$(company_name)'; - $AutomatedTestMgt = New-WebServiceProxy -Uri $Url -Credential $Credential; - $AutomatedTestMgt.GetTests('DEFAULT',50100,50199); - Import-Module navcontainerhelper; - $ResultPath = 'C:\ProgramData\NavContainerHelper\Extensions\$(container_name)\my\Results.xml'; - Run-TestsInBcContainer -containerName '$(container_name)' -companyName '$(company_name)' -credential $Credential -detailed -AzureDevOps warning -XUnitResultFileName $ResultPath -debugMode - - task: PublishTestResults@2 - displayName: Upload test results - inputs: - failTaskOnFailedTests: true - testResultsFormat: XUnit - testResultsFiles: '*.xml' - searchFolder: C:\ProgramData\NavContainerHelper\Extensions\$(container_name)\my + - task: NuGetToolInstaller@1 + inputs: + versionSpec: + - task: NuGetCommand@2 + inputs: + command: 'restore' + restoreSolution: '**/*.sln' + feedsToUse: 'select' + - task: VSBuild@1 + inputs: + solution: '**\*.sln' + +- stage: tests + displayName: Tests - - task: PublishBuildArtifacts@1 - displayName: Publish build artifacts - inputs: - ArtifactName: App Package - PathtoPublish: $(Build.ArtifactStagingDirectory) - - - task: PowerShell@1 - displayName: Remove build container - inputs: - scriptType: inlineScript - inlineScript: > - Import-Module navcontainerhelper; - Remove-NavContainer $(container_name) - condition: always() - stage: Release displayName: Release condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/master')) @@ -104,16 +43,4 @@ stages: displayName: Release pool: name: Default - environment: Release - strategy: - runOnce: - deploy: - steps: - - task: PowerShell@1 - displayName: Copy artifacts to release directory - inputs: - scriptType: inlineScript - inlineScript: > - $Path = Split-Path '$(System.ArtifactsDirectory)' -Parent; - $Artifact = "$Path\App Package\*.app"; - Copy-Item $Artifact 'C:\Release\'; \ No newline at end of file + \ No newline at end of file From 2a2e07aba4c76069691604bb4e45068c366570d2 Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Wed, 30 Sep 2020 15:34:54 +0100 Subject: [PATCH 07/31] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index feae87c8..b005303a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,15 +2,7 @@ trigger: - '*' pool: - name: Default - -variables: - image_name: mcr.microsoft.com/businesscentral/sandbox - container_name: Build - company_name: My Company - user_name: admin - password: P@ssword1 - license_file: C:\Users\james.pearson.TECMAN\Desktop\Licence.flf + name: "Azure Pipelines" stages: - stage: build @@ -18,7 +10,7 @@ stages: jobs: - job: Build pool: - name: Default + name: "Azure Pipelines" steps: - task: NuGetToolInstaller@1 inputs: From 92f009cf61ba647648065bd83c5ab4df179485b4 Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Wed, 30 Sep 2020 15:37:52 +0100 Subject: [PATCH 08/31] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b005303a..899be1df 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,19 +2,19 @@ trigger: - '*' pool: - name: "Azure Pipelines" + vmImage: 'windows-latest' stages: - stage: build displayName: Build + jobs: - job: Build pool: - name: "Azure Pipelines" + pool: + vmImage: 'windows-latest' steps: - task: NuGetToolInstaller@1 - inputs: - versionSpec: - task: NuGetCommand@2 inputs: command: 'restore' @@ -23,16 +23,5 @@ stages: - task: VSBuild@1 inputs: solution: '**\*.sln' - -- stage: tests - displayName: Tests -- stage: Release - displayName: Release - condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/master')) - jobs: - - deployment: - displayName: Release - pool: - name: Default \ No newline at end of file From fbb43c070d4e77150a3a476f21b97c57164b7e2a Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Wed, 30 Sep 2020 15:41:47 +0100 Subject: [PATCH 09/31] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 899be1df..da79fb55 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,7 +2,7 @@ trigger: - '*' pool: - vmImage: 'windows-latest' + vmImage: 'windows-2019' stages: - stage: build @@ -12,7 +12,7 @@ stages: - job: Build pool: pool: - vmImage: 'windows-latest' + vmImage: 'windows-2019' steps: - task: NuGetToolInstaller@1 - task: NuGetCommand@2 From c47afd615e23b52fe80390e813b5394e11d1312b Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Wed, 30 Sep 2020 15:42:29 +0100 Subject: [PATCH 10/31] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index da79fb55..35fde032 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -11,8 +11,7 @@ stages: jobs: - job: Build pool: - pool: - vmImage: 'windows-2019' + vmImage: 'windows-2019' steps: - task: NuGetToolInstaller@1 - task: NuGetCommand@2 From 512995413ad7868e1953e26a3cf7e13712c25855 Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Wed, 30 Sep 2020 15:49:46 +0100 Subject: [PATCH 11/31] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 35fde032..86243b97 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -22,5 +22,15 @@ stages: - task: VSBuild@1 inputs: solution: '**\*.sln' - - \ No newline at end of file + - job: Test + pool: + vmImage: 'windows-2019' + steps: + - task: VSTest@2 + inputs: + testSelector: 'testAssemblies' + testAssemblyVer2: | + **\*test*.dll + !**\*TestAdapter.dll + !**\obj\** + searchFolder: '$(System.DefaultWorkingDirectory)' \ No newline at end of file From a6371dcad4c8a3ae65052b9cb7f599e35ed4627b Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Wed, 30 Sep 2020 16:19:46 +0100 Subject: [PATCH 12/31] To do: figure out building from powershell as dotnet build not works --- build/SetVersion.ps1 | 17 +++++++++++++++++ build/UnSetVersion.ps1 | 8 ++++++++ build/build.ps1 | 26 ++++++++++++-------------- 3 files changed, 37 insertions(+), 14 deletions(-) create mode 100644 build/SetVersion.ps1 create mode 100644 build/UnSetVersion.ps1 diff --git a/build/SetVersion.ps1 b/build/SetVersion.ps1 new file mode 100644 index 00000000..d640faac --- /dev/null +++ b/build/SetVersion.ps1 @@ -0,0 +1,17 @@ +Write-Host "Get version" +$version = (Get-Command "..\src\Our.ModelsBuilder\bin\Release\Our.ModelsBuilder.dll").FileVersionInfo.ProductVersion +$version +$nuspecs = Get-ChildItem -Path ..\*\*.nuspec -Recurse -Force; +$nuspecs | Foreach-Object { + Write-Host "Set version for "$_.FullName + [xml]$xml = Get-Content -path $_.FullName -Raw + $ns = [System.Xml.XmlNamespaceManager]::new($xml.NameTable) + $ns.AddNamespace('nuspec', 'http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd') + + write-host [xml]$xml + $xml.package.metadata.version= $version.ToString() + + [xml]$xml.Save($_.FullName) + + + } diff --git a/build/UnSetVersion.ps1 b/build/UnSetVersion.ps1 new file mode 100644 index 00000000..87bf797a --- /dev/null +++ b/build/UnSetVersion.ps1 @@ -0,0 +1,8 @@ +$nuspecs = Get-ChildItem -Path ..\*\*.nuspec -Recurse -Force; +$nuspecs | Foreach-Object { + [xml]$xml = Get-Content -path $_.FullName -Raw + $ns = [System.Xml.XmlNamespaceManager]::new($xml.NameTable) + $ns.AddNamespace('nuspec', 'http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd') + $xml.package.metadata.version= "" + [xml]$xml.Save($_.FullName) + } \ No newline at end of file diff --git a/build/build.ps1 b/build/build.ps1 index 0fc38711..56148284 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -1,18 +1,16 @@ -dotnet build ..\src\Our.ModelsBuilder.sln -$version = (Get-Command "..\src\Our.ModelsBuilder\bin\Release\Our.ModelsBuilder.dll").FileVersionInfo.ProductVersion -$version +Write-Host "Starting rebuild of Project" +Write-Host "Still need figure out way to build correctly" +#dotnet build ..\src\Our.ModelsBuilder.sln +Write-Host "Setting Up Version" + +& ".\SetVersion.ps1" + +Write-Host "Creating Pacakges" $nuspecs = Get-ChildItem -Path ..\*\*.nuspec -Recurse -Force; $nuspecs | Foreach-Object { - [xml]$xml = Get-Content -path $_.FullName -Raw - $ns = [System.Xml.XmlNamespaceManager]::new($xml.NameTable) - $ns.AddNamespace('nuspec', 'http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd') - - write-host [xml]$xml - $xml.package.metadata.version= $version.ToString() - - [xml]$xml.Save($_.FullName) nuget pack $_.FullName -OutputDirectory "NugetPackages" - $xml.package.metadata.version= "" - [xml]$xml.Save($_.FullName) - } + + Write-Host "Removing Version" + & ".\UnSetVersion.ps1" + From 380a488b7d38b3579755643de16cbd9250e183dc Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Wed, 30 Sep 2020 16:23:50 +0100 Subject: [PATCH 13/31] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 86243b97..140db552 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -22,6 +22,19 @@ stages: - task: VSBuild@1 inputs: solution: '**\*.sln' + - task: PowerShell@2 + inputs: + filePath: '$(System.DefaultWorkingDirectory)\build\SetVersion.ps1' + - task: NuGetCommand@2 + inputs: + command: 'pack' + packagesToPack: '**/*.nuspec' + versioningScheme: 'off' + - task: CopyFiles@2 + inputs: + SourceFolder: '$(System.DefaultWorkingDirectory)' + Contents: '**\*test*.dll' + TargetFolder: '$(System.ArtifactStagingDirectory)' - job: Test pool: vmImage: 'windows-2019' @@ -33,4 +46,4 @@ stages: **\*test*.dll !**\*TestAdapter.dll !**\obj\** - searchFolder: '$(System.DefaultWorkingDirectory)' \ No newline at end of file + searchFolder: '' \ No newline at end of file From cea5760ff4ae91bc93e1d6d8c3404eba0b23e71e Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Wed, 30 Sep 2020 16:28:44 +0100 Subject: [PATCH 14/31] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 140db552..19512f68 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -22,6 +22,7 @@ stages: - task: VSBuild@1 inputs: solution: '**\*.sln' + configuration: "Release" - task: PowerShell@2 inputs: filePath: '$(System.DefaultWorkingDirectory)\build\SetVersion.ps1' From 58ea35d9b17160c54be3441ff4af40d5153de2cf Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Thu, 1 Oct 2020 09:33:22 +0100 Subject: [PATCH 15/31] add devops building conf change nuspecs --- azure-pipelines.yml | 2 +- .../Our.ModelsBuilder.Console.csproj | 3 +++ .../Our.ModelsBuilder.Extension.csproj | 3 +++ .../Our.ModelsBuilder.Tests.csproj | 3 +++ .../Nuget/Our.ModelsBuilder.Web.nuspec | 4 ++-- src/Our.ModelsBuilder.Web/Our.ModelsBuilder.Web.csproj | 3 +++ src/Our.ModelsBuilder.sln | 10 ++++++++++ src/Our.ModelsBuilder/Nuget/Our.ModelsBuilder.nuspec | 4 ++-- src/Our.ModelsBuilder/Our.ModelsBuilder.csproj | 3 +++ 9 files changed, 30 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 19512f68..2ba065f3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -22,7 +22,7 @@ stages: - task: VSBuild@1 inputs: solution: '**\*.sln' - configuration: "Release" + configuration: "DevOps" - task: PowerShell@2 inputs: filePath: '$(System.DefaultWorkingDirectory)\build\SetVersion.ps1' diff --git a/src/Our.ModelsBuilder.Console/Our.ModelsBuilder.Console.csproj b/src/Our.ModelsBuilder.Console/Our.ModelsBuilder.Console.csproj index 130659ae..21dc4c95 100644 --- a/src/Our.ModelsBuilder.Console/Our.ModelsBuilder.Console.csproj +++ b/src/Our.ModelsBuilder.Console/Our.ModelsBuilder.Console.csproj @@ -29,6 +29,9 @@ prompt 4 + + bin\DevOps\ + diff --git a/src/Our.ModelsBuilder.Extension/Our.ModelsBuilder.Extension.csproj b/src/Our.ModelsBuilder.Extension/Our.ModelsBuilder.Extension.csproj index 18d9e323..392715d6 100644 --- a/src/Our.ModelsBuilder.Extension/Our.ModelsBuilder.Extension.csproj +++ b/src/Our.ModelsBuilder.Extension/Our.ModelsBuilder.Extension.csproj @@ -49,6 +49,9 @@ true True + + bin\DevOps\ + diff --git a/src/Our.ModelsBuilder.Tests/Our.ModelsBuilder.Tests.csproj b/src/Our.ModelsBuilder.Tests/Our.ModelsBuilder.Tests.csproj index a5854102..90f6c4d9 100644 --- a/src/Our.ModelsBuilder.Tests/Our.ModelsBuilder.Tests.csproj +++ b/src/Our.ModelsBuilder.Tests/Our.ModelsBuilder.Tests.csproj @@ -29,6 +29,9 @@ 4 latest + + bin\DevOps\ + 4.13.1 diff --git a/src/Our.ModelsBuilder.Web/Nuget/Our.ModelsBuilder.Web.nuspec b/src/Our.ModelsBuilder.Web/Nuget/Our.ModelsBuilder.Web.nuspec index d05e5ba7..e40cbc3d 100644 --- a/src/Our.ModelsBuilder.Web/Nuget/Our.ModelsBuilder.Web.nuspec +++ b/src/Our.ModelsBuilder.Web/Nuget/Our.ModelsBuilder.Web.nuspec @@ -25,8 +25,8 @@ - - + + diff --git a/src/Our.ModelsBuilder.Web/Our.ModelsBuilder.Web.csproj b/src/Our.ModelsBuilder.Web/Our.ModelsBuilder.Web.csproj index 567ee8ad..3d1fb71d 100644 --- a/src/Our.ModelsBuilder.Web/Our.ModelsBuilder.Web.csproj +++ b/src/Our.ModelsBuilder.Web/Our.ModelsBuilder.Web.csproj @@ -26,6 +26,9 @@ prompt 4 + + bin\DevOps\ + Properties\SolutionInfo.cs diff --git a/src/Our.ModelsBuilder.sln b/src/Our.ModelsBuilder.sln index ea8a5465..076b7e24 100644 --- a/src/Our.ModelsBuilder.sln +++ b/src/Our.ModelsBuilder.sln @@ -34,28 +34,38 @@ Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU + DevOps|Any CPU = DevOps|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {998FB014-303A-4146-B3E4-B927BAB0210F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {998FB014-303A-4146-B3E4-B927BAB0210F}.Debug|Any CPU.Build.0 = Debug|Any CPU {998FB014-303A-4146-B3E4-B927BAB0210F}.Release|Any CPU.ActiveCfg = Release|Any CPU {998FB014-303A-4146-B3E4-B927BAB0210F}.Release|Any CPU.Build.0 = Release|Any CPU + {998FB014-303A-4146-B3E4-B927BAB0210F}.DevOps|Any CPU.ActiveCfg = DevOps|Any CPU + {998FB014-303A-4146-B3E4-B927BAB0210F}.DevOps|Any CPU.Build.0 = DevOps|Any CPU {CF597D44-04EA-4FD7-89C8-E4849D1355C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CF597D44-04EA-4FD7-89C8-E4849D1355C8}.Debug|Any CPU.Build.0 = Debug|Any CPU {CF597D44-04EA-4FD7-89C8-E4849D1355C8}.Release|Any CPU.ActiveCfg = Release|Any CPU {CF597D44-04EA-4FD7-89C8-E4849D1355C8}.Release|Any CPU.Build.0 = Release|Any CPU + {CF597D44-04EA-4FD7-89C8-E4849D1355C8}.DevOps|Any CPU.ActiveCfg = DevOps|Any CPU + {CF597D44-04EA-4FD7-89C8-E4849D1355C8}.DevOps|Any CPU.Build.0 = DevOps|Any CPU {F0B757DF-0CF7-4AAF-8DD0-F46EDF25C3A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F0B757DF-0CF7-4AAF-8DD0-F46EDF25C3A3}.Debug|Any CPU.Build.0 = Debug|Any CPU {F0B757DF-0CF7-4AAF-8DD0-F46EDF25C3A3}.Release|Any CPU.ActiveCfg = Release|Any CPU {F0B757DF-0CF7-4AAF-8DD0-F46EDF25C3A3}.Release|Any CPU.Build.0 = Release|Any CPU + {F0B757DF-0CF7-4AAF-8DD0-F46EDF25C3A3}.DevOps|Any CPU.ActiveCfg = DevOps|Any CPU + {F0B757DF-0CF7-4AAF-8DD0-F46EDF25C3A3}.DevOps|Any CPU.Build.0 = DevOps|Any CPU {2317BE7F-1723-4512-B863-5B6835E583A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2317BE7F-1723-4512-B863-5B6835E583A2}.Debug|Any CPU.Build.0 = Debug|Any CPU {2317BE7F-1723-4512-B863-5B6835E583A2}.Release|Any CPU.ActiveCfg = Release|Any CPU {2317BE7F-1723-4512-B863-5B6835E583A2}.Release|Any CPU.Build.0 = Release|Any CPU + {2317BE7F-1723-4512-B863-5B6835E583A2}.DevOps|Any CPU.ActiveCfg = DevOps|Any CPU + {2317BE7F-1723-4512-B863-5B6835E583A2}.DevOps|Any CPU.Build.0 = DevOps|Any CPU {0419A43D-78C2-46C9-95A9-2470F224D60F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0419A43D-78C2-46C9-95A9-2470F224D60F}.Debug|Any CPU.Build.0 = Debug|Any CPU {0419A43D-78C2-46C9-95A9-2470F224D60F}.Release|Any CPU.ActiveCfg = Release|Any CPU {0419A43D-78C2-46C9-95A9-2470F224D60F}.Release|Any CPU.Build.0 = Release|Any CPU + {0419A43D-78C2-46C9-95A9-2470F224D60F}.DevOps|Any CPU.ActiveCfg = DevOps|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/Our.ModelsBuilder/Nuget/Our.ModelsBuilder.nuspec b/src/Our.ModelsBuilder/Nuget/Our.ModelsBuilder.nuspec index ef131e71..bb361305 100644 --- a/src/Our.ModelsBuilder/Nuget/Our.ModelsBuilder.nuspec +++ b/src/Our.ModelsBuilder/Nuget/Our.ModelsBuilder.nuspec @@ -25,8 +25,8 @@ - - + + diff --git a/src/Our.ModelsBuilder/Our.ModelsBuilder.csproj b/src/Our.ModelsBuilder/Our.ModelsBuilder.csproj index e9a28984..d86f48b8 100644 --- a/src/Our.ModelsBuilder/Our.ModelsBuilder.csproj +++ b/src/Our.ModelsBuilder/Our.ModelsBuilder.csproj @@ -36,6 +36,9 @@ latest + + bin\DevOps\ + From a6057820ecfa6134a7f0d750a6af7cac8148ac89 Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Thu, 1 Oct 2020 09:46:28 +0100 Subject: [PATCH 16/31] correct settings for Devops --- src/Our.ModelsBuilder.Tests/Our.ModelsBuilder.Tests.csproj | 6 ++++++ src/Our.ModelsBuilder.Web/Our.ModelsBuilder.Web.csproj | 5 +++++ src/Our.ModelsBuilder/Our.ModelsBuilder.csproj | 7 +++++++ 3 files changed, 18 insertions(+) diff --git a/src/Our.ModelsBuilder.Tests/Our.ModelsBuilder.Tests.csproj b/src/Our.ModelsBuilder.Tests/Our.ModelsBuilder.Tests.csproj index 90f6c4d9..86568b20 100644 --- a/src/Our.ModelsBuilder.Tests/Our.ModelsBuilder.Tests.csproj +++ b/src/Our.ModelsBuilder.Tests/Our.ModelsBuilder.Tests.csproj @@ -30,7 +30,13 @@ latest + pdbonly + true bin\DevOps\ + TRACE + prompt + 4 + latest diff --git a/src/Our.ModelsBuilder.Web/Our.ModelsBuilder.Web.csproj b/src/Our.ModelsBuilder.Web/Our.ModelsBuilder.Web.csproj index 3d1fb71d..d6f1fd2b 100644 --- a/src/Our.ModelsBuilder.Web/Our.ModelsBuilder.Web.csproj +++ b/src/Our.ModelsBuilder.Web/Our.ModelsBuilder.Web.csproj @@ -27,7 +27,12 @@ 4 + pdbonly + true bin\DevOps\ + TRACE + prompt + 4 diff --git a/src/Our.ModelsBuilder/Our.ModelsBuilder.csproj b/src/Our.ModelsBuilder/Our.ModelsBuilder.csproj index d86f48b8..eacf20e5 100644 --- a/src/Our.ModelsBuilder/Our.ModelsBuilder.csproj +++ b/src/Our.ModelsBuilder/Our.ModelsBuilder.csproj @@ -37,7 +37,14 @@ + pdbonly + true bin\DevOps\ + TRACE + prompt + 4 + bin\Release\Our.ModelsBuilder.xml + latest From abdbbba50b5064d88819b4a504a67964f74465f8 Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Thu, 1 Oct 2020 13:08:09 +0100 Subject: [PATCH 17/31] correct path --- build/SetVersion.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/SetVersion.ps1 b/build/SetVersion.ps1 index d640faac..4555af39 100644 --- a/build/SetVersion.ps1 +++ b/build/SetVersion.ps1 @@ -1,5 +1,5 @@ Write-Host "Get version" -$version = (Get-Command "..\src\Our.ModelsBuilder\bin\Release\Our.ModelsBuilder.dll").FileVersionInfo.ProductVersion +$version = (Get-Command "..\src\Our.ModelsBuilder\bin\DevOps\Our.ModelsBuilder.dll").FileVersionInfo.ProductVersion $version $nuspecs = Get-ChildItem -Path ..\*\*.nuspec -Recurse -Force; $nuspecs | Foreach-Object { From cc5688f6d9368ee45534e94e407abaec298487de Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Thu, 1 Oct 2020 14:19:15 +0100 Subject: [PATCH 18/31] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2ba065f3..48f38bfc 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -26,6 +26,7 @@ stages: - task: PowerShell@2 inputs: filePath: '$(System.DefaultWorkingDirectory)\build\SetVersion.ps1' + workingDirectory: '$(System.DefaultWorkingDirectory)' - task: NuGetCommand@2 inputs: command: 'pack' From 7ed3240f91b24ebaca4b9ba9b8bc317a6027b7a5 Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Thu, 1 Oct 2020 14:24:27 +0100 Subject: [PATCH 19/31] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 48f38bfc..bf521457 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -26,7 +26,7 @@ stages: - task: PowerShell@2 inputs: filePath: '$(System.DefaultWorkingDirectory)\build\SetVersion.ps1' - workingDirectory: '$(System.DefaultWorkingDirectory)' + workingDirectory: '$(System.DefaultWorkingDirectory)\build' - task: NuGetCommand@2 inputs: command: 'pack' From f974efe0789d2f4b81bfd8ad193fef137db960cb Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Thu, 1 Oct 2020 14:36:54 +0100 Subject: [PATCH 20/31] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index bf521457..ea149137 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -36,11 +36,25 @@ stages: inputs: SourceFolder: '$(System.DefaultWorkingDirectory)' Contents: '**\*test*.dll' - TargetFolder: '$(System.ArtifactStagingDirectory)' + TargetFolder: '$(System.ArtifactStagingDirectory)' + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)' + ArtifactName: 'drop' + publishLocation: 'Container' - job: Test pool: vmImage: 'windows-2019' steps: + - task: DownloadBuildArtifacts@0 + inputs: + buildType: 'specific' + project: 'da55b2db-f813-43b0-98a8-dcc236b7f9c5' + pipeline: '1' + buildVersionToDownload: 'latest' + downloadType: 'specific' + itemPattern: '**\*test*.dll' + downloadPath: '$(System.DefaultWorkingDirectory)' - task: VSTest@2 inputs: testSelector: 'testAssemblies' @@ -48,4 +62,4 @@ stages: **\*test*.dll !**\*TestAdapter.dll !**\obj\** - searchFolder: '' \ No newline at end of file + searchFolder: '$(System.DefaultWorkingDirectory)' \ No newline at end of file From 7fcbbf9cf681e6033f25bba3f2d5625bb6f105a4 Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Thu, 1 Oct 2020 15:26:22 +0100 Subject: [PATCH 21/31] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ea149137..5bbc13f9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -42,17 +42,17 @@ stages: PathtoPublish: '$(Build.ArtifactStagingDirectory)' ArtifactName: 'drop' publishLocation: 'Container' +- stage: test + displayName: test + jobs: - job: Test pool: vmImage: 'windows-2019' steps: - task: DownloadBuildArtifacts@0 inputs: - buildType: 'specific' - project: 'da55b2db-f813-43b0-98a8-dcc236b7f9c5' - pipeline: '1' - buildVersionToDownload: 'latest' - downloadType: 'specific' + buildType: 'current' + artifactName: 'manifests' itemPattern: '**\*test*.dll' downloadPath: '$(System.DefaultWorkingDirectory)' - task: VSTest@2 From 437ae296fbf812ef37272f86d941482419716478 Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Thu, 1 Oct 2020 15:39:02 +0100 Subject: [PATCH 22/31] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5bbc13f9..31aaf05a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -52,7 +52,7 @@ stages: - task: DownloadBuildArtifacts@0 inputs: buildType: 'current' - artifactName: 'manifests' + downloadType: 'specific' itemPattern: '**\*test*.dll' downloadPath: '$(System.DefaultWorkingDirectory)' - task: VSTest@2 From 5f12105679aaa932454009c12ec2a541e2b616bd Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Thu, 1 Oct 2020 15:44:34 +0100 Subject: [PATCH 23/31] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 31aaf05a..8973acb0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -35,8 +35,8 @@ stages: - task: CopyFiles@2 inputs: SourceFolder: '$(System.DefaultWorkingDirectory)' - Contents: '**\*test*.dll' - TargetFolder: '$(System.ArtifactStagingDirectory)' + Contents: '**\*Our.ModelsBuilder*test*' + TargetFolder: '$(System.ArtifactStagingDirectory)\drop' - task: PublishBuildArtifacts@1 inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)' @@ -53,7 +53,7 @@ stages: inputs: buildType: 'current' downloadType: 'specific' - itemPattern: '**\*test*.dll' + itemPattern: '**\*Our.ModelsBuilder*test*.dll' downloadPath: '$(System.DefaultWorkingDirectory)' - task: VSTest@2 inputs: From 7c6174d987f3f6b5bdee51035ffc6c5daca63a1f Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Thu, 1 Oct 2020 15:51:06 +0100 Subject: [PATCH 24/31] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8973acb0..41921b5a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -35,8 +35,8 @@ stages: - task: CopyFiles@2 inputs: SourceFolder: '$(System.DefaultWorkingDirectory)' - Contents: '**\*Our.ModelsBuilder*test*' - TargetFolder: '$(System.ArtifactStagingDirectory)\drop' + Contents: '**\Our.ModelsBuilder.Tests.dll' + TargetFolder: '$(System.ArtifactStagingDirectory)\drop\' - task: PublishBuildArtifacts@1 inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)' From 0126c1d0f98461b22b75ff51469c863a2aaec6ad Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Thu, 1 Oct 2020 15:57:52 +0100 Subject: [PATCH 25/31] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 41921b5a..53e07236 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -36,7 +36,8 @@ stages: inputs: SourceFolder: '$(System.DefaultWorkingDirectory)' Contents: '**\Our.ModelsBuilder.Tests.dll' - TargetFolder: '$(System.ArtifactStagingDirectory)\drop\' + flattenFolders: true + TargetFolder: '$(System.ArtifactStagingDirectory)' - task: PublishBuildArtifacts@1 inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)' From 769dba35a9a9e98dde329134f3afa52b702cb626 Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Thu, 1 Oct 2020 16:13:38 +0100 Subject: [PATCH 26/31] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 53e07236..781aa723 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -32,12 +32,13 @@ stages: command: 'pack' packagesToPack: '**/*.nuspec' versioningScheme: 'off' - - task: CopyFiles@2 + - task: ArchiveFiles@2 inputs: - SourceFolder: '$(System.DefaultWorkingDirectory)' - Contents: '**\Our.ModelsBuilder.Tests.dll' - flattenFolders: true - TargetFolder: '$(System.ArtifactStagingDirectory)' + rootFolderOrFile: 'src\Our.ModelsBuilder.Tests\bin\DevOps\Our.ModelsBuilder.Tests.dll' + includeRootFolder: true + archiveType: 'zip' + archiveFile: '$(Build.ArtifactStagingDirectory)/Tests.zip' + replaceExistingArchive: true - task: PublishBuildArtifacts@1 inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)' @@ -54,8 +55,13 @@ stages: inputs: buildType: 'current' downloadType: 'specific' - itemPattern: '**\*Our.ModelsBuilder*test*.dll' + itemPattern: '**\Tests.zip' downloadPath: '$(System.DefaultWorkingDirectory)' + - task: ExtractFiles@1 + inputs: + archiveFilePatterns: '**/*.zip' + destinationFolder: '$(System.DefaultWorkingDirectory)\' + cleanDestinationFolder: true - task: VSTest@2 inputs: testSelector: 'testAssemblies' From 35cc341d24fe0e22f4ef7a34ba9cc3760fca90c0 Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Thu, 1 Oct 2020 16:28:08 +0100 Subject: [PATCH 27/31] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 781aa723..c68be766 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -59,8 +59,8 @@ stages: downloadPath: '$(System.DefaultWorkingDirectory)' - task: ExtractFiles@1 inputs: - archiveFilePatterns: '**/*.zip' - destinationFolder: '$(System.DefaultWorkingDirectory)\' + archiveFilePatterns: '**/Tests.zip' + destinationFolder: '$(System.DefaultWorkingDirectory)\test' cleanDestinationFolder: true - task: VSTest@2 inputs: @@ -69,4 +69,4 @@ stages: **\*test*.dll !**\*TestAdapter.dll !**\obj\** - searchFolder: '$(System.DefaultWorkingDirectory)' \ No newline at end of file + searchFolder: '$(System.DefaultWorkingDirectory)\test' \ No newline at end of file From 6de2f34e82809721003a61c6beba3d3e25a50d69 Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Thu, 1 Oct 2020 16:40:54 +0100 Subject: [PATCH 28/31] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c68be766..dbf36c96 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -39,6 +39,13 @@ stages: archiveType: 'zip' archiveFile: '$(Build.ArtifactStagingDirectory)/Tests.zip' replaceExistingArchive: true + - task: ArchiveFiles@2 + inputs: + rootFolderOrFile: 'src\Our.ModelsBuilder.Tests\NUnit3.TestAdapter.dll' + includeRootFolder: true + archiveType: 'zip' + archiveFile: '$(Build.ArtifactStagingDirectory)/TestsAdapter.zip' + replaceExistingArchive: true - task: PublishBuildArtifacts@1 inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)' @@ -62,6 +69,11 @@ stages: archiveFilePatterns: '**/Tests.zip' destinationFolder: '$(System.DefaultWorkingDirectory)\test' cleanDestinationFolder: true + - task: ExtractFiles@1 + inputs: + archiveFilePatterns: '**/TestsAdapter.zip' + destinationFolder: '$(System.DefaultWorkingDirectory)\test' + cleanDestinationFolder: false - task: VSTest@2 inputs: testSelector: 'testAssemblies' From 640401d6f7db621cda7f47e636a1420aff7e9f06 Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Thu, 1 Oct 2020 16:44:57 +0100 Subject: [PATCH 29/31] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index dbf36c96..2060333a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -41,7 +41,7 @@ stages: replaceExistingArchive: true - task: ArchiveFiles@2 inputs: - rootFolderOrFile: 'src\Our.ModelsBuilder.Tests\NUnit3.TestAdapter.dll' + rootFolderOrFile: 'src\Our.ModelsBuilder.Tests\bin\DevOps\NUnit3.TestAdapter.dll' includeRootFolder: true archiveType: 'zip' archiveFile: '$(Build.ArtifactStagingDirectory)/TestsAdapter.zip' From 0639fb5fa534b402a496316fd03cd6ee7d9a18f2 Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Thu, 1 Oct 2020 16:51:58 +0100 Subject: [PATCH 30/31] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2060333a..0caad9e2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -62,7 +62,7 @@ stages: inputs: buildType: 'current' downloadType: 'specific' - itemPattern: '**\Tests.zip' + itemPattern: '**\Tests*.zip' downloadPath: '$(System.DefaultWorkingDirectory)' - task: ExtractFiles@1 inputs: From 032b361a2aaa2d4648cd1dec0c765a0e13c2ab11 Mon Sep 17 00:00:00 2001 From: Arkadiusz Biel Date: Fri, 2 Oct 2020 10:33:51 +0100 Subject: [PATCH 31/31] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0caad9e2..ebd61d6e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -34,18 +34,11 @@ stages: versioningScheme: 'off' - task: ArchiveFiles@2 inputs: - rootFolderOrFile: 'src\Our.ModelsBuilder.Tests\bin\DevOps\Our.ModelsBuilder.Tests.dll' - includeRootFolder: true + rootFolderOrFile: 'src\Our.ModelsBuilder.Tests\bin\DevOps' + includeRootFolder: false archiveType: 'zip' archiveFile: '$(Build.ArtifactStagingDirectory)/Tests.zip' replaceExistingArchive: true - - task: ArchiveFiles@2 - inputs: - rootFolderOrFile: 'src\Our.ModelsBuilder.Tests\bin\DevOps\NUnit3.TestAdapter.dll' - includeRootFolder: true - archiveType: 'zip' - archiveFile: '$(Build.ArtifactStagingDirectory)/TestsAdapter.zip' - replaceExistingArchive: true - task: PublishBuildArtifacts@1 inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)' @@ -69,11 +62,6 @@ stages: archiveFilePatterns: '**/Tests.zip' destinationFolder: '$(System.DefaultWorkingDirectory)\test' cleanDestinationFolder: true - - task: ExtractFiles@1 - inputs: - archiveFilePatterns: '**/TestsAdapter.zip' - destinationFolder: '$(System.DefaultWorkingDirectory)\test' - cleanDestinationFolder: false - task: VSTest@2 inputs: testSelector: 'testAssemblies'