{ "id": "115281", "key": "ALOY-680", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "15758", "description": "Alloy 1.4.0", "name": "Alloy 1.4.0", "archived": false, "released": true, "releaseDate": "2014-07-17" }, { "id": "15887", "description": "2014 Sprint 03", "name": "2014 Sprint 03", "archived": true, "released": true, "releaseDate": "2014-02-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-02-05T23:11:33.000+0000", "created": "2013-05-31T16:26:53.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "notable", "qe-testadded" ], "versions": [], "issuelinks": [ { "id": "37202", "type": { "id": "10000", "name": "Blocks", "inward": "is blocked by", "outward": "blocks" }, "inwardIssue": { "id": "129833", "key": "TIDOC-1650", "fields": { "summary": "Compiler directives to distinguish between ad-hoc and app-store distribution", "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": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-05-19T09:14:48.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": [], "description": "It would be nice, if it would be possible to programmatically distinguish between ad-hoc and app-store distribution.\r\n\r\nSo like the other environment compiler directives:\r\nENV_DEV\r\nENV_TEST\r\nENV_PROD\r\nit would be nice to have something like:\r\nDIST_IOS_ADHOC\r\nDIST_IOS_APPSTORE\r\n\r\nalso see Q&A:\r\nhttp://developer.appcelerator.com/question/152765/alloy-is-there-any-way-to-have-conditional-code-distinguishing-between-ad-hoc-distribution-and-app-store-distribution", "attachment": [ { "id": "45398", "filename": "app.zip", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-01-27T15:52:39.000+0000", "size": 3835821, "mimeType": "application/zip" } ], "flagged": false, "summary": "add compiler directives to distinguish between ad-hoc and app-store distribution", "creator": { "name": "vitr", "key": "vitr", "displayName": "Vitr", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "iOS", "comment": { "comments": [ { "id": "280514", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Yes yes yes, want this! Also would like to have them available in {{config.json}} so I can set different API keys for stuff like TestFlight, push and backends.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2013-11-21T08:25:06.000+0000", "updated": "2013-11-21T08:25:06.000+0000" }, { "id": "280517", "author": { "name": "core13", "key": "core13", "displayName": "Malcolm Hollingsworth", "active": true, "timeZone": "Europe/London" }, "body": "This is one of those things that really hits a specific need - whilst it will not benefit everyone - the power users really need this sort of thing.", "updateAuthor": { "name": "core13", "key": "core13", "displayName": "Malcolm Hollingsworth", "active": true, "timeZone": "Europe/London" }, "created": "2013-11-21T09:18:08.000+0000", "updated": "2013-11-21T09:18:08.000+0000" }, { "id": "289804", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "Goal is for an app like the attached to output ad-hoc values when built from Studio or CLI as an Ad-Hoc build. Proposal that the config.json value would be ENV_ADHOC because ad-hoc is a type of a production build -- you can do a production build for the App Store *or* Ad-Hoc, but not both. So, there's no need to have to set both ENV_PRODUCTION and DIST_TYPE=adhoc to identify an ad-hoc build.", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-01-27T15:52:39.000+0000", "updated": "2014-01-27T15:55:36.000+0000" }, { "id": "289811", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "As long as an adhoc build also has ENV_PRODUCTION true I'm fine with it.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-01-27T16:43:33.000+0000", "updated": "2014-01-27T16:43:33.000+0000" }, { "id": "289813", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Yep, ENV_ADHOC will also set ENV_PRODUCTION and ENV_PROD", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-27T17:11:47.000+0000", "updated": "2014-01-27T17:11:47.000+0000" }, { "id": "289817", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "And then there should be ENV_STORE of course", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-01-27T17:22:08.000+0000", "updated": "2014-01-27T17:22:08.000+0000" }, { "id": "289819", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "Why? If the default of ENV_ADHOC is false (as it is for any of the values), simply testing for ENV_PROD should be sufficient. What am I missing?", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-01-27T17:25:17.000+0000", "updated": "2014-01-27T17:25:17.000+0000" }, { "id": "289821", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We were going to have that be implied with ENV_PROD is ENV_ADHOC was not true. This is making think that developers should have access to make compiler conditionals on any value from the CLI they choose. Unless you have a strong objection [~fokke] we will likely leave this ticket as defined and just account for ENV_ADHOC, but another ticket for giving access to the data in the alloy hook that comes straight from the CLI might be beneficial, heading this problem off before it occurs again.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-01-27T17:27:06.000+0000", "updated": "2014-01-27T17:27:06.000+0000" }, { "id": "289826", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "So if I want to target code for App Store only I need this?\r\n\r\n{code}\r\nif (ENV_PRODUCTION && !ENV_ADHOC) {}\r\n{code}", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-01-27T17:37:08.000+0000", "updated": "2014-01-27T17:37:08.000+0000" }, { "id": "289978", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "Your build target (app store or adhoc) is decided by the CLI and passed to Alloy as a parameter.\n\nENV_ADHOC will be true only for ad-hoc builds. ENV_PROD will be true for both app store and ad-hoc builds.\n\nconfig.json: \n * settings in ENV_PROD will be applied in both types of builds\n * settings in ENV_ADHOC will be applied for only ad-hoc builds, and would override settings in ENV_PROD\n\ncompiler directives in controllers:\n * if(ENV_PROD) {} // would run in both app store and ad-hoc builds, though obviously you'd do one or the other type build\n * if(ENV_ADHOC) {} // would run in only ad-hoc builds if build type is ad-hoc\n * if(ENV_PROD && !ENV_ADHOC) {} // would run for only an app-store build\n * if(ENV_ADHOC && !ENV_PROD) {} // wouldn't run\n", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-01-28T15:30:16.000+0000", "updated": "2014-01-28T15:30:16.000+0000" }, { "id": "289979", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Well, I dont find that very logical, but I guess it will do", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-01-28T15:47:09.000+0000", "updated": "2014-01-28T15:47:09.000+0000" }, { "id": "290007", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "My final attempt to talk you out of (only) {{ENV_ADHOC}}:\r\n\r\n- Targeting App Store using {{ENV_PROD && !ENV_ADHOC}} is like using {{!OS_IOS}} to target Android. It requires people to know about all options and how they relate.\r\n- As it is now both {{OS_}} and {{ENV_}} have only one of them {{true}} at the same time. I would keep it that way.\r\n- I don't know of any other OS or language where two types of ENV (environment) can be {{true}} at the same time.\r\n- AdHoc and AppStore are no environments, they are two ways to distribute.\r\n\r\nI would strongly advice to go with both {{DIST_ADHOC}} and {{DIST_STORE}} and make the second one {{TRUE}} both both {{dist-appstore}} and {{dist-playstore}} targets.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-01-28T18:00:51.000+0000", "updated": "2014-01-28T18:00:51.000+0000" }, { "id": "291542", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "h3. implementation\r\n\r\n* *DIST_ADHOC* - will be true when the iOS build target is \"dist-adhoc\"\r\n* *DIST_STORE* - will be true when the iOS build target is \"dist-appstore\", or the android build target is \"dist-playstore\" \r\n\r\nh3. code\r\n\r\nPR: https://github.com/appcelerator/alloy/pull/329\r\ntest app: https://github.com/appcelerator/alloy/tree/master/test/apps/testing/ALOY-680\r\n\r\nh3. functional test\r\n\r\nThis should be executed for all of the following. The \"deployType\" for all will be \"production\", the \"target\" is shown in the parens next to each:\r\n\r\n* Android playstore distribution (\"store\")\r\n* iOS adhoc build (\"adhoc\")\r\n* iOS itunes store build (\"store\")\r\n\r\n# Execute one of the build process mentioned above on the test app\r\n# While you could do the entire packaging, and easier way to test would be to abort the build process after the alloy step completes and then inspect the generated code.\r\n# Go to \"Resources/PLATFORM/alloy/controllers/index.js\"\r\n# Check the end of the generated code where the \"deployType\" and \"dist\" variables are assigned. \r\n# Confirm that the strings assigned to those variables match what you would expect, as noted in parens next to each build type above.\r\n", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-05T23:11:33.000+0000", "updated": "2014-02-05T23:11:33.000+0000" }, { "id": "305469", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-05-19T07:04:00.000+0000", "updated": "2014-05-19T07:04:00.000+0000" }, { "id": "305478", "author": { "name": "core13", "key": "core13", "displayName": "Malcolm Hollingsworth", "active": true, "timeZone": "Europe/London" }, "updateAuthor": { "name": "core13", "key": "core13", "displayName": "Malcolm Hollingsworth", "active": true, "timeZone": "Europe/London" }, "created": "2014-05-19T09:14:48.000+0000", "updated": "2014-05-19T09:14:48.000+0000" } ], "maxResults": 19, "total": 19, "startAt": 0 } } }