[TIMOB-18199] iOS: iOS modules can not build if there any JS files inside assets folder
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-08-24T01:56:05.000+0000 |
Affected Version/s | Release 3.5.0 |
Fix Version/s | Release 4.0.0 |
Components | iOS, Tooling |
Labels | qe-3.5.0 |
Reporter | Kajenthiran Velummaylum |
Assignee | Feon Sua Xin Miao |
Created | 2014-12-15T07:19:56.000+0000 |
Updated | 2017-03-16T22:09:31.000+0000 |
Description
iOS modules can not be built if there are any JS files inside the root assets folder.
Steps To Reproduce
1. Create an iOS module 2. Place a javascript file with some code in the assets folder at the root. 3. Build the moduleExpected Result
Module should build as usualActual Result
CLI is throwing following error.
Traceback (most recent call last):
File "build.py", line 262, in <module>
compile_js(manifest,config)
File "build.py", line 84, in compile_js
root_asset, module_assets = compiler.compile_module()
File "/Users/kvelummaylum/Library/Application Support/Titanium/mobilesdk/osx/3.5.0.v20141211124115/iphone/compiler.py", line 431, in compile_module
root_asset = self.compile_commonjs_file(self.appid+'.js', os.path.join(self.assets_dir, self.appid+'.js'))
File "/Users/kvelummaylum/Library/Application Support/Titanium/mobilesdk/osx/3.5.0.v20141211124115/iphone/compiler.py", line 564, in compile_commonjs_file
self.compile_js_file(path, from_, js_files)
File "/Users/kvelummaylum/Library/Application Support/Titanium/mobilesdk/osx/3.5.0.v20141211124115/iphone/compiler.py", line 578, in compile_js_file
self.compile_js_asset_file(path,from_)
File "/Users/kvelummaylum/Library/Application Support/Titanium/mobilesdk/osx/3.5.0.v20141211124115/iphone/compiler.py", line 545, in compile_js_asset_file
file_contents = open(os.path.expanduser(file)).read()
IOError: [Errno 2] No such file or directory: '/Users/kvelummaylum/Documents/Appcelerator_Studio_Workspace/ModuleTest/iphone/assets/ti.iostest.js'
Workaround
We need to move the assets folder inside iphone folder.Attachments
File | Date | Size |
---|---|---|
HelloWorld.zip | 2015-08-21T17:48:43.000+0000 | 219157 |
PR: https://github.com/appcelerator/titanium_mobile/pull/6487 Functional Test: 1. Create an iOS module :
2. Create a JS file follow the naming convention of
\[module id\].js
, in this casecom.example.test.js
, under thetest/assets
folder 3. In the module platform folder, run4. The module should be built with no error \\ NOTE: According to [iOS Module Development Guide](http://docs.appcelerator.com/titanium/3.0/#!/guide/iOS_Module_Development_Guide) {quote} Starting with Release 3.3.0, the Titanium CLI generates a module project containing multiple platforms. The module contains platform folders, for example, iphone, that contain platform-specific resources and common folders for assets, documentation and examples. {quote}
CR & FR passed, PR merged
Verified fixed using: Titanium SDK 4.0.0.v20150312092612 Studio 4.0.0.201503062102 CLI 3.4.2 Xcode 6.2 Node 0.12 Module building completed without error.
https://github.com/appcelerator/titanium_mobile/pull/7060
APPROVED. PR merged.
Closing ticket as fixed.