Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
d769b84
Change default branch name to main (#15840)
praveenkuttappan Jun 18, 2021
1d0b3dd
Fix hard-coded master (#15843)
azure-sdk Jun 18, 2021
ddf4714
[Communication]: Always use x-ms-date for Hmac (#15807)
JianpingChen Jun 18, 2021
c075155
Automatic rush update recheck (#15839)
azure-sdk Jun 18, 2021
bdff63d
[KeyVault] - Add networkAcls to MHSM ARM template (#15830)
maorleger Jun 18, 2021
d023204
[Core] - Move core-tracing to @opentelemetry/api 0.20.0 (#15672)
maorleger Jun 18, 2021
37d1df4
arm-support-identity (#15838)
colawwj Jun 21, 2021
4471210
[identity] Adding extensions API, identity-vscode, and identity-cache…
witemple-msft Jun 21, 2021
919e856
[AzureMonitorExporter] Adding support for temporary redirect (#15850)
hectorhdzg Jun 21, 2021
f9efdf4
Package artifact path (#15512)
praveenkuttappan Jun 21, 2021
d4d2c75
[service-bus] Closing some open areas where we could mask errors, and…
richardpark-msft Jun 21, 2021
5da2922
Sync eng/common directory with azure-sdk-tools for PR 1716 (#15876)
azure-sdk Jun 21, 2021
450f924
Sync eng/common directory with azure-sdk-tools for PR 1719 (#15885)
azure-sdk Jun 21, 2021
b26a218
Remove core-lro runtime dependency on core-http (#15884)
xirzec Jun 22, 2021
53d6089
[Identity] Comment improvements. Identity generally doesn't return nu…
sadasant Jun 22, 2021
8ab9b83
[Identity] README.md: Bigger title for Extensions and a markdown fix …
sadasant Jun 22, 2021
ac8d65c
[core] Update @azure/core-tracing to use @opentelemetry/api@1.0.0 (#1…
maorleger Jun 22, 2021
a64747c
Rename hardcoded master links to use main
chidozieononiwu Jun 22, 2021
bf5cd3e
[App Config] Add display_name to FeatureFlag (#15901)
HarshaNalluru Jun 22, 2021
0f4ae0c
[identity] Add publication metadata for extension pacakges (#15900)
witemple-msft Jun 22, 2021
c7f3a2a
Replace master with main in homepage links.
witemple-msft Jun 22, 2021
0eeb81a
[core] - added changelog entries for recent changes (#15902)
maorleger Jun 22, 2021
556da80
[ContainerRegistry] switch to use official TS code generator (#15777)
jeremymeng Jun 23, 2021
63bc1fd
Arm cosmosdb release (#15789)
colawwj Jun 23, 2021
b499bfb
[KeyVault] - Migrate Key Vault Admin package to Core V2 (#15881)
maorleger Jun 23, 2021
56c7442
Skip rush update when runnign using pull request (#15907)
praveenkuttappan Jun 23, 2021
5728f70
Move to @azure/msal-node-extensions 1.0.0-alpha.7 (#15908)
witemple-msft Jun 23, 2021
023db76
[Communication]Feature: add sender display name within send typing no…
LuChen-Microsoft Jun 23, 2021
a1f909d
Update ubuntu VM image (#15706)
chidozieononiwu Jun 23, 2021
6c59958
Default live test timeout to 60 minutes (#15926)
benbp Jun 23, 2021
137c671
Fix handling of typed arrays in request bodies (#15904)
xirzec Jun 23, 2021
65a90e5
[Tables] Migration Guide (#15857)
joheredi Jun 23, 2021
99d53b6
[core] - GA core-rest-pipeline 1.1.0 (#15923)
maorleger Jun 23, 2021
2d2c656
[Tables] Support AAD Authentication (#15852)
joheredi Jun 23, 2021
46078e3
Doc improvements for blob storage file upload content type 2 (#12938)
diberry Jun 24, 2021
58b1993
[service-bus] Fixing issue where links were not removed from our inte…
richardpark-msft Jun 24, 2021
bb833fc
arm-trafficmanager-release (#15695)
colawwj Jun 24, 2021
b77a2a4
arm-eventgrid-release (#15791)
colawwj Jun 24, 2021
93d102b
Bump up version for storage packages (#15849)
chidozieononiwu Jun 24, 2021
23bb270
[Core Rest] Add pagination helper for rest clients @azure-rest/core-c…
joheredi Jun 24, 2021
5f71ecd
Rename master to main
chidozieononiwu Jun 23, 2021
24302c8
[Azure Monitor Exporter] Updating OpenTelemetry API to 1.0.0 (#15934)
hectorhdzg Jun 24, 2021
1f6b914
[Tables] Add missing browser mappings (#15944)
joheredi Jun 24, 2021
d3c3f90
[Storage] Use ES2017 (#15835)
deyaaeldeen Jun 24, 2021
cbaa410
[Tables] Expose client option allowInsecureConnection (#15938)
joheredi Jun 24, 2021
3c21c59
Sync eng/common directory with azure-sdk-tools for PR 1729 (#15927)
azure-sdk Jun 24, 2021
5903b7c
[core] - Bump core-http to 2.0.0 and core-lro to 2.0.0 (#15925)
maorleger Jun 24, 2021
9b9a9d1
[Identity] Samples aligned with other languages (v1 compatible) (#15031)
sadasant Jun 24, 2021
aa8db15
Tweak workspace settings for VS Code startup perf (#15956)
xirzec Jun 24, 2021
4ff4cef
Add Ubuntu 20 to local dns bypass template (#15951)
azure-sdk Jun 24, 2021
8afa5cf
[MetricsAdvisor] Generated code and latest swagger (#15748)
KarishmaGhiya Jun 24, 2021
d9066a2
Attestation\README listing links as a list (#15914)
bashimoha Jun 24, 2021
c6b82ee
Update references from master to main (#15977)
azure-sdk Jun 25, 2021
35739ab
[App config] Perf tests (#15763)
HarshaNalluru Jun 25, 2021
bb9896d
[core-http] Throttling retry policy fix in core-http (#15832)
HarshaNalluru Jun 25, 2021
d76e6f6
arm-support-identity-ten (#15942)
colawwj Jun 25, 2021
2f90a87
[event-hubs] migrate samples to v2 (#15053)
chradek Jun 25, 2021
9440254
update signaling package version to beta7 (#16001)
LuChen-Microsoft Jun 25, 2021
ca61eb9
[ContainerRegistry] Update delete image sample (#16002)
jeremymeng Jun 25, 2021
4ccc8d9
[Identity] Test improvements (#15999)
sadasant Jun 25, 2021
63b6236
Add dev dependencies for App Config perf tests(#16009)
HarshaNalluru Jun 25, 2021
f3a8efe
[KeyVault] - Add support for getRandomBytes operation (#15955)
maorleger Jun 25, 2021
4784937
Fix pipeline error for test-utils (#15899)
praveenkuttappan Jun 25, 2021
82085ff
Prepare to move to @types/node v12 (#16012)
ramya-rao-a Jun 25, 2021
b729674
Update Node.js & browser support in README (#16011)
ramya-rao-a Jun 25, 2021
1a5d100
remove _response from response types (#16019)
KarishmaGhiya Jun 26, 2021
b8da289
Automatic rush update recheck (#16022)
azure-sdk Jun 26, 2021
ff90eba
Prepare Storage packages to move to @types/node v12 (#16020)
ramya-rao-a Jun 28, 2021
23de687
Update KV readmes with support policy (#16013)
ramya-rao-a Jun 28, 2021
d3647f8
[Cosmos] Simple endpoint refresh interval (#15781)
zfoster Jun 28, 2021
00ea067
Support track2 management packages (#15975)
praveenkuttappan Jun 28, 2021
facf5c1
Fix lint script for app config perf test (#16046)
ramya-rao-a Jun 28, 2021
37d3ed9
[core-rest] - Update core-client-paging-rest to use the latest core-r…
maorleger Jun 28, 2021
13772c2
Fix linter errors in app config perf tests (#16048)
ramya-rao-a Jun 28, 2021
21f28dc
[web-pubsub] Migrate `@azure/web-pubsub` to new core pipeline (#16010)
xirzec Jun 28, 2021
5c5c2cf
[EventGrid] Move to Core V2 Generator (#16047)
ellismg Jun 28, 2021
018fd46
update the redundant responses (#16051)
KarishmaGhiya Jun 28, 2021
8919e6a
[Identity] node-fetch takes above 2 seconds to send the request on so…
sadasant Jun 28, 2021
ec4abba
[Identity] Add support for Bridge to Kubernetes to ManagedIdentityCre…
sadasant Jun 28, 2021
df68c3e
[Azure Monitor Exporter] Separate tests into internal and public fold…
xiao-lix Jun 28, 2021
5b4eac3
[synapse] - Ignore known rollup warnings (#15948)
maorleger Jun 28, 2021
5a7c129
Update engines, @types/node to Node.js v12 (#15996)
ramya-rao-a Jun 28, 2021
f854a85
Update contributing guide to reflect Node.js support (#16057)
ramya-rao-a Jun 29, 2021
9699830
Update identity to 2.0.0-beta.4 for quantum jobs (#15801)
sarangan12 Jun 29, 2021
c8126be
[core] Retry on 503 using the Retry-After header (#15906)
sadasant Jun 29, 2021
b17fb63
[digital-twins-core] rename test folder and enable minmax testing (#1…
vishnureddy17 Jun 29, 2021
36b468c
[Identity] [InteractiveBrowserCredential] [Node] Enable PKCE (#15853)
sadasant Jun 29, 2021
d4d5002
[monitor-query] Regenerate client with stable swaggers and add in inc…
richardpark-msft Jun 29, 2021
8236d61
Updating changelog with date and feature added and running PrepareRel…
richardpark-msft Jun 29, 2021
20321ef
Convenience Method to create a synonymmap object (#16054)
sarangan12 Jun 29, 2021
14fddf7
[Identity] InteractiveBrowserCredential loginHint (#15855)
sadasant Jun 30, 2021
528f940
Sync eng/common directory with azure-sdk-tools for PR 1725 (#16079)
azure-sdk Jun 30, 2021
702007a
[core] - Update release dates for July Release (#16069)
maorleger Jun 30, 2021
bbd295a
Update devops workitem helpers (#16083)
azure-sdk Jun 30, 2021
19d0e76
[event-hubs] add AmqpAnnotatedMessage support (#15939)
chradek Jun 30, 2021
39d2a80
update core-client version to 1.2.1 (#16109)
maorleger Jun 30, 2021
44ba530
fix core-http changelog (#16116)
maorleger Jun 30, 2021
f143bcf
Sync eng/common directory with azure-sdk-tools for PR 1763 (#16091)
azure-sdk Jun 30, 2021
40dd9e4
[App Config] changelog and update versions for GA (#16115)
HarshaNalluru Jun 30, 2021
761a4e6
[Text Analytics] Merge feature branch for v5.1.0 to main (#16121)
deyaaeldeen Jun 30, 2021
d8407ad
[Identity] Support for tenant Id Challenges / tenant discovery in Cli…
sadasant Jun 30, 2021
020a075
Increment version for core releases (#16113)
azure-sdk Jun 30, 2021
cec69b6
Increment version for core releases (#16125)
azure-sdk Jun 30, 2021
d75f119
[service-bus] Fix message loss issues with peekLock and receiveAndDel…
richardpark-msft Jul 1, 2021
dea0b2e
update pipeline to feature/v4 (#15993)
dw511214992 Jul 1, 2021
f34b099
arm-security-release (#16135)
colawwj Jul 1, 2021
c07f91d
disable orginal pipeline for mgmt in main branch (#16026)
dw511214992 Jul 1, 2021
9b75850
Making secrets non-required, adding ref-docs (#16087)
KarishmaGhiya Jul 1, 2021
1eea0bb
Update docs metadata mutation logic (#16132)
azure-sdk Jul 1, 2021
e93bfac
Ensure word alpha is present in dev build (#16089)
praveenkuttappan Jul 1, 2021
55adc3d
[Text Analytics] Add test for categories filter (#16145)
deyaaeldeen Jul 1, 2021
43ecf92
Daily reference docs for JS (#15749)
danieljurek Jul 1, 2021
400a1f2
[Text Analytics] Update CHANGELOG with release date (#16146)
deyaaeldeen Jul 1, 2021
bfff737
[Perf] Update dependency core-http (#16147)
mikeharder Jul 1, 2021
e356efd
bump core-auth (#16149)
KarishmaGhiya Jul 1, 2021
899fc0a
Sync eng/common directory with azure-sdk-tools for PR 1772 (#16151)
azure-sdk Jul 1, 2021
3bcdc0b
Merge branch 'main' into feature/v4
dw511214992 Jul 2, 2021
9a47f3d
Appconfiguration release (#16190)
colawwj Jul 5, 2021
785029b
arm-postgresql-flexible (#16136)
colawwj Jul 6, 2021
52ad992
ten identity (#16252)
colawwj Jul 8, 2021
b7ed37e
identity support 20 (#16253)
colawwj Jul 8, 2021
c6fb107
identity support 30 (#16254)
colawwj Jul 8, 2021
43c5bc4
identity support 40 (#16255)
colawwj Jul 8, 2021
b79e507
identity support 50 (#16256)
colawwj Jul 8, 2021
3fe4a1c
60 rp identity support (#16293)
colawwj Jul 9, 2021
5565230
70 rp identity support (#16294)
colawwj Jul 9, 2021
4dbf054
80 rp support identity (#16295)
colawwj Jul 9, 2021
719cb86
90 rp identity support (#16296)
colawwj Jul 9, 2021
35fc536
arm-databricks-release (#16327)
colawwj Jul 9, 2021
de107dd
arm-appplatform (#16139)
colawwj Jul 9, 2021
3804071
arm-avs-release (#16198)
colawwj Jul 9, 2021
18c9ac9
arm-postgresql-flexible-release (#16307)
colawwj Jul 9, 2021
24c4d46
bugfix (#16329)
dw511214992 Jul 12, 2021
eb5b44c
enable ci only when branch is feature/*
dw511214992 Jul 12, 2021
72523c6
arm-mysql-release (#16375)
colawwj Jul 16, 2021
2c8de11
arm-postgresql-release (#16374)
colawwj Jul 16, 2021
88a3220
arm-network-release (#16330)
colawwj Jul 16, 2021
277d3eb
CodeGen from PR 14853 in Azure/azure-rest-api-specs
Jul 19, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Sync eng/common directory with azure-sdk-tools for PR 1725 (Azure#16079)
* Bring changes from JS docs metadata

* Move business logic inside Update-DocsMsMetadata.ps1

* Update with the latest changes in JS PR

* Update from latest PR feedback

* Add check for empty path to prevent crashes when creating relative paths

Co-authored-by: Daniel Jurek <djurek@microsoft.com>
  • Loading branch information
azure-sdk and danieljurek authored Jun 30, 2021
commit 528f940c0fdd78dcaca97a638532053b0eb95a63
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
steps:
- pwsh: |
if ($IsWindows) {
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem /f /v LongPathsEnabled /t REG_DWORD /d 1
git config --system core.longpaths true
}
else {
Write-Host "This script is not executing on Windows, skipping registry modification."
}
displayName: Enable long path support if necessary
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
parameters:
- name: DailyBranchVariableName
type: string
default: TargetBranchName

steps:
- pwsh: |
$branchName = $env:DAILYDOCSBRANCHNAMEOVERRIDE
if (!$branchName) {
$branchName = "daily/$(Get-Date -Format 'yyyy-MM-dd')"
}
Write-Host "Daily Branch Name: $branchName"
Write-Host "##vso[task.setvariable variable=${{ parameters.DailyBranchVariableName }};]$branchName"
displayName: Set daily docs branch name in $(${{ parameters.DailyBranchVariableName }})
5 changes: 3 additions & 2 deletions eng/common/pipelines/templates/steps/set-default-branch.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
parameters:
WorkingDirectory: '$(System.DefaultWorkingDirectory)'
RemoteRepo: 'origin'
DefaultBranchVariableName: DefaultBranch
steps:
- pwsh: |
$setDefaultBranch = (git remote show ${{ parameters.RemoteRepo }} | Out-String) -replace "(?ms).*HEAD branch: (\w+).*", '$1'
if ($LASTEXITCODE -ne 0) {
Write-Host "Not able to fetch the default branch from git command. Set to main."
$setDefaultBranch = 'main'
}
Write-Host "Setting DefaultBranch=$setDefaultBranch"
Write-Host "##vso[task.setvariable variable=DefaultBranch]$setDefaultBranch"
Write-Host "Setting ${{ parameters.DefaultBranchVariableName }}=$setDefaultBranch"
Write-Host "##vso[task.setvariable variable=${{ parameters.DefaultBranchVariableName }}]$setDefaultBranch"
displayName: "Setup Default Branch"
workingDirectory: ${{ parameters.workingDirectory }}
ignoreLASTEXITCODE: true
95 changes: 95 additions & 0 deletions eng/common/pipelines/templates/steps/update-docsms-metadata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
parameters:
- name: PackageInfoLocations
type: object
default: []
- name: RepoId
type: string
default: $(Build.Repository.Name)
- name: WorkingDirectory
type: string
default: ''
- name: ScriptDirectory
type: string
default: eng/common/scripts
- name: TargetDocRepoName
type: string
default: ''
- name: TargetDocRepoOwner
type: string
- name: Language
type: string
default: ''
- name: DailyDocsBuild
type: boolean
default: false
- name: SparseCheckoutPaths
type: object
default:
- '**'

steps:
- template: /eng/common/pipelines/templates/steps/enable-long-path-support.yml

- pwsh: |
Write-Host "###vso[task.setvariable variable=DocRepoLocation]${{ parameters.WorkingDirectory }}/doc"
displayName: Set $(DocRepoLocation)

- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
parameters:
SkipDefaultCheckout: true
Repositories:
- Name: ${{ parameters.TargetDocRepoOwner }}/${{ parameters.TargetDocRepoName }}
WorkingDirectory: $(DocRepoLocation)
Paths: ${{ parameters.SparseCheckoutPaths }}

# If performing a daily docs build set the $(TargetBranchName) to a daily branch
# name and attempt to checkout the daily docs branch. If the branch doesn't
# exist, create it
- ${{ if eq(parameters.DailyDocsBuild, 'true') }}:
- template: /eng/common/pipelines/templates/steps/set-daily-docs-branch-name.yml

- pwsh: |
$ErrorActionPreference = "Continue"
$RemoteName = "origin"
$BranchName = "$(TargetBranchName)"
# Fetch and checkout remote branch if it already exists otherwise create a new branch.
git ls-remote --exit-code --heads $RemoteName $BranchName
if ($LASTEXITCODE -eq 0) {
Write-Host "git fetch $RemoteName $BranchName"
git fetch $RemoteName $BranchName
Write-Host "git checkout $BranchName."
git checkout $BranchName
} else {
Write-Host "git checkout -b $BranchName."
git checkout -b $BranchName
}
displayName: Checkout daily docs branch if it exists
workingDirectory: $(DocRepoLocation)

# If NOT performing a daily docs build, set the $(TargetBranchName) to the
# default branch of the documentation repository.
- ${{ if ne(parameters.DailyDocsBuild, 'true') }}:
- template: /eng/common/pipelines/templates/steps/set-default-branch.yml
parameters:
WorkingDirectory: $(DocRepoLocation)
DefaultBranchVariableName: TargetBranchName

- pwsh: |
$packageInfoJson = '${{ convertToJson(parameters.PackageInfoLocations) }}'.Trim('"')
$packageInfoLocations = ConvertFrom-Json $packageInfoJson
${{ parameters.ScriptDirectory }}/Update-DocsMsMetadata.ps1 `
-PackageInfoJsonLocations $packageInfoLocations `
-DocRepoLocation "$(DocRepoLocation)" `
-Language '${{parameters.Language}}' `
-RepoId '${{ parameters.RepoId }}'
displayName: Apply Documentation Updates

- template: /eng/common/pipelines/templates/steps/git-push-changes.yml
parameters:
BaseRepoBranch: $(TargetBranchName)
BaseRepoOwner: ${{ parameters.TargetDocRepoOwner }}
CommitMsg: "Update docs metadata"
TargetRepoName: ${{ parameters.TargetDocRepoName }}
TargetRepoOwner: ${{ parameters.TargetDocRepoOwner }}
WorkingDirectory: $(DocRepoLocation)
ScriptDirectory: ${{ parameters.WorkingDirectory }}/${{ parameters.ScriptDirectory }}
7 changes: 5 additions & 2 deletions eng/common/scripts/Invoke-DevOpsAPI.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@ function Start-DevOpsBuild {
$DefinitionId,
[ValidateNotNullOrEmpty()]
[Parameter(Mandatory = $true)]
$Base64EncodedAuthToken
$Base64EncodedAuthToken,
[Parameter(Mandatory = $false)]
[string]$BuildParametersJson
)

$uri = "$DevOpsAPIBaseURI" -F $Organization, $Project , "build" , "builds", ""

$parameters = @{
sourceBranch = $SourceBranch
definition = @{ id = $DefinitionId }
parameters = $BuildParametersJson
}

return Invoke-RestMethod `
Expand Down Expand Up @@ -157,4 +160,4 @@ function Add-RetentionLease {
-MaximumRetryCount 3 `
-ContentType "application/json"

}
}
1 change: 1 addition & 0 deletions eng/common/scripts/Package-Properties.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class PackageProps
{
[string]$Name
[string]$Version
[string]$DevVersion
[string]$DirectoryPath
[string]$ServiceDirectory
[string]$ReadMePath
Expand Down
15 changes: 12 additions & 3 deletions eng/common/scripts/Queue-Pipeline.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ param(
[string]$VsoQueuedPipelines,

[Parameter(Mandatory = $true)]
[string]$Base64EncodedAuthToken
[string]$Base64EncodedAuthToken,

[Parameter(Mandatory = $false)]
[string]$BuildParametersJson
)

. (Join-Path $PSScriptRoot common.ps1)
Expand Down Expand Up @@ -46,7 +49,13 @@ if ($CancelPreviousBuilds)
}

try {
$resp = Start-DevOpsBuild -SourceBranch $SourceBranch -DefinitionId $DefinitionId -Base64EncodedAuthToken $Base64EncodedAuthToken
$resp = Start-DevOpsBuild `
-Organization $Organization `
-Project $Project `
-SourceBranch $SourceBranch `
-DefinitionId $DefinitionId `
-Base64EncodedAuthToken $Base64EncodedAuthToken `
-BuildParametersJson $BuildParametersJson
}
catch {
LogError "Start-DevOpsBuild failed with exception:`n$_"
Expand All @@ -64,4 +73,4 @@ if ($VsoQueuedPipelines) {
}
$QueuedPipelineLinks
Write-Host "##vso[task.setvariable variable=$VsoQueuedPipelines]$QueuedPipelineLinks"
}
}
74 changes: 70 additions & 4 deletions eng/common/scripts/Save-Package-Properties.ps1
Original file line number Diff line number Diff line change
@@ -1,12 +1,79 @@
<#
.SYNOPSIS
Saves package properties from source into JSON files

.DESCRIPTION
Saves package properties in source of a given service directory to JSON files.
JSON files are named in the form <package name>.json or <artifact name>.json if
an artifact name property is available in the package properties.

Can optionally add a dev version property which can be used logic for daily
builds.

.PARAMETER serviceDirectory
Service directory in which to search for packages

.PARAMETER outDirectory
Output location (generally a package artifact directory in DevOps) for JSON
files

.PARAMETER addDevVersion
Reads the version out of the source and adds a DevVersion property to the
package properties JSON file. If the package properties JSON file already
exists, read the Version property from the existing package properties JSON file
and set that as the Version property for the new output. This has the effect of
"adding" a DevVersion property to the file which could be different from the
Verison property in that file.
#>

[CmdletBinding()]
Param (
[Parameter(Mandatory=$True)]
[string] $serviceDirectory,
[Parameter(Mandatory=$True)]
[string] $outDirectory
[string] $outDirectory,
[switch] $addDevVersion
)

. (Join-Path $PSScriptRoot common.ps1)

function SetOutput($outputPath, $incomingPackageSpec) {
$outputObject = $incomingPackageSpec

if ($addDevVersion) {
# Use the "Version" property which was provided by the incoming package spec
# as the DevVersion. This may be overridden later.
$outputObject.DevVersion = $incomingPackageSpec.Version

# If there is an exsiting package info json file read that and set the
# Version property from that JSON file.
if (Test-Path $outputPath) {
$originalObject = ConvertFrom-Json (Get-Content $outputPath -Raw)
$outputObject.Version = $originalObject.Version
}
}

# Set file paths to relative paths
$outputObject.DirectoryPath = GetRelativePath $outputObject.DirectoryPath
$outputObject.ReadMePath = GetRelativePath $outputObject.ReadMePath
$outputObject.ChangeLogPath = GetRelativePath $outputObject.ChangeLogPath

Set-Content `
-Path $outputPath `
-Value (ConvertTo-Json -InputObject $outputObject -Depth 100)
}

function GetRelativePath($path) {
# If the path is empty return an empty string
if (!$path) {
return ''
}
$relativeTo = Resolve-Path $PSScriptRoot/../../../
# Replace "\" with "/" so the path is valid across other platforms and tools
$relativePath = [IO.Path]::GetRelativePath($relativeTo, $path) -replace "\\", '/'
return $relativePath
}

$allPackageProperties = Get-AllPkgProperties $serviceDirectory
if ($allPackageProperties)
{
Expand All @@ -29,9 +96,8 @@ if ($allPackageProperties)
$configFilePrefix = $pkg.ArtifactName
}
$outputPath = Join-Path -Path $outDirectory "$configFilePrefix.json"
$outputObject = $pkg | ConvertTo-Json
Set-Content -Path $outputPath -Value $outputObject
}
SetOutput $outputPath $pkg
}
}

Get-ChildItem -Path $outDirectory
Expand Down
Loading