Skip to content

Commit cbdc7f0

Browse files
build and validate all platforms
1 parent 05f52d9 commit cbdc7f0

File tree

7 files changed

+65
-27
lines changed

7 files changed

+65
-27
lines changed

.github/workflows/validate.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ jobs:
3030
unity-version: [2021.x, 2022.x, 6000.x]
3131
xcode-version: ['16.2']
3232
build-target:
33-
# - iOS
34-
# - StandaloneOSX
33+
- iOS
34+
- StandaloneOSX
3535
- VisionOS
3636
exclude:
3737
- os: macos-latest

dist/index.js

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15838,6 +15838,9 @@ function _insertBefore(parent, node, child, _inDocumentAssertion) {
1583815838
}
1583915839
do{
1584015840
newFirst.parentNode = parent;
15841+
// Update ownerDocument for each node being inserted
15842+
var targetDoc = parent.ownerDocument || parent;
15843+
_updateOwnerDocument(newFirst, targetDoc);
1584115844
}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))
1584215845
_onUpdateChild(parent.ownerDocument||parent, parent);
1584315846
//console.log(parent.lastChild.nextSibling == null)
@@ -15847,6 +15850,37 @@ function _insertBefore(parent, node, child, _inDocumentAssertion) {
1584715850
return node;
1584815851
}
1584915852

15853+
/**
15854+
* Recursively updates the ownerDocument property for a node and all its descendants
15855+
* @param {Node} node
15856+
* @param {Document} newOwnerDocument
15857+
* @private
15858+
*/
15859+
function _updateOwnerDocument(node, newOwnerDocument) {
15860+
if (node.ownerDocument === newOwnerDocument) {
15861+
return;
15862+
}
15863+
15864+
node.ownerDocument = newOwnerDocument;
15865+
15866+
// Update attributes if this is an element
15867+
if (node.nodeType === ELEMENT_NODE && node.attributes) {
15868+
for (var i = 0; i < node.attributes.length; i++) {
15869+
var attr = node.attributes.item(i);
15870+
if (attr) {
15871+
attr.ownerDocument = newOwnerDocument;
15872+
}
15873+
}
15874+
}
15875+
15876+
// Recursively update child nodes
15877+
var child = node.firstChild;
15878+
while (child) {
15879+
_updateOwnerDocument(child, newOwnerDocument);
15880+
child = child.nextSibling;
15881+
}
15882+
}
15883+
1585015884
/**
1585115885
* Appends `newChild` to `parentNode`.
1585215886
* If `newChild` is already connected to a `parentNode` it is first removed from it.
@@ -15872,6 +15906,11 @@ function _appendSingleChild (parentNode, newChild) {
1587215906
}
1587315907
parentNode.lastChild = newChild;
1587415908
_onUpdateChild(parentNode.ownerDocument, parentNode, newChild);
15909+
15910+
// Update ownerDocument for the new child and all its descendants
15911+
var targetDoc = parentNode.ownerDocument || parentNode;
15912+
_updateOwnerDocument(newChild, targetDoc);
15913+
1587515914
return newChild;
1587615915
}
1587715916

@@ -15900,7 +15939,7 @@ Document.prototype = {
1590015939
return newChild;
1590115940
}
1590215941
_insertBefore(this, newChild, refChild);
15903-
newChild.ownerDocument = this;
15942+
_updateOwnerDocument(newChild, this);
1590415943
if (this.documentElement === null && newChild.nodeType === ELEMENT_NODE) {
1590515944
this.documentElement = newChild;
1590615945
}
@@ -15916,7 +15955,7 @@ Document.prototype = {
1591615955
replaceChild: function (newChild, oldChild) {
1591715956
//raises
1591815957
_insertBefore(this, newChild, oldChild, assertPreReplacementValidityInDocument);
15919-
newChild.ownerDocument = this;
15958+
_updateOwnerDocument(newChild, this);
1592015959
if (oldChild) {
1592115960
this.removeChild(oldChild);
1592215961
}
@@ -58449,7 +58488,7 @@ async function GetProjectDetails(credential, xcodeVersion) {
5844958488
core.debug(`Files found during search: ${files.join(', ')}`);
5845058489
const excludedProjects = ['GameAssembly', 'UnityFramework', 'Pods'];
5845158490
for (const file of files) {
58452-
if (file.endsWith('.xcodeproj')) {
58491+
if (file.endsWith('.xcodeproj') && !file.includes('DerivedData')) {
5845358492
const projectBaseName = path.basename(file, '.xcodeproj');
5845458493
if (excludedProjects.includes(projectBaseName)) {
5845558494
continue;
@@ -61570,14 +61609,11 @@ const main = async () => {
6157061609
const match = line.match(/(\d+\.\d+(\s\w+)?)/);
6157161610
return match ? match[1] : null;
6157261611
}).filter(Boolean);
61573-
core.debug(`Installed Xcode versions:\n ${installedXcodeVersions.join('\n')}`);
61612+
core.info(`Installed Xcode versions:`);
61613+
installedXcodeVersions.forEach(version => core.info(` > ${version}`));
6157461614
if (installedXcodeVersions.length === 0 || !xcodeVersionString.includes('latest')) {
6157561615
if (installedXcodeVersions.length === 0 || !installedXcodeVersions.includes(xcodeVersionString)) {
61576-
core.info(`Downloading missing Xcode version ${xcodeVersionString}...`);
61577-
const installExitCode = await exec.exec('xcodes', ['install', xcodeVersionString, '--select']);
61578-
if (installExitCode !== 0) {
61579-
throw new Error(`Failed to install Xcode version ${xcodeVersionString}!`);
61580-
}
61616+
throw new Error(`Xcode version ${xcodeVersionString} is not installed! You will need to install this is a step before this one.`);
6158161617
}
6158261618
else {
6158361619
core.info(`Selecting installed Xcode version ${xcodeVersionString}...`);

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"uuid": "^10.0.0"
2626
},
2727
"devDependencies": {
28-
"@types/node": "^22.17.1",
28+
"@types/node": "^22.18.0",
2929
"@types/plist": "^3.0.5",
3030
"@types/semver": "^7.7.0",
3131
"@types/uuid": "^10.0.0",

src/index.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,29 +25,30 @@ const main = async () => {
2525
if (xcodeVersionString) {
2626
core.info(`Setting xcode version to ${xcodeVersionString}`);
2727
let xcodeVersionOutput = '';
28+
2829
const installedExitCode = await exec.exec('xcodes', ['installed'], {
2930
listeners: {
3031
stdout: (data: Buffer) => {
3132
xcodeVersionOutput += data.toString();
3233
}
3334
}
3435
});
36+
3537
if (installedExitCode !== 0) {
3638
throw new Error('Failed to get installed Xcode versions!');
3739
}
40+
3841
const installedXcodeVersions = xcodeVersionOutput.split('\n').map(line => {
3942
const match = line.match(/(\d+\.\d+(\s\w+)?)/);
4043
return match ? match[1] : null;
4144
}).filter(Boolean) as string[];
42-
core.debug(`Installed Xcode versions:\n ${installedXcodeVersions.join('\n')}`);
45+
46+
core.info(`Installed Xcode versions:`);
47+
installedXcodeVersions.forEach(version => core.info(` > ${version}`));
48+
4349
if (installedXcodeVersions.length === 0 || !xcodeVersionString.includes('latest')) {
4450
if (installedXcodeVersions.length === 0 || !installedXcodeVersions.includes(xcodeVersionString)) {
45-
core.info(`Downloading missing Xcode version ${xcodeVersionString}...`);
46-
const installExitCode = await exec.exec('xcodes', ['install', xcodeVersionString, '--select']);
47-
48-
if (installExitCode !== 0) {
49-
throw new Error(`Failed to install Xcode version ${xcodeVersionString}!`);
50-
}
51+
throw new Error(`Xcode version ${xcodeVersionString} is not installed! You will need to install this is a step before this one.`);
5152
} else {
5253
core.info(`Selecting installed Xcode version ${xcodeVersionString}...`);
5354
const selectExitCode = await exec.exec('xcodes', ['select', xcodeVersionString]);

src/xcode.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ export async function GetProjectDetails(credential: AppleCredential, xcodeVersio
7575
if (!platform) {
7676
throw new Error('Unable to determine the platform to build for.');
7777
}
78+
7879
if (platform !== 'macOS') {
7980
await checkSimulatorsAvailable(platform);
8081
}

0 commit comments

Comments
 (0)