2021-08-20 22:16:36 +03:00
|
|
|
|
|
|
|
[CmdletBinding()]
|
|
|
|
Param (
|
|
|
|
[Parameter(Mandatory=$True)]
|
|
|
|
[string] $PackageName,
|
|
|
|
[string] $NewVersionString,
|
2021-11-02 22:29:42 +03:00
|
|
|
[string] $ReleaseDate,
|
|
|
|
[boolean] $ReplaceLatestEntryTitle=$true
|
2021-08-20 22:16:36 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
. (Join-Path $PSScriptRoot ".." common scripts common.ps1)
|
|
|
|
|
|
|
|
$pkgProperties = Get-PkgProperties -PackageName $PackageName
|
|
|
|
$packageVersion = $pkgProperties.Version
|
|
|
|
|
|
|
|
$packageSemVer = [AzureEngSemanticVersion]::new($packageVersion)
|
|
|
|
|
|
|
|
if ([System.String]::IsNullOrEmpty($NewVersionString))
|
|
|
|
{
|
|
|
|
$packageSemVer.IncrementAndSetToPrerelease()
|
|
|
|
& "${EngCommonScriptsDir}/Update-ChangeLog.ps1" -Version $packageSemVer.ToString() `
|
|
|
|
-ChangelogPath $pkgProperties.ChangeLogPath -Unreleased $True
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$packageSemVer = [AzureEngSemanticVersion]::new($NewVersionString)
|
|
|
|
& "${EngCommonScriptsDir}/Update-ChangeLog.ps1" -Version $packageSemVer.ToString() `
|
|
|
|
-ChangelogPath $pkgProperties.ChangeLogPath -Unreleased $False `
|
2021-11-02 22:29:42 +03:00
|
|
|
-ReplaceLatestEntryTitle $ReplaceLatestEntryTitle -ReleaseDate $ReleaseDate
|
2021-08-20 22:16:36 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
$podSpecFile = Join-Path $pkgProperties.DirectoryPath "$($pkgProperties.Name).podspec.json"
|
|
|
|
$podSpecContent = Get-Content -Path $podSpecFile | ConvertFrom-Json
|
|
|
|
|
|
|
|
$podSpecContent.Version = $packageSemVer.ToString()
|
|
|
|
Set-Content -Path $podSpecFile -Value ($podSpecContent | ConvertTo-Json) -NoNewline
|