Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 0 additions & 21 deletions .github/workflows/issue_labeler.yaml

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/pr_labeler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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']
})
}
}
7 changes: 4 additions & 3 deletions .github/workflows/validation_mrtk3.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Code Validation (MRTK3)
name: Code Validation

on:
push:
branches: ["mrtk3"]
branches:
- main
- 'feature/*'
pull_request:
branches: ["mrtk3"]

jobs:
validation:
Expand Down
27 changes: 13 additions & 14 deletions Pipelines/Scripts/pack-upm.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -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 {
Expand All @@ -63,32 +62,32 @@ 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) {
Copy-Item -Path "$ProjectRoot/Pipelines/UPM/Documentation~/*" -Destination $docFolder -Recurse
}
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
Expand All @@ -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.
Expand All @@ -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 ""
}
Expand Down
30 changes: 15 additions & 15 deletions Pipelines/Scripts/update-versions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
.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
The root folder containing the packages.
.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.
#>
Expand Down Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -73,24 +73,24 @@ 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:
#
# 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 '(?<version>[0-9.]+)(-((?<prereleaseTag>[a-zA-Z0-9]*)?(?=(|\.[a-zA-Z]*\.[0-9]*)(\.[0-9]{6}\.[0-9]|$))|)((?(?<=-)|\.)(?<metaTag>[a-zA-Z][a-zA-Z0-9]*)\.(?<metaTagVersion>[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')) {
Expand All @@ -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']
}
Expand All @@ -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
Expand Down Expand Up @@ -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 ""
6 changes: 3 additions & 3 deletions Pipelines/Scripts/validatecode.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -13,7 +11,7 @@ public class ProximityEnteredEventArgs : BaseProximityEventArgs
/// <param name="nearInteractionModeDetector">NearInteractionModeDetector that triggers proximity entered event.</param>
public ProximityEnteredEventArgs(NearInteractionModeDetector nearInteractionModeDetector) : base(nearInteractionModeDetector)
{
//Empty on purpose
// Empty on purpose
}
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -13,7 +11,7 @@ public class ProximityExitedEventArgs : BaseProximityEventArgs
/// <param name="nearInteractionModeDetector">NearInteractionModeDetector that triggers proximity exited event.</param>
public ProximityExitedEventArgs(NearInteractionModeDetector nearInteractionModeDetector) : base(nearInteractionModeDetector)
{
//Empty on purpose
// Empty on purpose
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ public IEnumerator TestSimpleEmptyButtonHasSeeItSayItLabelComponentAndReferenced
yield return null;

SeeItSayItLabelEnabler[] seeItSayitLabelEnablerComponents = testSimpleEmptyButton.GetComponents<SeeItSayItLabelEnabler>();
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)
Expand All @@ -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
Expand All @@ -957,7 +957,7 @@ public IEnumerator TestSimpleActionButtonHasSeeItSayItLabelComponentAndReference
yield return null;

SeeItSayItLabelEnabler[] seeItSayitLabelEnablerComponents = testSimpleActionButton.GetComponents<SeeItSayItLabelEnabler>();
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)
Expand All @@ -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
Expand Down