Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13827] Code Processor: Get alloy to recompile before an analysis

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-06-14T20:50:13.000+0000
Affected Version/sRelease 3.1.0
Fix Version/s2013 Sprint 10 JS, 2013 Sprint 10, 2013 Sprint 12 JS, Release 3.1.1, Release 3.2.0
ComponentsCode Processor
Labelscode-analyzer, qe-closed-3.1.1, qe-testadded
ReporterBryan Hughes
AssigneeBryan Hughes
Created2013-05-10T19:05:38.000+0000
Updated2013-09-24T09:17:53.000+0000

Description

The code processor analysis the generated code from Alloy projects, not the original source. To prevent developer heartache, the code processor should have alloy generate new code each time. This can be accomplished via a hook since the code processor is now a CLI command

Attachments

FileDateSize
Screen Shot 2013-06-12 at 10.50.37 AM.png2013-06-12T18:13:38.000+000049431

Comments

  1. Bryan Hughes 2013-05-10

    PR: https://github.com/appcelerator/alloy/pull/129 1_1_X PR: https://github.com/appcelerator/alloy/pull/130
  2. Bryan Hughes 2013-05-13

    Testing instructions:

    Run in a terminal: npm install -g https://github.com/appcelerator/titanium-code-processor

    Run in a terminal: titanium config paths.commands --append /usr/local/lib/node_modules/titanium-code-processor/commands (I'm assuming not-Windows here :)).

    This step will be unecessary once TIMOB-13831 is complete

    Take an alloy project (any alloy project) and remove the generated code if it exists

    Note: you have to have an app.js in a folder called Resources, or else the core CLI will throw an error. I recommend creating an empty app.js file

    Run in a terminal: titanium analyze -p iphone -A

    With this fix, you will see results corresponding to the generated Alloy code, not the empty app.js file.

    Alternatively you can look in the Resources folder to see if the files were generated

  3. Bryan Hughes 2013-05-14

    Code Processor repo: PR: https://github.com/appcelerator/titanium-code-processor/pull/174 1_0_X PR: https://github.com/appcelerator/titanium-code-processor/pull/175
  4. Tony Lukasavage 2013-05-14

    Tested directly from ticket branch via:
       npm install -g git://github.com/bryan-m-hughes/titanium-code-processor.git#timob-13827
       
    Alloy now compiles prior to any invocation of the analyzer from the CLI. All existing Alloy functionality remains intact. This was tested both on a new and an existing project, both with populated and empty (except for app.js) Resources folders.
  5. Federico Casali 2013-05-29

    Verified as working as expected. Appcelerator Studio 3.1.1.201305282349 Titanium SDK 3.1.1.v20130524180421 Alloy 1.1.3-alpha Titanium-Code-Processor 1.1.3-alpha3 Closing.
  6. Dustin Hyde 2013-06-12

    When I run the code processor on an Alloy project with a deleted Resources directory, there is a runtime error indicating the Resources directory is missing. This happens with the Field Services App by default because it does not have a Resources directory. Appcelerator Studio 3.1.1.201306101955: Mountain Lion 10.8.4 Code Processor: 1.0.1-cr4 Node.js: 0.8.22 Titanium SDK: 3.1.1.v20130609163050 Titanium CLI: 3.1.1-cr Titanium Alloy: 1.1.3-cr Error:
       Could not find source directory "/Applications/Appcelerator/Appcelerator_Studio_3.1.1/workspace/AlloyProject/Resources"
       
       Could not find source directory "/Applications/Appcelerator/Appcelerator_Studio_3.1.1/workspace/AlloyProject/Resources"
       
  7. Bryan Hughes 2013-06-12

    I believe this is a known limitation (known to me anyways) with the CLI itself. If the resources directory doesn't exist, it just quits. Can you try running "ti build" on the project with the deleted resources directory? If it also fails, then it's a CLI bug, otherwise, it's (probably) a code processor bug
  8. Anshu Mittal 2013-06-12

    Testing environment: SDK:3.1.1.v20130611153550 Appcelerator Studio: 3.1.1.201306101955 OS: OSX 10.7.5 As per the testing instructions, 1. Installed Titanium-code-processor version 1.0.1-cr4 2. Ran in terminal: titanium config paths.commands --append /usr/local/lib/node_modules/titanium-code-processor/commands 3. Created a default alloy project and emptied app.'s file from resources folder. 4.Ran in terminal: titanium analyze -p iphone -A Output: Alloy code generated and app.js file is no longer empty.
  9. Dhirendra Jha 2013-06-12

    Used the Alloy (v1.1.3-cr) and Code Processor (v1.0.1-cr4) to verify this issue.
  10. Ingo Muschenetz 2013-06-12

  11. Olga Romero 2013-06-12

    Tested with: Appcelerator Studio, build: 3.1.1.201306112353 Titanium SDK, build: 3.1.1.v20130611153550 code processor 1.0.1-cr4 2. Imported the Field Service App. It does not have a Resources folder. Ran Run > Code Analysis > Run Selected Platforms (iPad, Android) Actual result: Could not find source directory (see the attachment)
  12. Bryan Hughes 2013-06-12

    PR: https://github.com/appcelerator/titanium-code-processor/pull/222 1_0_X PR: https://github.com/appcelerator/titanium-code-processor/pull/223
  13. Tony Lukasavage 2013-06-12

    Functional and code review passed. Tested with an existing alloy app under 2 conditions:

    The *Resources* folder was deleted

    The *Resources* folder was present, but *Resources/app.js* was deleted

    using the following command:
    ti analyze -p iphone -A
    Using a version of the code processor before the above 2 PRs, executing the command would result in an error that stated I was not analyzing a valid Titanium app. When testing both PRs, the code analyzer would run as expected generating a report under both conditions.
  14. Federico Casali 2013-06-14

    Verified as fixed. Environment: Titanium SDK 3.1.1.v20130613185544 Appcelerator Studio 3.1.1.201306121633 CLI 3.1.1-cr Code Processor 1.0.1-cr5 Alloy 1.1.3-cr Node 0.8.22 LiveView 1.0.0.201306121409 Closing.

JSON Source