[TIMOB-25520] iOS: Add ability to set VALID_ARCHITECTURES to limit supported architectures
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | n/a |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | architecture, cb-tooling, ios, processor |
Reporter | Zakhar Zhuravlev |
Assignee | Chris Barber |
Created | 2017-11-16T10:26:52.000+0000 |
Updated | 2019-10-22T15:40:17.000+0000 |
Description
On android we can specify tag and exclude some abis.
I need to compile iOS app only for arm64, as far as I understand now I don't have ability to exclude armv7 and armv7s.
It would be great to have it for iOS as well.
Thanks for this feature request. It's not planned so far, but could likely be implemented as an external hook pretty easily, as it's just a build-setting in the
.pbxproj
file. See [this file](https://github.com/appcelerator-modules/hook-swift-frameworks/blob/master/ti.swiftsupport.js) for an example of changing the Swift version - it can be changed to specify any other value as well. And of course feel free to submit a pull-request if you feel it should be in the core.Thank you, Hans. I found examples with native modules only, I want to set architectures for the whole app, should I create plugin for that?
Yes, a plugin look forcing the
VALID_ARCHS
will limit it.1. create folder: /plugins/myplugin/hooks/myplugin.js 2. in titapp.xml add:
But I don't see this log message, even in trace mode. Have I missed something? Thank you in advance.
[~zozo4kin] You don't need to create a "plugin" in this case. You can simply create a "hooks" directory in the top-level of your project and put
myplugin.js
in there and the build script will automatically load it. No need to add the<plugin>
to the tiapp.xml. If you are going to have more than one.js
file, only put the main one in the "hooks" directory and put the rest in a subdirectory. The build will blindly require() every.js
file in the "hooks" directory. If you want to continue doing this as a plugin, then you must have a package.json in the root of your "myplugin" folder and you must define all of the<plugin>
tags in a<plugins>
section in the tiapp.xml (just like<modules>
).Thank you very much. It works with "hooks" directory at the root. But it works only with cleaned project. On the second build I get error:
after "appc ti clean" it works again, but build takes a lot of time with this hook. Approx 3-4 min.
Clean builds are pretty slow. If you change the VALID_ARCHS, then it's probably building each source file multiple times for the various architectures. We used to build for all architectures, but I changed it to ONLY_ACTIVE_ARCH=1 since it didn't make sense to compile for i386 and x64 for simulator builds. I'm not sure what your hook is changing since I haven't seen the code, but I don't understand why it would break subsequent builds. Maybe our differential build logic doesn't properly detect or handle the derived data when there are extra compiled architectures? Hard to say without testing it myself.
Thank you for help, Chris. my code: