@@ -146,34 +146,14 @@ function Add-CrateToLocalRegistry($LocalRegistryPath, $Package) {
146
146
' {"files":{}}' | Out-File - FilePath " $LocalRegistryPath /$packageName -$packageVersion /.cargo-checksum.json" - Encoding utf8
147
147
}
148
148
149
- # For all dependencies with paths, but no versions, add the version from the path
150
- function Add-PathVersions ($packages ) {
151
- # Install PSToml if it's not already installed
152
- if (-not (PowerShellGet\Get-InstalledModule - Name PSToml - ErrorAction SilentlyContinue)) {
153
- PowerShellGet\Install-Module - Name PSToml - Scope CurrentUser - Force
154
- }
149
+ function Create-ApiViewFile ($package ) {
150
+ $packageName = $package.name
151
+ $command = " cargo run --manifest-path $RepoRoot /eng/tools/generate_api_report/Cargo.toml -- --package $packageName "
152
+ Invoke-LoggedCommand $command - GroupOutput | Out-Host
155
153
156
- foreach ($package in $packages ) {
157
- $dirty = $false
158
- $toml = Get-Content - Path $Package.manifest_path - Raw | ConvertFrom-Toml
159
-
160
- foreach ($name in $toml.dependencies.Keys ) {
161
- # we want to look at the dependency as it was resolved by `cargo metadata`
162
- # this will resolve workspace depdencies, but retain their path/no-version state
163
- $dependency = $package.dependencies | Where-Object - Property name -EQ - Value $name | Select-Object - First 1
164
- # If the dependency is a path dependency, set the version to the version of the package in the workspace
165
- if ($dependency.path -and ! $dependency.version ) {
166
- $tomlDependency = $toml.dependencies .$name
167
- $dependencyVersion = $packages | Where-Object - Property name -EQ - Value $name | Select-Object - ExpandProperty version - First 1
168
-
169
- $tomlDependency.version = $dependencyVersion
170
- $dirty = $true
171
- }
172
- }
173
- if ($dirty ) {
174
- $toml | ConvertTo-Toml - Depth 10 | Set-Content - Path $Package.manifest_path - Encoding utf8
175
- }
176
- }
154
+ $packagePath = Split-Path - Path $package.manifest_path - Parent
155
+
156
+ " $packagePath /review/$packageName .rust.json"
177
157
}
178
158
179
159
Push-Location $RepoRoot
@@ -189,15 +169,6 @@ try {
189
169
Write-Host " $packageName ($type )"
190
170
}
191
171
192
- function Create-ApiViewFile ($package ) {
193
- $command = " cargo run --manifest-path $RepoRoot /eng/tools/generate_api_report/Cargo.toml -- --package $ ( $package.name ) "
194
- Invoke-LoggedCommand $command - GroupOutput | Out-Host
195
-
196
- $packagePath = Split-Path - Path $package.manifest_path - Parent
197
-
198
- " $packagePath /review/$ ( $package.name ) _rust.json"
199
- }
200
-
201
172
foreach ($package in $packages ) {
202
173
Write-Host " "
203
174
@@ -222,7 +193,7 @@ try {
222
193
$sourcePath = " $RepoRoot /target/package/$packageName -$packageVersion "
223
194
$targetPath = " $OutputPath /$packageName "
224
195
$targetContentsPath = " $targetPath /contents"
225
- $targetApiReviewFile = " $targetPath /$packageName `_rust .json"
196
+ $targetApiReviewFile = " $targetPath /$packageName .rust .json"
226
197
227
198
if (Test-Path - Path $targetContentsPath ) {
228
199
Remove-Item - Path $targetContentsPath - Recurse - Force
0 commit comments