{ "id": "164647", "key": "TIMOB-24163", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "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": "2016-11-22T21:06:50.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "18247", "name": "Hyperloop 2.0.0", "archived": false, "released": true, "releaseDate": "2016-10-18" } ], "issuelinks": [ { "id": "54771", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "167315", "key": "TIMOB-24632", "fields": { "summary": "Hyperloop: iOS - Swift metabase parser using SourceKit", "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" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "6", "description": "gh.issue.epic.desc", "name": "Epic", "subtask": false } } } } ], "assignee": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2017-11-10T17:08:46.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": "13715", "name": "Hyperloop", "description": "Hyperloop project" }, { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "Classes from system frameworks that are Swift exclusive can not be used in custom Swift code in Hyperloop. Example class: https://developer.apple.com/reference/foundation/url\r\n\r\n*Steps to reproduce the behavior*\r\n1. Create a new Hyperloop enabled project\r\n2. Add the following sample code under {{src/MySwift.swift}}:\r\n{code:swift}\r\nimport Foundation\r\n\r\npublic class MySwift {\r\n public func getUrl() -> URL {\r\n return URL(string: \"http://appcelerator.com\")!;\r\n }\r\n}\r\n{code}\r\n3. Add a {{appc.js}} to the project root with the following content:\r\n{code}\r\nmodule.exports = {\r\n\ttype: 'app',\r\n\tgroup: 'titanium',\r\n\thyperloop: {\r\n\t\tios: {\r\n\t\t\tthirdparty: {\r\n\t\t\t\t'MyFramework': {\r\n\t\t\t\t\tsource: ['src'],\r\n\t\t\t\t\theader: 'src',\r\n\t\t\t\t\tresource: 'src'\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\n{code}\r\n4. Add {{var MySwift = require('MyFramework/MySwift');}} to {{app/controller/index.js}} to trigger Hyperloop's metabase generation\r\n5. Build the project with {{appc run -p ios}}\r\n\r\n*Actual behavior*\r\nThe build fails with the following error: Swift Generation failed with unknown or unsupported type (URL) found while compiling /Users/jvennemann/Development/appc/swift-url/src/MySwift.swift\r\n\r\n*Expected behavior*\r\nThe build succeeds and the metabase for Swift-only classes will be generated\r\n\r\n*Additional notes*\r\nThe reason why this fails is because the {{import Foundation}} statement in the Swift source will be mapped to the Objective-C equivalent {{import }}. Due to {{URL}} being Swift-only the metabase generator can not properly determine a type and fails. SourceKit may be a possible solution and needs some more investigation.\r\n\r\nSee also: https://github.com/apple/swift-evolution/blob/master/proposals/0086-drop-foundation-ns.md", "attachment": [], "flagged": false, "summary": "Hyperloop: iOS - Metabase generation fails for Swift-only classes from system frameworks", "creator": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "environment": "appc-cli 6.0.0\r\nTiSDK 6.0.0\r\nNode.js 4.6.2", "comment": { "comments": [], "maxResults": 0, "total": 0, "startAt": 0 } } }