Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-25226] iOS: Use the new Xcode build-system by default on Xcode 10, make configurable on older #10181

Merged
merged 13 commits into from Jul 20, 2018

Conversation

hansemannn
Copy link
Collaborator

@hansemannn hansemannn commented Jul 16, 2018

JIRA: https://jira.appcelerator.org/browse/TIMOB-25226

@hansemannn
Copy link
Collaborator Author

@sgtcoolguy Looks like Jenkins is not happy with Xcode 10, yet.

@sgtcoolguy
Copy link
Contributor

@hansemannn You'll need to do an:
npm install node-titanium-sdk@^0.6.0

to grab the node-titanium-sdk with support for this flag.

@hansemannn
Copy link
Collaborator Author

I don't think it's published to npm, yet:

No matching version found for node-titanium-sdk@^0.6.0.

];

if (!this.useNewBuildSystem) {
args.push('-UseNewBuildSystem=NO');
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it hurt to be explicit and say:

args.push(`-UseNewBuildSystem=${this.useNewBuildSystem ? 'YES' : 'NO'}`);

// if running on Xcode < 10, do not use the new build system by default
this.useNewBuildSystem = false;
} else if (this.tiapp.ios.hasOwnProperty('use-new-build-system')) {
// if explicitely set via tiapp.xml, go with that one
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: explicitely -> explicitly.

this.useNewBuildSystem = this.tiapp.ios['use-new-build-system'];
} else {
// if not set and Xcode >= 10, use the new build system
this.useNewBuildSystem = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is just fine, but I would have removed the extra "if" like this:

if (this.tiapp.ios.hasOwnProperty('use-new-build-system')) {
    this.useNewBuildSystem = this.tiapp.ios['use-new-build-system'];
} else {
    // use the new build system if Xcode >= 10
    this.useNewBuildSystem = appc.version.gte(this.xcodeEnv.version, '10.0.0');
}

@sgtcoolguy
Copy link
Contributor

@hansemannn The CI build is failing with:

xcodebuild: error: invalid option '-UseNewBuildSystem'

@hansemannn
Copy link
Collaborator Author

Thanks Chris, silly error. Apparently, -UseNewBuildSystem YES !== -UseNewBuildSystem=YES 🙄

'-derivedDataPath', path.join(this.buildDir, 'DerivedData'),
'-UseNewBuildSystem=' + this.useNewBuildSystem ? 'YES' : 'NO',
Copy link
Contributor

@cb1kenobi cb1kenobi Jul 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need parentheses around this.useNewBuildSystem ? 'YES' : 'NO'. The + has higher precedence than ? :. This will likely address the issue @sgtcoolguy was having.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the issue was that it was passed as 2 array args ([-UseNewBuildSystem, YES/NO]) before, which resulted in -UseNewBuildSystem YES instead of -UseNewBuildSystem=YES.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ node
> let x = true;
undefined
> '-UseNewBuildSystem=' + x ? 'YES' : 'NO'
'YES'
> x = false;
false
> '-UseNewBuildSystem=' + x ? 'YES' : 'NO'
'YES'
> '-UseNewBuildSystem=' + (x ? 'YES' : 'NO')
'-UseNewBuildSystem=NO'

Use parentheses.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sigh. Yeah, template literals.

@build
Copy link
Contributor

build commented Jul 20, 2018

Messages
📖

💾 Here's the generated SDK zipfile.

Generated by 🚫 dangerJS

@hansemannn hansemannn merged commit 2f82e54 into tidev:master Jul 20, 2018
sgtcoolguy pushed a commit that referenced this pull request Aug 27, 2018
… 10, make configurable on older (#10181)

* [TIMOB-25226] Use the new Xcode build-system by default on Xcode 10, make configurable on older

* [TIMOB-25226] Commit missing dash

* Update _build.js

* Update _build.js

* Update to node-titanium-sdk 0.6.0

* Review comments

* Update _build.js

* Update _build.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants