{ "id": "162927", "key": "TIMOB-23854", "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": [ { "id": "18429", "description": "", "name": "Hyperloop 2.2.0", "archived": false, "released": true, "releaseDate": "2017-10-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-12-02T15:08:27.000+0000", "created": "2016-09-01T00:29:39.000+0000", "epic": { "id": 163902, "key": "TIMOB-24020", "name": "Hyperloop Run Script Build Phases", "summary": "Hyperloop: iOS - Support Run Script Build Phases", "color": { "key": "color_3" }, "done": false }, "priority": { "name": "Critical", "id": "1" }, "labels": [ "hyperloop", "ios" ], "versions": [ { "id": "18264", "name": "hyperloop 1.2.7", "archived": false, "released": true, "releaseDate": "2017-02-06" } ], "issuelinks": [], "assignee": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2017-10-19T18:16:31.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "13715", "name": "Hyperloop", "description": "Hyperloop project" } ], "description": "Some native iOS libs / frameworks require the developer to call certain scripts during the build phase (see image attached). This could be done in the *appc.js* file:\r\n\r\n{code:javascript}\r\nhyperloop: {\r\n ios: {\r\n xcodebuild: {\r\n scripts: [{\r\n name: 'My script phase',\r\n shellScript: '${APPC_PROJECT_DIR}/src/script.sh'\r\n }]\r\n }\r\n }\r\n}\r\n{code}", "attachment": [ { "id": "60175", "filename": "Screen Shot 2016-09-01 at 10.23.37 AM.png", "author": { "name": "rdperottoni", "key": "rdperottoni", "displayName": "Rodolfo Perottoni", "active": true, "timeZone": "Australia/Brisbane" }, "created": "2016-09-01T00:23:54.000+0000", "size": 19069, "mimeType": "image/png" } ], "flagged": false, "summary": "Hyperloop: iOS - Support creating of Run Script phases", "creator": { "name": "rdperottoni", "key": "rdperottoni", "displayName": "Rodolfo Perottoni", "active": true, "timeZone": "Australia/Brisbane" }, "subtasks": [], "reporter": { "name": "rdperottoni", "key": "rdperottoni", "displayName": "Rodolfo Perottoni", "active": true, "timeZone": "Australia/Brisbane" }, "environment": null, "comment": { "comments": [ { "id": "395019", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "We can think about that. But you can actually do it today already using the Titanium plugin-hooks. Summarized, we have different hooks in our CLI that you can hook into (like we already do with our Hyperloop CLI that sits in {{plugins/hyperloop}}. So you could be notified when certain build phases are reached and inject your own scripts there (e.g. run shell-scripts using node-commands). \r\n\r\nPlease check out how Hyperloop makes it and go from there for now. We schedule it anyway, might be a good appc.js addition. Thanks!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-01T07:44:11.000+0000", "updated": "2016-09-01T07:44:53.000+0000" }, { "id": "395024", "author": { "name": "rdperottoni", "key": "rdperottoni", "displayName": "Rodolfo Perottoni", "active": true, "timeZone": "Australia/Brisbane" }, "body": "Cool, I'll give it a go.", "updateAuthor": { "name": "rdperottoni", "key": "rdperottoni", "displayName": "Rodolfo Perottoni", "active": true, "timeZone": "Australia/Brisbane" }, "created": "2016-09-01T08:06:45.000+0000", "updated": "2016-09-01T08:06:52.000+0000" }, { "id": "395257", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Here is how it's mapped in the .pbxproj file:\r\n{code}\r\n3AC54DA81D7A4392007D9994 /* ShellScript */ = {\r\n\tisa = PBXShellScriptBuildPhase;\r\n\tbuildActionMask = 2147483647;\r\n\tfiles = (\r\n\t);\r\n\tinputPaths = (\r\n\t\t\"$(SRCROOT)/myfile\",\r\n\t);\r\n\toutputPaths = (\r\n\t\t\"$(DERIVED_FILE_DIR)/myfile\",\r\n\t);\r\n\trunOnlyForDeploymentPostprocessing = 0;\r\n\tshellPath = /bin/sh;\r\n\tshellScript = test;\r\n};\r\n{code}\r\n\r\nas well as the reference of the ID in the {{buildPhases}} list.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-02T23:35:35.000+0000", "updated": "2016-09-02T23:35:35.000+0000" }, { "id": "398451", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[This page|http://www.monobjc.net/xcode-project-file-format.html] has a good summary, see the \"PBXShellScriptBuildPhase\" paragraph.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-10-09T14:06:51.000+0000", "updated": "2016-10-09T14:06:51.000+0000" }, { "id": "399936", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~rdperottoni] Updated your proposal regarding the structure to have a more native data-structure. Where should we place scripts? Is {{src/scripts/}} cool?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-10-27T13:53:04.000+0000", "updated": "2016-10-27T13:53:16.000+0000" }, { "id": "402190", "author": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR (master): https://github.com/appcelerator/hyperloop.next/pull/104\r\nPR (2_0_X): https://github.com/appcelerator/hyperloop.next/pull/105\r\n\r\nUsually I'm all in for convention over configuration but i felt the automatic mapping of a script name to a file in a folder we define is not quite fitting here. Instead, I introduced the env variable {{${APPC_PROJECT_DIR}}} which points to the app's project directory. This is closer to the native behavior in Xcode where {{${SRCROOT}}} is used by default, which points to the Xcode project directory.\r\n\r\nThe minimum configuration to add a Run Script phase:\r\n{code}\r\nhyperloop: {\r\n ios: {\r\n xcodebuild: {\r\n scripts: [{\r\n name: 'My script phase',\r\n shellScript: '${APPC_PROJECT_DIR}/src/script.sh'\r\n }]\r\n }\r\n }\r\n}\r\n{code}\r\n\r\nAll other options are optional and default to the following:\r\n* {{shellPath}}: {{'/bin/sh'}}\r\n* {{runOnlyWhenInstalling}}: {{false}}. I adopted the description from within Xcode for this field which is more clear than the {{runOnlyForDeploymentPostprocessing}} used inside the pbproj file\r\n* {{inputPaths}}: {{[]}}\r\n* {{outputPaths}}: {{[]}}\r\n* {{showEnvVarsInLog}}: {{false}}", "updateAuthor": { "name": "jvennemann", "key": "jvennemann", "displayName": "Jan Vennemann", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-11-29T14:55:40.000+0000", "updated": "2016-12-01T23:47:17.000+0000" }, { "id": "402204", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Thanks for the input Jan. I get where you are coming from, but I'd really like to prevent the env-variable in there. First, because all Hyperloop-related assets should be stored in {{src/}} (which I still don't really like, since we already have {{app/assets}} (Alloy) and {{/Resources}} (Classic), and second, because it adds another level of confusion, because using {{APPC_SRCROOT}}, I'd guess to be in {{/src}} already. So either we normalize the names of it to match more existing ones (see the ones in _build.js), or get rid of them in there completely. ", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-11-29T17:28:14.000+0000", "updated": "2016-11-29T17:28:14.000+0000" }, { "id": "429301", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified. Able to run scripts and inline shell commands in the appc.js. Run script phases correctly execute and show in the logs.", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-10-19T18:16:31.000+0000", "updated": "2017-10-19T18:16:31.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }