diff --git a/.github/workflows/issue_labeler.yaml b/.github/workflows/issue_labeler.yaml deleted file mode 100644 index e585f49b8..000000000 --- a/.github/workflows/issue_labeler.yaml +++ /dev/null @@ -1,21 +0,0 @@ -name: "Issue Labeling" -on: - issues: - types: [opened, edited] - -jobs: - label-issue: - runs-on: ubuntu-latest - steps: - - uses: actions/github-script@v6 - with: - script: | - if (context.payload.issue.title.toLowerCase().includes("mrtk3") || context.payload.issue.body.toLowerCase().includes("mrtk3")) - { - github.rest.issues.addLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels: ['MRTK3'] - }) - } \ No newline at end of file diff --git a/.github/workflows/pr_labeler.yaml b/.github/workflows/pr_labeler.yaml index 4701ee197..4dbb0ea6a 100644 --- a/.github/workflows/pr_labeler.yaml +++ b/.github/workflows/pr_labeler.yaml @@ -14,23 +14,23 @@ jobs: - uses: actions/github-script@v6 with: script: | - if (context.payload.pull_request.base.ref == 'mrtk3') + if (context.payload.pull_request.base.ref == 'feature/XRI3') { github.rest.issues.addLabels({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - labels: ['MRTK3'] + labels: ['Branch: feature/XRI3'] }) } - // When we switch the repo to MRTK3, we'll have to edit this. + // When we switch the repo to XRI3, we'll have to edit this. if (context.payload.pull_request.base.ref == 'main') { github.rest.issues.addLabels({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - labels: ['MRTK2'] + labels: ['Branch: main'] }) - } \ No newline at end of file + } diff --git a/.github/workflows/validation_mrtk3.yaml b/.github/workflows/validation_mrtk3.yaml index 9b7c0ce20..dc88c0a65 100644 --- a/.github/workflows/validation_mrtk3.yaml +++ b/.github/workflows/validation_mrtk3.yaml @@ -1,10 +1,11 @@ -name: Code Validation (MRTK3) +name: Code Validation on: push: - branches: ["mrtk3"] + branches: + - main + - 'feature/*' pull_request: - branches: ["mrtk3"] jobs: validation: diff --git a/Pipelines/Scripts/pack-upm.ps1 b/Pipelines/Scripts/pack-upm.ps1 index 890d68e0d..51c2b581f 100644 --- a/Pipelines/Scripts/pack-upm.ps1 +++ b/Pipelines/Scripts/pack-upm.ps1 @@ -13,10 +13,9 @@ .PARAMETER PrereleaseTag The tag to append after the version (e.g. "build", "internal" or "prerelease"). Leave blank for a release build. .PARAMETER Revision - The revision number for the build, to append after the release labal and suffix. + The revision number for the build, to append after the release label and suffix. .PARAMETER BuildNumber The fourth digit for the full version number for assembly versioning. This is the build number. - #> param( [Parameter(Mandatory = $true)] @@ -39,16 +38,16 @@ if (-not (Test-Path $OutputDirectory -PathType Container)) { $OutputDirectory = Resolve-Path -Path $OutputDirectory Write-Host "" -Write-Host -ForegroundColor Blue "=======================================" +Write-Host -ForegroundColor Blue "=======================================" Write-Host -ForegroundColor Blue "Packing All Packages" -Write-Host -ForegroundColor Blue "=======================================" +Write-Host -ForegroundColor Blue "=======================================" Write-Host "OutputDirectory: $OutputDirectory" try { Push-Location $OutputDirectory # Update package versions - . $PSScriptRoot\update-versions.ps1 -PackagesRoot $ProjectRoot -PrereleaseTag $PrereleaseTag -Revision $Revision -BuildNumber $BuildNumber + . $PSScriptRoot\update-versions.ps1 -PackagesRoot $ProjectRoot -PrereleaseTag $PrereleaseTag -Revision $Revision -BuildNumber $BuildNumber # Loop through package directories and copy documentation Get-ChildItem -Path $ProjectRoot/*/package.json | ForEach-Object { @@ -63,9 +62,9 @@ try { $docFolder = "$packagePath/Documentation~" Write-Host "" - Write-Host -ForegroundColor Green "=======================================" + Write-Host -ForegroundColor Green "=======================================" Write-Host -ForegroundColor Green "Copying Documentation~" - Write-Host -ForegroundColor Green "=======================================" + Write-Host -ForegroundColor Green "=======================================" Write-Host "Package name: $packageName" if (Test-Path -Path $docFolder) { @@ -73,22 +72,22 @@ try { } else { Copy-Item -Path "$ProjectRoot/Pipelines/UPM/Documentation~" -Destination $docFolder -Recurse - } + } } # Package the package directories Get-ChildItem -Path $ProjectRoot/*/package.json | ForEach-Object { $currentPackageName = Select-String -Pattern "org\.mixedrealitytoolkit\.\w+(\.\w+)*" -Path $_ | Select-Object -First 1 - + if (-not $currentPackageName) { return # this is not an MRTK package, so skip } Write-Host "" - Write-Host -ForegroundColor Green "=======================================" + Write-Host -ForegroundColor Green "=======================================" Write-Host -ForegroundColor Green "Packing Package" Write-Host -ForegroundColor Green "=======================================" - Write-Host "Package name: $currentPackageName" + Write-Host "Package name: $currentPackageName" $currentPackageName = $currentPackageName.Matches[0].Value $packageFriendlyName = (Select-String -Pattern "`"displayName`": `"(.+)`"" -Path $_ | Select-Object -First 1).Matches.Groups[1].Value @@ -102,7 +101,7 @@ try { # clean up if (Test-Path -Path $docFolder) { Write-Host "Cleaning up Documentation~ from $packageFriendlyName" - # A documentation folder was created. Remove it. + # A documentation folder was created. Remove it. Remove-Item -Path $docFolder -Recurse -Force # But restore anything that's checked-in. @@ -118,8 +117,8 @@ try { } Write-Host "" - Write-Host -ForegroundColor Blue "=======================================" - Write-Host -ForegroundColor Blue "Successfully Packed All Pacakges" + Write-Host -ForegroundColor Blue "=======================================" + Write-Host -ForegroundColor Blue "Successfully Packed All Packages" Write-Host -ForegroundColor Blue "=======================================" Write-Host "" } diff --git a/Pipelines/Scripts/update-versions.ps1 b/Pipelines/Scripts/update-versions.ps1 index 904ecf16e..8982b3c3a 100644 --- a/Pipelines/Scripts/update-versions.ps1 +++ b/Pipelines/Scripts/update-versions.ps1 @@ -5,7 +5,7 @@ .SYNOPSIS Updates the version of the UPM packages in the project with a release label, revision, and build number. .DESCRIPTION - The script will update the version of the package.json file with the new version label and revision number. This + The script will update the version of the package.json file with the new version label and revision number. This script will also update the AssemblyInfo.cs file with the new version number and build number. Finally, this script will update the CHANGELOG.md file with the new version number and release date. .PARAMETER PackagesRoot @@ -13,7 +13,7 @@ .PARAMETER PrereleaseTag The tag to append after the version (e.g. "build", "internal" or "prerelease"). Leave blank for a release build. .PARAMETER Revision - The revision number for the build, to append after the release labal. + The revision number for the build, to append after the release label. .PARAMETER BuildNumber The fourth digit for the full version number for assembly versioning. This is the build number. #> @@ -44,7 +44,7 @@ if (-not [string]::IsNullOrEmpty($Revision)) { } Write-Host "" -Write-Host -ForegroundColor Green "=======================================" +Write-Host -ForegroundColor Green "=======================================" Write-Host -ForegroundColor Green "Updating All Package Versions" Write-Host -ForegroundColor Green "=======================================" Write-Output "Project root: $PackagesRoot" @@ -63,7 +63,7 @@ Get-ChildItem -Path $PackagesRoot -Filter "package.json" -Recurse | ForEach-Obje # Test is package name starts with org.mixedrealitytoolkit to verify it's an MRTK package if ($packageName -notmatch "^org\.mixedrealitytoolkit\.\w+(\.\w+)*") { - return + return } # Read the version value @@ -73,9 +73,9 @@ Get-ChildItem -Path $PackagesRoot -Filter "package.json" -Recurse | ForEach-Obje $packagePath = $_.Directory Write-Host "" - Write-Host -ForegroundColor Green "=======================================" + Write-Host -ForegroundColor Green "=======================================" Write-Host -ForegroundColor Green "Updating Package Version" - Write-Host -ForegroundColor Green "=======================================" + Write-Host -ForegroundColor Green "=======================================" Write-Output "Package name: $packageName" # This regex will match the a valid version is the package.json file. Some examples of valid versions are: @@ -83,14 +83,14 @@ Get-ChildItem -Path $PackagesRoot -Filter "package.json" -Recurse | ForEach-Obje # 1.0.0 # 1.0.0-pre.1 # 1.0.0-development.pre.1 - # 1.0.0-development + # 1.0.0-development # - # In these example "development" is the prerelease tag and "pre.1" is the meta tag. + # In these example "development" is the prerelease tag and "pre.1" is the meta tag. $validVersion = $version -match '(?[0-9.]+)(-((?[a-zA-Z0-9]*)?(?=(|\.[a-zA-Z]*\.[0-9]*)(\.[0-9]{6}\.[0-9]|$))|)((?(?<=-)|\.)(?[a-zA-Z][a-zA-Z0-9]*)\.(?[1-9][0-9]*))?)?' if (-not $validVersion) { throw "Failed to parse version out of the package.json file at $($_.FullName)" } - + # Get the version parts from the $Matches variable, and verify that the version key exists. $versionParts = $Matches if (-not $versionParts.ContainsKey('version')) { @@ -102,14 +102,14 @@ Get-ChildItem -Path $PackagesRoot -Filter "package.json" -Recurse | ForEach-Obje # Get all tag parts to append to the version $tagParts = @() - + # Add the new version label if it's not empty if (-not [string]::IsNullOrEmpty($PrereleaseTag)) { $tagParts += $PrereleaseTag } # Add the optional metatag tag and version if found in match - if ($versionParts.ContainsKey('metaTag') -and $versionParts.ContainsKey('metaTagVersion')) { + if ($versionParts.ContainsKey('metaTag') -and $versionParts.ContainsKey('metaTagVersion')) { $tagParts += $versionParts['metaTag'] $tagParts += $versionParts['metaTagVersion'] } @@ -125,7 +125,7 @@ Get-ChildItem -Path $PackagesRoot -Filter "package.json" -Recurse | ForEach-Obje $tag = "-" + $tag } - # Update the version with the new tag + # Update the version with the new tag $jsonContent.version = "$version$tag" # Write json content back to the file @@ -153,18 +153,18 @@ Get-ChildItem -Path $PackagesRoot -Filter "package.json" -Recurse | ForEach-Obje $assemblyInfo += "[assembly: AssemblyInformationalVersion(`"$version$tag`")]`r`n" } - Set-Content -Path $_ -Value $assemblyInfo -NoNewline + Set-Content -Path $_ -Value $assemblyInfo -NoNewline } # Update the CHANGELOG.md file with the new version and release date Write-Output "Patching CHANGELOG.md version to [$version$tag] - $year-$month-$day" - Get-ChildItem -Path $packagePath/CHANGELOG.md -Recurse | ForEach-Object { + Get-ChildItem -Path $packagePath/CHANGELOG.md -Recurse | ForEach-Object { (Get-Content -Path $_ -Raw) -Replace "## \[$version(-[a-zA-Z0-9.]+)?\] - \b\d{4}\b-\b(0[1-9]|1[0-2])\b-\b(0[1-9]|[12][0-9]|3[01])\b", "## [$version$tag] - $year-$month-$day" | Set-Content -Path $_ -NoNewline } } Write-Host "" -Write-Host -ForegroundColor Green "=======================================" +Write-Host -ForegroundColor Green "=======================================" Write-Host -ForegroundColor Green "Successfully Updated Package Versions" Write-Host -ForegroundColor Green "=======================================" Write-Host "" \ No newline at end of file diff --git a/Pipelines/Scripts/validatecode.ps1 b/Pipelines/Scripts/validatecode.ps1 index 85b21b77e..1705279a9 100644 --- a/Pipelines/Scripts/validatecode.ps1 +++ b/Pipelines/Scripts/validatecode.ps1 @@ -221,8 +221,7 @@ function IsNamespace { [string]$Line ) process { - if (($Line -match "^namespace\sMicrosoft\.MixedReality\.Toolkit") -or - ($Line -match "^namespace\sMicrosoft\.Windows\.MixedReality")) { + if ($Line -match "^namespace\sMixedReality\.Toolkit") { $true; } $false; @@ -247,7 +246,8 @@ function GetProjectRelativePath { $normalizedFileName = $FileName.Replace("\", "/") if ($Directory.EndsWith("/")) { $substringLength = $Directory.Length - } else { + } + else { $substringLength = $Directory.Length + 1 } $assetFileName = $normalizedFileName.SubString($substringLength) diff --git a/org.mixedrealitytoolkit.input/InteractionModes/ProximityEnteredEventArgs.cs b/org.mixedrealitytoolkit.input/InteractionModes/ProximityEnteredEventArgs.cs index 9067dc45e..1af15c03c 100644 --- a/org.mixedrealitytoolkit.input/InteractionModes/ProximityEnteredEventArgs.cs +++ b/org.mixedrealitytoolkit.input/InteractionModes/ProximityEnteredEventArgs.cs @@ -1,8 +1,6 @@ // Copyright (c) Mixed Reality Toolkit Contributors // Licensed under the BSD 3-Clause -using UnityEngine; - namespace MixedReality.Toolkit.Input { public class ProximityEnteredEventArgs : BaseProximityEventArgs @@ -13,7 +11,7 @@ public class ProximityEnteredEventArgs : BaseProximityEventArgs /// NearInteractionModeDetector that triggers proximity entered event. public ProximityEnteredEventArgs(NearInteractionModeDetector nearInteractionModeDetector) : base(nearInteractionModeDetector) { - //Empty on purpose + // Empty on purpose } } } diff --git a/org.mixedrealitytoolkit.input/InteractionModes/ProximityExitedEventArgs.cs b/org.mixedrealitytoolkit.input/InteractionModes/ProximityExitedEventArgs.cs index 0c5202bd3..75be94113 100644 --- a/org.mixedrealitytoolkit.input/InteractionModes/ProximityExitedEventArgs.cs +++ b/org.mixedrealitytoolkit.input/InteractionModes/ProximityExitedEventArgs.cs @@ -1,8 +1,6 @@ // Copyright (c) Mixed Reality Toolkit Contributors // Licensed under the BSD 3-Clause -using UnityEngine; - namespace MixedReality.Toolkit.Input { public class ProximityExitedEventArgs : BaseProximityEventArgs @@ -13,7 +11,7 @@ public class ProximityExitedEventArgs : BaseProximityEventArgs /// NearInteractionModeDetector that triggers proximity exited event. public ProximityExitedEventArgs(NearInteractionModeDetector nearInteractionModeDetector) : base(nearInteractionModeDetector) { - //Empty on purpose + // Empty on purpose } } } diff --git a/org.mixedrealitytoolkit.uxcomponents.noncanvas/Tests/Runtime/PressableButtonTests.cs b/org.mixedrealitytoolkit.uxcomponents.noncanvas/Tests/Runtime/PressableButtonTests.cs index 48473a493..a45cb3a59 100644 --- a/org.mixedrealitytoolkit.uxcomponents.noncanvas/Tests/Runtime/PressableButtonTests.cs +++ b/org.mixedrealitytoolkit.uxcomponents.noncanvas/Tests/Runtime/PressableButtonTests.cs @@ -924,7 +924,7 @@ public IEnumerator TestSimpleEmptyButtonHasSeeItSayItLabelComponentAndReferenced yield return null; SeeItSayItLabelEnabler[] seeItSayitLabelEnablerComponents = testSimpleEmptyButton.GetComponents(); - Assert.AreEqual(1, seeItSayitLabelEnablerComponents.Length); //Check it has the component + Assert.AreEqual(1, seeItSayitLabelEnablerComponents.Length); // Check it has the component GameObject seeItSayItLabelGameObject = null; foreach (Transform child in testSimpleEmptyButton.transform) @@ -934,7 +934,7 @@ public IEnumerator TestSimpleEmptyButtonHasSeeItSayItLabelComponentAndReferenced seeItSayItLabelGameObject = child.gameObject; } } - Assert.IsNotNull(seeItSayItLabelGameObject); //Check the referenced GameObject is not null + Assert.IsNotNull(seeItSayItLabelGameObject); // Check the referenced GameObject is not null Object.Destroy(testSimpleEmptyButton); // Wait for a frame to give Unity a change to actually destroy the object @@ -957,7 +957,7 @@ public IEnumerator TestSimpleActionButtonHasSeeItSayItLabelComponentAndReference yield return null; SeeItSayItLabelEnabler[] seeItSayitLabelEnablerComponents = testSimpleActionButton.GetComponents(); - Assert.AreEqual(1, seeItSayitLabelEnablerComponents.Length); //Check it has the component + Assert.AreEqual(1, seeItSayitLabelEnablerComponents.Length); // Check it has the component GameObject seeItSayItLabelGameObject = null; foreach (Transform child in testSimpleActionButton.transform) @@ -967,7 +967,7 @@ public IEnumerator TestSimpleActionButtonHasSeeItSayItLabelComponentAndReference seeItSayItLabelGameObject = child.gameObject; } } - Assert.IsNotNull(seeItSayItLabelGameObject); //Check the referenced GameObject is not null + Assert.IsNotNull(seeItSayItLabelGameObject); // Check the referenced GameObject is not null Object.Destroy(testSimpleActionButton); // Wait for a frame to give Unity a change to actually destroy the object