{ "id": "101501", "key": "ALOY-282", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "14171", "description": "", "name": "2012 Sprint 19", "archived": true, "released": true, "releaseDate": "2012-09-24" }, { "id": "14176", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": false, "released": true, "releaseDate": "2012-12-13" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-09-19T14:45:07.000+0000", "created": "2012-09-19T10:06:57.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [], "issuelinks": [ { "id": "21112", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "101517", "key": "TIMOB-10991", "fields": { "summary": "Compiler plugins pre-empted, can't run an app with no Resources directory (Alloy)", "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": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": null, "updated": "2018-03-07T22:26:08.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [], "description": "h3. The problem\r\nWhen building an alloy application through the command line, if there is a syntax error in the code, the build will fail and cannot be run again. The \"iphone\" folder inside the Resource is missing and needs to be recreated\r\n\r\nh3. Steps to reproduce:\r\n1. Create an Alloy app\r\n2. Run it through the command line: _alloy run_\r\n3. Create a syntax error in index.js, for example _#.index.open()_ instead of _$.index.open()_\r\n4. Build will fail\r\n5. Fix the error and _alloy run_ again\r\n6. Build will fail again, this time because \"iphone\" folder is missing, we need to manually recreate it.\r\n\r\nNote: \r\nNot sure if this happens also through Studio, my Studio installation has issues and cannot launch the simulator.\r\n", "attachment": [], "flagged": false, "summary": "Alloy - Syntax error breaks build process", "creator": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "Alloy 0.2.32\r\nCommand Line", "comment": { "comments": [ { "id": "219736", "author": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Did you try \"alloy compile\" after the fix", "updateAuthor": { "name": "rmcmahon", "key": "rmcmahon", "displayName": "Russell McMahon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-19T10:11:12.000+0000", "updated": "2012-09-19T10:11:12.000+0000" }, { "id": "219785", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Here is the fix: \r\n\r\n{code}\r\n// Alloy/commands/run/index.js\r\n\r\nvar path = require('path'),\r\n\t_ = require(\"../../lib/alloy/underscore\")._,\r\n\tU = require('../../utils'),\r\n\tlogger = require('../../common/logger'),\r\n\ttitanium = require('../../common/titanium'),\r\n\tfs = require('fs');\r\n\r\nmodule.exports = function(args, program) {\r\n\tif (!titanium.home) {\r\n\t\tU.die('run command not supported on platform \"' + process.platform + '\"');\r\n\t}\r\n\r\n\t// Validate the input path\r\n\tvar inputPath = path.resolve(args.length > 0 ? args[0] : U.resolveAppHome());\r\n\tif (!path.existsSync(inputPath)) {\r\n\t\tU.die('inputPath \"' + inputPath + '\" does not exist');\r\n\t}\r\n\t\r\n\t// Validate that this is a Titanium alloy-powered project\r\n\tif (U.isTiProject(inputPath)) {\r\n\t\tif (!path.existsSync(path.join(inputPath,'app'))) {\r\n\t\t\tU.die(\"This project doesn't seem to contain an Alloy app directory\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t// Check for platform\r\n\tvar platform = args[1] || 'iphone';\r\n\tvar missingPath = path.resolve('Resources/'+platform);\r\n\r\n\t// Check for missing directory\r\n\tif(!path.existsSync(missingPath)) {\r\n\r\n\t\t// Create it if need be\r\n\t\tconsole.log(platform + ' does not exist');\r\n\t\tfs.mkdir(missingPath, 0777, function() {\r\n\t\t\tconsole.log(platform + ' created');\r\n\t\t});\r\n\r\n\t} \r\n\r\n\t//run the project\r\n\tvar p = titanium.run(\r\n\t\tinputPath, \r\n\t\tplatform, //optional platform\r\n\t\tprogram.tiversion, //optional version\r\n\t\tprogram.tiSDK //optional SDK direct path\r\n\t);\r\n}\r\n{code}", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-09-19T12:19:31.000+0000", "updated": "2012-09-19T12:21:58.000+0000" }, { "id": "219788", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This issue relates to TIMOB-10991. A true solution will come when that ticket is resolved. In the meantime I will attempt to workaround this bug.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-19T12:28:02.000+0000", "updated": "2012-09-19T12:28:02.000+0000" }, { "id": "219792", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thanks Pedro for the {{alloy run}} fix. This will resolve command line usage problems. Need TIMOB-10991 before TiStudio can catch it though. I'll do my best to minimize the situations where this occurs. Syntax errors will not be one of them. ;-)", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-19T12:47:29.000+0000", "updated": "2012-09-19T12:47:29.000+0000" }, { "id": "219826", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "As fixed as i can get it without TIMOB-10991. The only time it would fail is if you manually delete Resources (or the necessary platform-specific folders) or import a project that has no Resources path and try to run through studio. The nice part is though that `alloy run` or `alloy compile` from the command line will recover from any state", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-19T14:45:07.000+0000", "updated": "2012-09-19T14:45:07.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }