{ "id": "108360", "key": "TIMOB-12368", "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": "2013-01-22T03:08:13.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "cb-tooling", "ft" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [ { "id": "40181", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "131130", "key": "TIMOB-17056", "fields": { "summary": "CLI: --sdk argument doesn't override SDK version set in tiapp.xml", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "updated": "2016-08-26T20:55:58.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": "13103", "name": "CLI", "description": "Node-based command line interface" } ], "description": "h2. problem\r\n\r\nThe new CLI has an option for specifying a Titanium SDK, but this option doesn't actually use this SDK to build, only to bootstrap. No matter what value you use for --sdk, or any other option, it will only use the SDK set in the project's tiapp.xml. This makes testing multiple versions cumbersome and automation near impossible. \r\n\r\nh2. proposed solution\r\n\r\nThe --sdk option should actually use the specified SDK to build the project.", "attachment": [], "flagged": false, "summary": "CLI: There's no way to set the build SDK from the new CLI", "creator": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "318132", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Is it possible to instead just make this generic and provide an option to override any tiapp.xml value? Or is this value common enough that we'd want a special shortcut for this?", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-08-12T03:48:29.000+0000", "updated": "2014-08-12T03:48:29.000+0000" }, { "id": "318183", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I can't think of a practical app developer situation in which I'd want to specify a different CLI SDK vs a tiapp.xml SDK. It seems most logical to have {{--sdk}} change both, and to provide a new option(s) to configure the individual CLI or tiapp.xml SDKs in the rare cases you'd actually want them to be different.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-08-12T13:55:12.000+0000", "updated": "2014-08-12T13:55:12.000+0000" }, { "id": "320162", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "As a workaround: What I found while investigating the linked ticket is that if you remove the tag from the tiapp.xml then your app will be built using either the version selected with {{ti sdk select}} or the version you specify with the {{--sdk}} arg. In either case, whatever is set with {{ti sdk select}} is used by the CLI to bootstrap.", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-08-25T19:05:37.000+0000", "updated": "2014-08-25T19:05:37.000+0000" }, { "id": "320176", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "The problem here is the tiapp.xml parsing is done in the SDK, not the CLI. We designed it so that the SDK would always know how to parse the tiapp.xml. That way if TiSDK 3.4.0 added some new tiapp.xml tags, it could properly interpret them and it wouldn't matter if your Titanium CLI was up-to-date.\r\n\r\nAs it turns out, nearly everybody has the latest Titanium CLI and the Titanium CLI is almost always shipped at the same time Titanium SDK.\r\n\r\nTo properly solve this, we should create proxy commands for \"build\", \"clean\", \"create\", and \"project\" in the Titanium CLI and have the \"build\" proxy command do the tiapp.xml parsing. This is not trivial, but also isn't hard. If we're going to make this change, we may want to sit down and think things through and consider any other design changes such as the possible introduction of a daemon.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2014-08-25T20:02:51.000+0000", "updated": "2014-08-25T20:02:51.000+0000" }, { "id": "320188", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "Not nearly so involved, I just submitted https://github.com/appcelerator/titanium_mobile/pull/5987\r\n\r\nFunctional review:\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: 'white'\r\n});\r\nvar lbl = Ti.UI.createLabel({\r\n text: \"Titanium version: \" + Ti.version,\r\n wordWrap: true,\r\n top: 20, left: 10, right: 10\r\n});\r\nwin.add(lbl);\r\nwin.open();\r\n{code}\r\n\r\n1. Create an app with the code above\r\n2. Set the sdk-version in tiapp.xml to some arbitrary version\r\n2. Run from the CLI with {{ti build -p android --sdk 3.4.0}} (other platforms should work, too). Log messages during the build will indicate that 3.4.0 was used to build, as should the label once the app launches.", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-08-25T20:29:33.000+0000", "updated": "2014-08-25T20:29:33.000+0000" }, { "id": "320208", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "I commented on the pull request, but the proposed solution will not work. It ALWAYS overrides the tiapp.xml's {{}} with the selected SDK.\r\n\r\nThe whole point of the {{}} in the tiapp.xml is so that you can have certain apps designed to work with a specific version of the Titanium SDK. If you build an app that is designed for Titanium SDK 3.2.0, then it should not be using 3.3.0 or 3.1.0 or any version other than 3.2.0.\r\n\r\nThis ticket should be closed as \"Won't Fix\", but it may be acceptable to add a {{\\-\\-force\\-sdk }}, but I'm not sold that this is a good idea.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2014-08-25T21:25:59.000+0000", "updated": "2014-08-25T21:25:59.000+0000" }, { "id": "320335", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "You can close that PR. I didn't think that it would be the best or correct solution, just a hack that works in some cases. Please don't close this ticket. The linked ticket, which I created, was a feature request. I closed it because this ticket had more activity & watchers. Please change this ticket to a feature request. I don't care if overriding uses the --sdk arg or a new --force-sdk flag.", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-08-26T13:39:31.000+0000", "updated": "2014-08-26T13:39:31.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }