{ "id": "170333", "key": "TIMOB-25520", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2017-11-16T10:26:52.000+0000", "priority": null, "labels": [ "architecture", "cb-tooling", "ios", "processor" ], "versions": [], "issuelinks": [], "assignee": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "updated": "2019-10-22T15:40:17.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "On android we can specify tag and exclude some abis. \r\nI need to compile iOS app only for arm64, as far as I understand now I don't have ability to exclude armv7 and armv7s. \r\nIt would be great to have it for iOS as well. ", "attachment": [], "flagged": false, "summary": "iOS: Add ability to set VALID_ARCHITECTURES to limit supported architectures", "creator": { "name": "zozo4kin", "key": "zozo4kin", "displayName": "Zakhar Zhuravlev", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "zozo4kin", "key": "zozo4kin", "displayName": "Zakhar Zhuravlev", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "430803", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "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.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-11-16T11:03:47.000+0000", "updated": "2017-11-16T11:03:47.000+0000" }, { "id": "436574", "author": { "name": "zozo4kin", "key": "zozo4kin", "displayName": "Zakhar Zhuravlev", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thank you, Hans. \r\nI found examples with native modules only, I want to set architectures for the whole app, should I create plugin for that?", "updateAuthor": { "name": "zozo4kin", "key": "zozo4kin", "displayName": "Zakhar Zhuravlev", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-06T12:12:47.000+0000", "updated": "2018-04-06T12:12:47.000+0000" }, { "id": "436575", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Yes, a plugin look forcing the {{VALID_ARCHS}} will limit it.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-04-06T12:42:06.000+0000", "updated": "2018-04-06T12:42:06.000+0000" }, { "id": "436622", "author": { "name": "zozo4kin", "key": "zozo4kin", "displayName": "Zakhar Zhuravlev", "active": true, "timeZone": "America/Los_Angeles" }, "body": "1. create folder: /plugins/myplugin/hooks/myplugin.js\r\n2. in titapp.xml add: myplugin\r\n3. code: \r\n{code:java}\r\n'use strict';\r\n\r\nexports.id = 'myplugin';\r\nexports.cliVersion = '>=3.2';\r\nexports.init = init;\r\n\r\nfunction init(logger, config, cli, appc) {\r\n\tcli.on('build.ios.xcodeproject', {\r\n\t\tpre: function(data) {\r\n\t\t\tlogger.log('Test plugin');\r\n\t\t}\r\n\t});\r\n}\r\n\r\n{code}\r\n\r\n\r\nBut I don't see this log message, even in trace mode. Have I missed something? \r\nThank you in advance.", "updateAuthor": { "name": "zozo4kin", "key": "zozo4kin", "displayName": "Zakhar Zhuravlev", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-09T07:59:51.000+0000", "updated": "2018-04-09T07:59:51.000+0000" }, { "id": "436635", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "[~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 {{}} to the tiapp.xml.\r\n\r\nIf 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.\r\n\r\nIf 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 {{}} tags in a {{}} section in the tiapp.xml (just like {{}}).", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2018-04-09T13:44:03.000+0000", "updated": "2018-04-09T13:44:03.000+0000" }, { "id": "436711", "author": { "name": "zozo4kin", "key": "zozo4kin", "displayName": "Zakhar Zhuravlev", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thank you very much.\r\nIt works with \"hooks\" directory at the root. But it works only with cleaned project. On the second build I get error:\r\n{code:java}\r\n[ERROR] An error occurred during build after 1m 6s 429ms\r\n[ERROR] Failed to install app on device (0xe8000067)\r\n[ERROR] For some reason the app failed to install on the device. Try reconnecting your device and check your provisioning profile and entitlements.\r\n{code}\r\n\r\nafter \"appc ti clean\" it works again, but build takes a lot of time with this hook. Approx 3-4 min. ", "updateAuthor": { "name": "zozo4kin", "key": "zozo4kin", "displayName": "Zakhar Zhuravlev", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-10T14:12:32.000+0000", "updated": "2018-04-10T14:12:32.000+0000" }, { "id": "436786", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "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.\r\n\r\nI'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.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2018-04-11T14:45:57.000+0000", "updated": "2018-04-11T14:45:57.000+0000" }, { "id": "436787", "author": { "name": "zozo4kin", "key": "zozo4kin", "displayName": "Zakhar Zhuravlev", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thank you for help, Chris.\r\nmy code:\r\n\r\n{code:java}\r\n'use strict';\r\n\r\nexports.cliVersion = '>=3.2';\r\nexports.init = init;\r\n\r\nfunction init(logger, config, cli, appc) {\r\n\tcli.on('build.ios.xcodeproject', {\r\n\t\tpre: function(data) {\r\n\r\n var xobjs = data.args[0].hash.project.objects;\r\n\t\t\tObject.keys(xobjs.PBXNativeTarget).forEach(function (targetUuid) {\r\n\t\t\t\tvar target = xobjs.PBXNativeTarget[targetUuid];\r\n\t\t\t\tif (target && typeof target === 'object') {\r\n\t\t\t\t\txobjs.XCConfigurationList[target.buildConfigurationList].buildConfigurations.forEach(function (buildConf) {\r\n\t\t\t\t\t\tvar buildSettings = xobjs.XCBuildConfiguration[buildConf.value].buildSettings;\r\n buildSettings.VALID_ARCHS = \"arm64\";\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t}\r\n\t});\r\n}\r\n\r\n{code}\r\n", "updateAuthor": { "name": "zozo4kin", "key": "zozo4kin", "displayName": "Zakhar Zhuravlev", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-11T15:03:28.000+0000", "updated": "2018-04-11T15:03:28.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }