Skip to content

Commit d58f8e8

Browse files
authored
Fix versions for pack and improve logs (Azure#2307)
* Fix log output in Pack-Crates.ps1 * Fix versions for pack and improve logs * Add switches to Get-PackageDependencies
1 parent b61e0dd commit d58f8e8

File tree

5 files changed

+36
-10
lines changed

5 files changed

+36
-10
lines changed

eng/scripts/Get-PackageDependencies.ps1

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,31 @@
22
#Requires -Version 7.0
33

44
[CmdletBinding()]
5+
param(
6+
[switch]$Publishable,
7+
[switch]$NoDeveloperDependencies,
8+
[switch]$NoVersion
9+
)
510

611
$ErrorActionPreference = 'Stop'
712

813
$packages = & (Join-Path $PSScriptRoot 'Get-PackageVersions.ps1')
914

10-
$packages.packageDependencies | Select-Object -Property @(
15+
if ($Publishable) {
16+
$packages = $packages | Where-Object { $_.publish }
17+
}
18+
19+
$dependencies = $packages | Select-Object -ExpandProperty packageDependencies
20+
21+
if ($NoDev) {
22+
$dependencies = $dependencies | Where-Object { $_.kind -ne 'dev' }
23+
}
24+
25+
if ($NoVersion) {
26+
$dependencies = $dependencies | Where-Object { $_.req -eq '*' }
27+
}
28+
29+
$dependencies | Select-Object -Property @(
1130
@{ Name = 'from'; Expression = { $_.dependant } },
1231
@{ Name = 'to'; Expression = { $_.name } },
1332
'kind',

eng/scripts/Pack-Crates.ps1

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ param(
77
[Parameter(ParameterSetName = 'Named')]
88
[string[]]$PackageNames,
99
[Parameter(ParameterSetName = 'PackageInfo')]
10-
[string]$PackageInfoDirectory
10+
[string]$PackageInfoDirectory,
11+
[switch]$NoVerify
1112
)
1213

1314
$ErrorActionPreference = 'Stop'
@@ -138,7 +139,7 @@ function Add-CrateToLocalRegistry($LocalRegistryPath, $Package) {
138139
# create an index entry for the package
139140
$packagePath = "$RepoRoot/target/package/$packageName-$packageVersion"
140141

141-
Write-Host "Copying package '$packageName' to '$destination'"
142+
Write-Host "Copying package '$packageName' to vendor directory '$LocalRegistryPath'"
142143
Copy-Item -Path $packagePath -Destination $LocalRegistryPath -Recurse
143144

144145
#write an empty checksum file
@@ -187,15 +188,21 @@ try {
187188
$type = if ($package.OutputPackage) { "output" } else { "dependency" }
188189
Write-Host " $packageName ($type)"
189190
}
190-
Write-Host ""
191191

192192
foreach ($package in $packages) {
193+
Write-Host ""
194+
193195
$packageName = $package.name
194196
$packageVersion = $package.version
195197

196-
Invoke-LoggedCommand `
197-
-GroupOutput `
198-
-Command "cargo publish --locked --dry-run --package $packageName --registry crates-io --config `"source.crates-io.replace-with='local'`" --config `"source.local.directory='$localRegistryPath'`" --allow-dirty"
198+
$command = "cargo publish --locked --dry-run --package $packageName --registry crates-io --config `"source.crates-io.replace-with='local'`" --config `"source.local.directory='$localRegistryPath'`" --allow-dirty"
199+
200+
if ($NoVerify) {
201+
$command += " --no-verify"
202+
}
203+
204+
Invoke-LoggedCommand -Command $command -GroupOutput
205+
199206

200207
# copy the package to the local registry
201208
Add-CrateToLocalRegistry `

sdk/core/azure_core_amqp/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ categories = ["api-bindings"]
1818
edition.workspace = true
1919

2020
[dependencies]
21-
azure_core = { path = "../azure_core", default-features = false }
21+
azure_core = { workspace = true, default-features = false }
2222
fe2o3-amqp = { workspace = true, optional = true }
2323
fe2o3-amqp-cbs = { workspace = true, optional = true }
2424
fe2o3-amqp-ext = { workspace = true, optional = true }

sdk/eventhubs/azure_messaging_eventhubs/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ edition.workspace = true
1919

2020
[dependencies]
2121
async-stream.workspace = true
22-
azure_core = { path = "../../core/azure_core", default-features = false }
22+
azure_core = { workspace = true, default-features = false }
2323
azure_core_amqp.workspace = true
2424
futures.workspace = true
2525
time.workspace = true

sdk/template/azure_template/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ repository.workspace = true
99
rust-version.workspace = true
1010

1111
[dependencies]
12-
azure_template_core = { path = "../azure_template_core" }
12+
azure_template_core = { path = "../azure_template_core", version = "0.1.0" }
1313
serde = { version = "1", features = ["derive"] }
1414

1515
[lints]

0 commit comments

Comments
 (0)