Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3342] Module build.py missing LICENSE

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2011-05-18T09:13:51.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.7.0, Sprint 2011-14, Release 1.6.2
ComponentsiOS
Labelsbuild, ios, klist, module, release-1.6.2, release-1.7.0, rplist, tooling
ReporterAlan Leard
AssigneeReggie Seagraves
Created2011-04-15T03:42:31.000+0000
Updated2011-05-18T09:13:51.000+0000

Description

Problem

When you build a module from Titanium.py the build.py file that is created is not finding the LICENSE file.

Error

Traceback (most recent call last):
  File "/mymodule/build.py", line 187, in <module>
    validate_license()
  File "/mymodule/build.py", line 99, in validate_license
    c = open('LICENSE').read()
IOError: [Errno 2] No such file or directory: 'LICENSE'

Suggested Fix

Modify lines 99-100 to:

 path = os.path.join(cwd,'LICENSE')
            x = open(path)
            c = x.read()

Ticket Reference

http://developer.appcelerator.com/helpdesk/view/76398">http://developer.appcelerator.com/helpdesk/view/76398

Comments

  1. Bill Dawson 2011-04-15

    For QE: to re-create this and test the fix, run this from the terminal ...

       $ $TI_SDK/titanium.py create --platform=iphone --type=module --name=flubber --id=com.example.flubber
       

    ... to create the module, where $TI_SDK should be replaced with the full path to the SDK, such as ...

       $ /Library/Application\ Support/Titanium/mobilesdk/osx/1.7.0/titanium.py create --platform=iphone --type=module --name=flubber --id=com.example.flubber
       

    After the module is then created, do ...

       $ flubber/build.py
       

    You should get the error described above, until you have installed the fix. NOTE: if you happen to do ../build.py from inside the module directory, it works fine - you won't then see the error. The point is, you need to run build.py when your current working directory is not the module directory.

  2. Bill Dawson 2011-04-15

    (from [2b9f545c435acbfbb83fd2675f34a9b82414db8c]) Check for LICENSE in correct folder. [#3342] https://github.com/appcelerator/titanium_mobile/commit/2b9f545c435acbfbb83fd2675f34a9b82414db8c"> https://github.com/appcelerator/titanium_mobile/commit/2b9f545c435a...

  3. Bill Dawson 2011-04-15

    (from [6377a692c47cd79b22c9f8500f4de61a640d6285]) Check for LICENSE in correct folder. [#3342] https://github.com/appcelerator/titanium_mobile/commit/6377a692c47cd79b22c9f8500f4de61a640d6285"> https://github.com/appcelerator/titanium_mobile/commit/6377a692c47c...

  4. Bill Dawson 2011-04-15

    Cherry-picked also to 1_6_X.

  5. Bill Dawson 2011-04-15

    Note that iphone modules that already exist are not aided by this fix, since the build.py file is copied to the module folder when the module is created. So if you have an existing module and you want this fix, you need to ...

    • Install the fixed version of the SDK, of course.

    • Copy the build.py from the SDK's module/iphone/templates folder to your module's folder.

  6. Thomas Huelbert 2011-05-18

    RC1, osx, win7

JSON Source