Skip to content

Commit 5628c11

Browse files
authored
Fix package regex to handle 4 component package names (#37)
We have one package (org.mixedrealitytoolkit.uxcomponents.noncanvas) that was screwing up the version dependency hash lookup. This resolves it so the package.json gets patched with the correct dependency.
2 parents a194901 + 14c6784 commit 5628c11

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Pipelines/Scripts/pack-upm.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ try {
6666

6767
# loop through package directories, update package version, assembly version, and build version hash for updating dependencies
6868
Get-ChildItem -Path $ProjectRoot/*/package.json | ForEach-Object {
69-
$packageName = Select-String -Pattern "org\.mixedrealitytoolkit\.\w+|com\.microsoft\.mrtk\.\w+" -Path $_ | Select-Object -First 1
69+
$packageName = Select-String -Pattern "org\.mixedrealitytoolkit\.\w+(\.\w+)*|com\.microsoft\.mrtk\.\w+(\.\w+)*" -Path $_ | Select-Object -First 1
7070

7171
if (-not $packageName) {
7272
return # this is not an MRTK package, so skip
@@ -130,7 +130,8 @@ try {
130130

131131
# update dependencies using the versionHash map
132132
Get-ChildItem -Path $ProjectRoot/*/package.json | ForEach-Object {
133-
$currentPackageName = Select-String -Pattern "org\.mixedrealitytoolkit\.\w+|com\.microsoft\.mrtk\.\w+" -Path $_ | Select-Object -First 1
133+
$currentPackageName = Select-String -Pattern "org\.mixedrealitytoolkit\.\w+(\.\w+)*|com\.microsoft\.mrtk\.\w+(\.\w+)*" -Path $_ | Select-Object -First 1
134+
134135
if (-not $currentPackageName) {
135136
return # this is not an MRTK package, so skip
136137
}
@@ -150,7 +151,7 @@ try {
150151
continue
151152
}
152153

153-
$searchRegex = "$($packageName).*:.*""(.*)"""
154+
$searchRegex = "$($packageName)\s*"":\s*""(.*)"""
154155
$searchMatches = Select-String $searchRegex -InputObject (Get-Content -Path $_)
155156
if ($searchMatches.Matches.Groups) {
156157
$newVersion = $versionHash["$($packageName)"]

Pipelines/Scripts/repackage-for-release.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ try {
4646
Write-Output "PackageSearchPath: $packageSearchPath"
4747

4848
Get-ChildItem -Path $packageSearchPath | ForEach-Object {
49-
$packageName = Select-String -Pattern "org\.mixedrealitytoolkit\.\w+|com\.microsoft\.mrtk\.\w+" -Path $_.FullName | Select-Object -First 1
49+
$packageName = Select-String -Pattern "org\.mixedrealitytoolkit\.\w+(\.\w+)*|com\.microsoft\.mrtk\.\w+(\.\w+)*" -Path $_.FullName | Select-Object -First 1
5050

5151
if (-not $packageName) {
5252
return # this is not an MRTK package, so skip
@@ -91,7 +91,7 @@ try {
9191
}
9292
# update all dependencies and repackage
9393
Get-ChildItem -Path $packageSearchPath | ForEach-Object {
94-
$currentPackageName = Select-String -Pattern "org\.mixedrealitytoolkit\.\w+|com\.microsoft\.mrtk\.\w+" -Path $_.FullName | Select-Object -First 1
94+
$currentPackageName = Select-String -Pattern "org\.mixedrealitytoolkit\.\w+(\.\w+)*|com\.microsoft\.mrtk\.\w+(\.\w+)*" -Path $_.FullName | Select-Object -First 1
9595

9696
if (-not $currentPackageName) {
9797
return # this is not an MRTK package, so skip

0 commit comments

Comments
 (0)