diff --git a/ci/README.md b/ci/README.md index 98b5da0d4..ff2945c50 100644 --- a/ci/README.md +++ b/ci/README.md @@ -11,18 +11,24 @@ repositories used to do for one package tree each. publish, the two on-premise engines that build a native library, and the generated accessors. The other scripts loop over it rather than naming folders themselves. -- [packages.json](packages.json) lists every published module as a package, - named by its artifactId, with its folder, the other folders its build takes - files from, and the packages it depends on, its parent included. A parent's - folder is its `pom.xml` alone, because the rest of the folder is its - modules. [build-project.ps1](build-project.ps1) fails a pull request whose - poms refer to a package that `DependsOn` does not name, or add a module - that has no entry. +- [packages.json](packages.json) lists every module of the published trees, + named by its artifactId, with its folder. Each published module is a + package, with the other folders its build takes files from and the packages + it depends on, its parent included. The example modules inside the + published trees have `Publish` false, so they are never released. A + parent's folder is its `pom.xml` alone, because the rest of the folder is + its modules. [build-project.ps1](build-project.ps1) fails a pull request + whose poms refer to a package that `DependsOn` does not name, whose + published poms refer to an unpublished module, or that adds a module with + no entry. Its Pester 5 tests are [packages.Tests.ps1](packages.Tests.ps1). - The root `pom.xml` builds every tree in one reactor but is not their parent. [build-package.ps1](build-package.ps1) writes each published module's own version into its `pom.xml`, with the versions of its parent and of the packages it depends on, and deploys only the modules being released. The - examples are built and tested but left out of the deploy. + examples are built and tested but left out of the deploy. The example + modules inside the published trees take the versions of the published + packages they refer to and keep their own, so the reactor still finds every + parent. - [build-project.ps1](build-project.ps1) and [run-unit-tests.ps1](run-unit-tests.ps1) use the `dev` profile, so a pull request tests the examples against the libraries it changes. The publish diff --git a/ci/packages.Tests.ps1 b/ci/packages.Tests.ps1 new file mode 100644 index 000000000..e7d18bbd8 --- /dev/null +++ b/ci/packages.Tests.ps1 @@ -0,0 +1,151 @@ +# Pester 5 tests of the packages.json check in packages.ps1 and of +# Set-PomVersions in release.ps1, on a small published tree that holds an +# unpublished examples module, and of the check on this repository. + +BeforeAll { + # release.ps1 finds common-ci's release plan two folders up, so the + # scripts are copied into a folder laid out that way, with a stub plan. + $Root = Join-Path ([IO.Path]::GetTempPath()) "packages-$PID" + $null = New-Item -ItemType Directory -Force (Join-Path $Root 'steps') + Copy-Item -Recurse $PSScriptRoot (Join-Path $Root 'scripts' 'ci') + Set-Content (Join-Path $Root 'steps' 'release-plan.ps1') ` + 'function Get-ReleasePlan([string]$RepoPath) { }' + . (Join-Path $Root 'scripts' 'ci' 'release.ps1') + + $Development = '1.0.0-SNAPSHOT' + + function New-Pom([string]$ArtifactId, [string]$Parent, [string[]]$Modules, + [string[]]$Dependencies) { + $lines = @( + '' + '' + ' 4.0.0') + if ($Parent) { + $lines += @( + ' ' + ' com.51degrees' + " $Parent" + " $Development" + ' ') + } else { + $lines += ' com.51degrees' + } + $lines += " $ArtifactId" + if (-not $Parent) { + $lines += " $Development" + } + if ($Modules) { + $lines += ' pom' + $lines += ' ' + $lines += @($Modules | ForEach-Object { " $_" }) + $lines += ' ' + } + if ($Dependencies) { + $lines += ' ' + foreach ($dependency in $Dependencies) { + $lines += @( + ' ' + ' com.51degrees' + " $dependency" + ' ${project.version}' + ' ') + } + $lines += ' ' + } + $lines += '' + return $lines -join "`n" + } + + # A published tree with a published library, and an unpublished examples + # parent whose example uses the library. $LibraryUses makes the library + # refer to another module, and $Leave drops an entry from packages.json. + function New-Repo([string]$LibraryUses, [string]$Leave) { + $repo = Join-Path $TestDrive ([Guid]::NewGuid().ToString('N')) + $poms = [ordered]@{ + 'tree/pom.xml' = New-Pom 'tree' -Modules 'lib', 'examples' + 'tree/lib/pom.xml' = New-Pom 'lib' 'tree' -Dependencies $LibraryUses + 'tree/examples/pom.xml' = New-Pom 'examples' 'tree' -Modules 'example' + 'tree/examples/example/pom.xml' = New-Pom 'example' 'examples' -Dependencies 'lib' + } + foreach ($path in $poms.Keys) { + $file = Join-Path $repo $path + $null = New-Item -ItemType Directory -Force (Split-Path $file) + Set-Content -LiteralPath $file -Value $poms[$path] -NoNewline + } + $libraryDependsOn = @('tree') + @($LibraryUses | Where-Object { $_ }) + $entries = @( + [ordered]@{ Name = 'tree'; Path = 'tree/pom.xml'; DependsOn = @(); Publish = $true } + [ordered]@{ Name = 'lib'; Path = 'tree/lib'; DependsOn = $libraryDependsOn; Publish = $true } + [ordered]@{ Name = 'examples'; Path = 'tree/examples/pom.xml'; Publish = $false } + [ordered]@{ Name = 'example'; Path = 'tree/examples/example'; Publish = $false } + ) | Where-Object { $_.Name -ne $Leave } + $null = New-Item -ItemType Directory -Force (Join-Path $repo 'ci') + ConvertTo-Json -InputObject @($entries) -Depth 4 | + Set-Content (Join-Path $repo 'ci' 'packages.json') + return $repo + } + + function Get-Version([string]$Repo, [string]$Path, [string]$XPath) { + $pom = Read-Pom (Join-Path $Repo $Path) + return $pom.Xml.SelectSingleNode($XPath, $pom.Ns).InnerText + } + + $RealTrees = $Trees + $Trees = @(@{ Path = 'tree'; Publish = $true }) +} + +AfterAll { + Remove-Item -Recurse -Force $Root +} + +Describe 'Get-PackagesJsonGaps' { + It 'accepts unpublished modules in a published tree' { + Get-PackagesJsonGaps (New-Repo) | Should -BeNullOrEmpty + } + + It 'names a published module that refers to an unpublished one' { + $gaps = @(Get-PackagesJsonGaps (New-Repo -LibraryUses 'example')) + $gaps | Should -Be @( + 'tree/lib/pom.xml refers to example, which ci/packages.json does not publish') + } + + It 'names a module of a published tree with no entry' { + $gaps = @(Get-PackagesJsonGaps (New-Repo -Leave 'example')) + $gaps | Should -Be @( + 'tree/examples/example/pom.xml is a module of a published tree with no entry in ci/packages.json') + } + + It 'finds nothing missing in this repository, whose examples are not published' { + $Trees = $RealTrees + $repo = Join-Path $PSScriptRoot '..' + Get-PackagesJsonGaps $repo | Should -BeNullOrEmpty + $examples = @(Get-PackageEntries $repo | Where-Object { $_.Path -match 'example' }) + $examples.Count | Should -BeGreaterThan 0 + $examples | Where-Object { $_.Publish -eq $true } | Should -BeNullOrEmpty + } +} + +Describe 'Set-PomVersions' { + BeforeAll { + $repo = New-Repo + Set-PomVersions $repo @{ tree = '4.6.2'; lib = '4.6.2' } + } + + It 'gives each published module its version and its parent''s' { + Get-Version $repo 'tree/pom.xml' '/m:project/m:version' | Should -Be '4.6.2' + Get-Version $repo 'tree/lib/pom.xml' '/m:project/m:version' | Should -Be '4.6.2' + Get-Version $repo 'tree/lib/pom.xml' '/m:project/m:parent/m:version' | Should -Be '4.6.2' + } + + It 'gives an unpublished module its published parent''s version and keeps its own' { + Get-Version $repo 'tree/examples/pom.xml' '/m:project/m:parent/m:version' | Should -Be '4.6.2' + Get-Version $repo 'tree/examples/pom.xml' '/m:project/m:version' | Should -Be $Development + } + + It 'leaves an unpublished parent''s version for its modules, and gives them the published versions they use' { + $path = 'tree/examples/example/pom.xml' + Get-Version $repo $path '/m:project/m:parent/m:version' | Should -Be $Development + Get-Version $repo $path '/m:project/m:version' | Should -Be $Development + Get-Version $repo $path '//m:dependency/m:version' | Should -Be '4.6.2' + } +} diff --git a/ci/packages.json b/ci/packages.json index 92dbc2297..5a19d7cf4 100644 --- a/ci/packages.json +++ b/ci/packages.json @@ -16,16 +16,16 @@ {"Name": "pipeline.web", "Path": "pipeline/pipeline.web.packages/pipeline.web", "DependsOn": ["pipeline.web.packages", "pipeline.web.shared", "pipeline.core"], "Publish": true}, {"Name": "pipeline.web.mvc", "Path": "pipeline/pipeline.web.packages/pipeline.web.mvc", "DependsOn": ["pipeline.web.packages", "pipeline.web", "pipeline.core"], "Publish": true}, {"Name": "pipeline-aggregate", "Path": "pipeline/pipeline.aggregate", "DependsOn": ["pipeline", "pipeline.web", "pipeline.javascriptbuilder", "pipeline.cloudrequestengine"], "Publish": true}, - {"Name": "pipeline.developer-examples", "Path": "pipeline/pipeline.developer-examples/pom.xml", "DependsOn": ["pipeline"], "Publish": true, "Ignore": ["pipeline/pipeline.developer-examples/**"]}, - {"Name": "pipeline.developerexamples.web.shared", "Path": "pipeline/pipeline.developer-examples/pipeline.developer-examples.web.shared", "DependsOn": ["pipeline.developer-examples"], "Publish": true, "Ignore": ["pipeline/pipeline.developer-examples/**"]}, - {"Name": "pipeline.developerexamples.flowelement", "Path": "pipeline/pipeline.developer-examples/pipeline.developer-examples.flowelement", "DependsOn": ["pipeline.developer-examples", "pipeline.core"], "Publish": true, "Ignore": ["pipeline/pipeline.developer-examples/**"]}, - {"Name": "pipeline.developerexamples.onpremiseengine", "Path": "pipeline/pipeline.developer-examples/pipeline.developer-examples.onpremise-engine", "DependsOn": ["pipeline.developer-examples", "pipeline.engines"], "Publish": true, "Ignore": ["pipeline/pipeline.developer-examples/**"]}, - {"Name": "pipeline.developerexamples.cloudengine", "Path": "pipeline/pipeline.developer-examples/pipeline.developer-examples.cloud-engine", "DependsOn": ["pipeline.developer-examples", "pipeline.cloudrequestengine"], "Publish": true, "Ignore": ["pipeline/pipeline.developer-examples/**"]}, - {"Name": "pipeline.developerexamples.clientsideelement", "Path": "pipeline/pipeline.developer-examples/pipeline.developer-examples.clientside-element", "DependsOn": ["pipeline.developer-examples", "pipeline.engines"], "Publish": true, "Ignore": ["pipeline/pipeline.developer-examples/**"]}, - {"Name": "pipeline.developerexamples.clientsideelement.mvc", "Path": "pipeline/pipeline.developer-examples/pipeline.developer-examples.clientside-element-mvc", "DependsOn": ["pipeline.developer-examples", "pipeline.developerexamples.clientsideelement", "pipeline.web.mvc", "pipeline.developerexamples.web.shared"], "Publish": true, "Ignore": ["pipeline/pipeline.developer-examples/**"]}, - {"Name": "pipeline.developerexamples.usagesharing", "Path": "pipeline/pipeline.developer-examples/pipeline.developer-examples.usage-sharing", "DependsOn": ["pipeline.developer-examples", "pipeline.engines.fiftyone"], "Publish": true, "Ignore": ["pipeline/pipeline.developer-examples/**"]}, - {"Name": "pipeline.developerexamples.fodid", "Path": "pipeline/pipeline.developer-examples/pipeline.developer-examples.fodid", "DependsOn": ["pipeline.developer-examples", "pipeline.did"], "Publish": true, "Ignore": ["pipeline/pipeline.developer-examples/**"]}, - {"Name": "pipeline.developerexamples.derivedproperty", "Path": "pipeline/pipeline.developer-examples/pipeline.developer-examples.derivedproperty", "DependsOn": ["pipeline.developer-examples", "pipeline.derivedproperty"], "Publish": true, "FirstVersion": "4.6.2", "Ignore": ["pipeline/pipeline.developer-examples/**"]}, + {"Name": "pipeline.developer-examples", "Path": "pipeline/pipeline.developer-examples/pom.xml", "Publish": false}, + {"Name": "pipeline.developerexamples.web.shared", "Path": "pipeline/pipeline.developer-examples/pipeline.developer-examples.web.shared", "Publish": false}, + {"Name": "pipeline.developerexamples.flowelement", "Path": "pipeline/pipeline.developer-examples/pipeline.developer-examples.flowelement", "Publish": false}, + {"Name": "pipeline.developerexamples.onpremiseengine", "Path": "pipeline/pipeline.developer-examples/pipeline.developer-examples.onpremise-engine", "Publish": false}, + {"Name": "pipeline.developerexamples.cloudengine", "Path": "pipeline/pipeline.developer-examples/pipeline.developer-examples.cloud-engine", "Publish": false}, + {"Name": "pipeline.developerexamples.clientsideelement", "Path": "pipeline/pipeline.developer-examples/pipeline.developer-examples.clientside-element", "Publish": false}, + {"Name": "pipeline.developerexamples.clientsideelement.mvc", "Path": "pipeline/pipeline.developer-examples/pipeline.developer-examples.clientside-element-mvc", "Publish": false}, + {"Name": "pipeline.developerexamples.usagesharing", "Path": "pipeline/pipeline.developer-examples/pipeline.developer-examples.usage-sharing", "Publish": false}, + {"Name": "pipeline.developerexamples.fodid", "Path": "pipeline/pipeline.developer-examples/pipeline.developer-examples.fodid", "Publish": false}, + {"Name": "pipeline.developerexamples.derivedproperty", "Path": "pipeline/pipeline.developer-examples/pipeline.developer-examples.derivedproperty", "Publish": false}, {"Name": "pipeline.device-detection", "Path": "device-detection/pom.xml", "DependsOn": ["pipeline-aggregate"], "Publish": true}, {"Name": "device-detection.shared", "Path": "device-detection/device-detection.shared", "DependsOn": ["pipeline.device-detection", "pipeline.engines.fiftyone"], "Publish": true}, {"Name": "device-detection.hash.engine.on-premise", "Path": "device-detection/device-detection.hash.engine.on-premise", "ExtraPaths": ["cxx"], "DependsOn": ["pipeline.device-detection", "device-detection.shared"], "Publish": true}, @@ -41,9 +41,9 @@ {"Name": "geo-location.core", "Path": "location/geo-location.core", "DependsOn": ["pipeline.geo-location", "pipeline.cloudrequestengine"], "Publish": true}, {"Name": "geo-location.cloud", "Path": "location/geo-location.cloud", "DependsOn": ["pipeline.geo-location", "geo-location.core", "pipeline.cloudrequestengine", "pipeline.engines.fiftyone"], "Publish": true}, {"Name": "geo-location", "Path": "location/geo-location", "DependsOn": ["pipeline.geo-location", "geo-location.cloud", "pipeline.cloudrequestengine", "pipeline.common"], "Publish": true}, - {"Name": "geo-location.examples", "Path": "location/geo-location.shell.examples", "DependsOn": ["pipeline.geo-location", "geo-location", "device-detection", "pipeline.engines"], "Publish": true, "Ignore": ["location/geo-location.shell.examples/**"]}, - {"Name": "geo-location.web.examples", "Path": "location/geo-location.web.examples/pom.xml", "DependsOn": ["pipeline.geo-location"], "Publish": true, "Ignore": ["location/geo-location.web.examples/**"]}, - {"Name": "geo-location.web.examples.mvc", "Path": "location/geo-location.web.examples/geo-location.web.examples.mvc", "DependsOn": ["geo-location.web.examples", "pipeline.web.mvc", "geo-location.cloud", "geo-location.web.examples.shared"], "Publish": true, "Ignore": ["location/geo-location.web.examples/**"]}, - {"Name": "geo-location.web.examples.servlet", "Path": "location/geo-location.web.examples/geo-location.web.examples.servlet", "DependsOn": ["geo-location.web.examples", "pipeline.web", "geo-location.cloud", "geo-location.web.examples.shared"], "Publish": true, "Ignore": ["location/geo-location.web.examples/**"]}, - {"Name": "geo-location.web.examples.shared", "Path": "location/geo-location.web.examples/geo-location.web.examples.shared", "DependsOn": ["geo-location.web.examples"], "Publish": true, "Ignore": ["location/geo-location.web.examples/**"]} + {"Name": "geo-location.examples", "Path": "location/geo-location.shell.examples", "Publish": false}, + {"Name": "geo-location.web.examples", "Path": "location/geo-location.web.examples/pom.xml", "Publish": false}, + {"Name": "geo-location.web.examples.mvc", "Path": "location/geo-location.web.examples/geo-location.web.examples.mvc", "Publish": false}, + {"Name": "geo-location.web.examples.servlet", "Path": "location/geo-location.web.examples/geo-location.web.examples.servlet", "Publish": false}, + {"Name": "geo-location.web.examples.shared", "Path": "location/geo-location.web.examples/geo-location.web.examples.shared", "Publish": false} ] diff --git a/ci/packages.ps1 b/ci/packages.ps1 index f009876a4..25241f0ce 100644 --- a/ci/packages.ps1 +++ b/ci/packages.ps1 @@ -4,9 +4,9 @@ # The package trees in this repository. The root pom.xml builds them all in # one reactor but is not their parent. Publish says whether the tree's # packages go to Maven Central. The examples are built and tested but never -# published. Each published module is a package of its own in packages.json. -# The example modules inside the published trees are packages too, and give -# an Ignore glob over their whole folder, so a change to one releases nothing. +# published. Every module of a published tree has an entry in packages.json. +# Each published module is a package of its own, and the example modules +# inside the published trees have Publish false. $Trees = @( @{ Path = 'pipeline'; Publish = $true } @{ Path = 'device-detection'; Publish = $true } @@ -100,11 +100,16 @@ function Get-TestJvmArgument { $PomNamespace = 'http://maven.apache.org/POM/4.0.0' -# The packages in packages.json that are published, one per Maven module, -# each named by its artifactId. -function Get-PublishedPackages([string]$RepoPath) { +# Every entry in packages.json, one per Maven module of a published tree, each +# named by its artifactId. +function Get-PackageEntries([string]$RepoPath) { return @(Get-Content -Raw (Join-Path $RepoPath 'ci/packages.json') | - ConvertFrom-Json | Where-Object { $_.Publish -eq $true }) + ConvertFrom-Json) +} + +# The entries in packages.json that are published. +function Get-PublishedPackages([string]$RepoPath) { + return @(Get-PackageEntries $RepoPath | Where-Object { $_.Publish -eq $true }) } # A parent's Path is its pom.xml alone, because its folder also holds its @@ -200,25 +205,38 @@ function Get-PublishedModules([string]$RepoPath) { } } -# What packages.json leaves out, as one line each. Every published module must -# be a package, named by its artifactId, and each package's DependsOn must name -# every other package its pom.xml refers to. A dependency it leaves out would -# not be released when the package it depends on is, so its users would not -# get the fix. +# What packages.json leaves out, as one line each. Every module of a published +# tree must have an entry, named by its artifactId. Each published package's +# DependsOn must name every other package its pom.xml refers to, and none of +# them may be unpublished. A dependency DependsOn leaves out would not be +# released when the package it depends on is, so its users would not get the +# fix, and a published pom that refers to an unpublished module cannot be +# resolved from Maven Central. function Get-PackagesJsonGaps([string]$RepoPath) { - $packages = Get-PublishedPackages $RepoPath + $entries = Get-PackageEntries $RepoPath + $packages = @($entries | Where-Object { $_.Publish -eq $true }) $names = @($packages.Name) - $folders = @($packages | ForEach-Object { Get-ModulePath $_ }) + $unpublished = @($entries | Where-Object { $_.Publish -ne $true } | + ForEach-Object Name) + $folders = @($entries | ForEach-Object { Get-ModulePath $_ }) foreach ($folder in Get-PublishedModules $RepoPath) { if ($folders -notcontains $folder) { - "$folder/pom.xml is a published module with no entry in ci/packages.json" + "$folder/pom.xml is a module of a published tree with no entry in ci/packages.json" + } + } + foreach ($entry in $entries) { + $pom = Read-Pom (Join-Path $RepoPath (Get-PomPath $entry)) + $artifactId = Get-PomText $pom.Xml.DocumentElement 'artifactId' $pom.Ns + if ($artifactId -ne $entry.Name) { + "$(Get-PomPath $entry) is $artifactId, but ci/packages.json names it $($entry.Name)" } } foreach ($package in $packages) { $pom = Read-Pom (Join-Path $RepoPath (Get-PomPath $package)) - $artifactId = Get-PomText $pom.Xml.DocumentElement 'artifactId' $pom.Ns - if ($artifactId -ne $package.Name) { - "$(Get-PomPath $package) is $artifactId, but ci/packages.json names it $($package.Name)" + $required = @(Get-PomReferences $pom $unpublished | + ForEach-Object Name | Select-Object -Unique) + foreach ($name in $required) { + "$(Get-PomPath $package) refers to $name, which ci/packages.json does not publish" } $missing = @(Get-PomReferences $pom $names | Where-Object { $package.DependsOn -notcontains $_.Name } | diff --git a/ci/release.ps1 b/ci/release.ps1 index 3867c4b4c..704c177f7 100644 --- a/ci/release.ps1 +++ b/ci/release.ps1 @@ -81,6 +81,11 @@ function Get-BuildVersions([string]$RepoPath, $Plan = $null) { # its published pom requires the versions it was built with. The poms in the # repository keep one development version for every module, which this # replaces only in the checkout being built. +# +# The unpublished modules of the published trees, the examples, are read by the +# same reactor, so each takes the versions of the published packages it refers +# to, its parent among them, and keeps its own development version, which its +# own modules name as their parent's. function Set-PomVersions([string]$RepoPath, [hashtable]$Versions) { $gaps = @(Get-PackagesJsonGaps $RepoPath) if ($gaps.Count -gt 0) { @@ -88,23 +93,18 @@ function Set-PomVersions([string]$RepoPath, [hashtable]$Versions) { } $packages = Get-PublishedPackages $RepoPath $names = @($packages.Name) - foreach ($package in $packages) { - $pom = Read-Pom (Join-Path $RepoPath (Get-PomPath $package)) - $project = $pom.Xml.DocumentElement - $version = $project.SelectSingleNode('m:version', $pom.Ns) - if ($null -eq $version) { - # The module took its version from its parent. It gets an element - # of its own after its artifactId, indented as the artifactId is. - $artifactId = $project.SelectSingleNode('m:artifactId', $pom.Ns) - $version = $pom.Xml.CreateElement('version', $PomNamespace) - $null = $project.InsertAfter($version, $artifactId) - $indent = $artifactId.PreviousSibling - if ($null -ne $indent -and - $indent.NodeType -eq [Xml.XmlNodeType]::Whitespace) { - $null = $project.InsertAfter($indent.Clone(), $artifactId) + foreach ($entry in Get-PackageEntries $RepoPath) { + $pom = Read-Pom (Join-Path $RepoPath (Get-PomPath $entry)) + if ($entry.Publish -eq $true) { + Set-PomOwnVersion $pom $Versions[$entry.Name] + } else { + $own = Get-PomText $pom.Xml.DocumentElement 'version' $pom.Ns + if ($null -eq $own) { + $parent = $pom.Xml.SelectSingleNode('/m:project/m:parent', $pom.Ns) + $own = Get-PomText $parent 'version' $pom.Ns } + Set-PomOwnVersion $pom $own } - $version.InnerText = $Versions[$package.Name] foreach ($reference in Get-PomReferences $pom $names) { if ($null -ne $reference.Version) { $reference.Version.InnerText = $Versions[$reference.Name] @@ -114,6 +114,25 @@ function Set-PomVersions([string]$RepoPath, [hashtable]$Versions) { } } +# Sets a pom's own version. A module that takes its version from its parent +# gets an element of its own after its artifactId, indented as the artifactId +# is. +function Set-PomOwnVersion($Pom, [string]$Value) { + $project = $Pom.Xml.DocumentElement + $version = $project.SelectSingleNode('m:version', $Pom.Ns) + if ($null -eq $version) { + $artifactId = $project.SelectSingleNode('m:artifactId', $Pom.Ns) + $version = $Pom.Xml.CreateElement('version', $PomNamespace) + $null = $project.InsertAfter($version, $artifactId) + $indent = $artifactId.PreviousSibling + if ($null -ne $indent -and + $indent.NodeType -eq [Xml.XmlNodeType]::Whitespace) { + $null = $project.InsertAfter($indent.Clone(), $artifactId) + } + } + $version.InnerText = $Value +} + # The arguments that point the examples at the versions a publish built. function Get-ExampleVersionArguments([string]$RepoPath) { $versions = Get-BuildVersions $RepoPath