Skip to content

Commit afd2104

Browse files
authored
Merge pull request #7198 from davidkline-ms/providerPacakgeFix
Fix foundation unitypackage packaging: do not presume ar or xr plugins
2 parents 54fb3ec + e56b609 commit afd2104

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

scripts/packaging/unitypackage.ps1

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,24 @@ function GetPackageVersion() {
105105
Select-Object -First 1
106106
}
107107

108+
function CleanPackageManifest() {
109+
<#
110+
.SYNOPSIS
111+
Ensures that the package manifest does not contain packages that trigger adding dependencies on
112+
optional features by default.
113+
#>
114+
115+
$fileName = $RepoDirectory + "\Packages\manifest.json"
116+
(Get-Content $fileName) | ForEach-Object {
117+
if ($_ -notmatch ("arfoundation|arsubsystems|xr.management|legacyinputhelpers")) {
118+
$line = $_
119+
}
120+
else {
121+
$line = ""
122+
}
123+
$line } | Set-Content $fileName
124+
}
125+
108126
# Beginning of the .unitypackage script main section
109127
# The overall structure of this script looks like:
110128
#
@@ -157,6 +175,9 @@ $OutputDirectory = Resolve-Path $OutputDirectory
157175
$LogDirectory = Resolve-Path $LogDirectory
158176
$RepoDirectory = Resolve-Path $RepoDirectory
159177

178+
Write-Verbose "Cleaning package manifest (removing AR and XR references)"
179+
CleanPackageManifest
180+
160181
foreach ($entry in $packages.GetEnumerator()) {
161182
$packageName = $entry.Name;
162183
$folders = $entry.Value

0 commit comments

Comments
 (0)