[TIMOB-20489] iOS modules unable to write to product
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-03-03T00:51:16.000+0000 |
Affected Version/s | Release 5.2.0 |
Fix Version/s | Release 5.2.1 |
Components | iOS |
Labels | n/a |
Reporter | Fokke Zandbergen |
Assignee | Eric Wieber |
Created | 2016-03-01T09:00:37.000+0000 |
Updated | 2016-03-22T20:10:32.000+0000 |
Description
TIMOB-19694 fixed a bug where for iOS anything in a module's
platform/iphone|ios
folder was copied to build/iphone/build/Products/Debug-iphonesimulator/AppName.app
where it should copy to build/iphone
like Android and Windows do.
Unfortunately this breaks Titanium and iOS modules that relied on the old behaviour, when you build using 5.2.0.
This ticket requests to find a module-side solution for this "breaking fix".
So far a project-side solution was suggested, by using a [project CLI plugin or (new) hook](https://gist.github.com/hansemannn/83840da6d7cd39ed6e1e) that copies the files over. However, modules should be self-contained and not rely on additional scripts to be added/written by the user.
Probably, modules should be able to hook into the CLI as well. Then we could give an example of a module-based CLI hook that does what the < 5.2.0 CLI used to do.
Known affected OSS modules:
* https://github.com/Scringo/ScringoTitaniumModule/tree/master/ios/platform/iphone
* https://github.com/an83/JoobMobile-Appcelerator-Module/tree/master/platform/iphone/Resources
* https://github.com/ZeusFramework/ZeusbaseTi/tree/master/Modules/iphone/com.infinery.fv/1.0/platform/iphone
* https://github.com/benbahrenburg/Ti.iSpeech/tree/master/iOS/platform/iphone
* https://github.com/aaronksaunders/ios8documemtpicker/tree/master/iphone/platform/iphone
* https://github.com/mdsb100/titanium-good-practices/tree/master/ShareSDKModuleDemo/ios/TestShareSDK/iphone/platform/iphone
* https://github.com/hyperlab/TiMixpanel/tree/master/ios/platform/iphone
* https://github.com/ryanpeng84/pageflip/tree/master/com.infinery.pageflip/1.0/platform/iphone
* https://github.com/timanrebel/HockeyApp/tree/master/iphone/platform/iphone/HockeySDKResources.bundle
* https://github.com/inthekloud/ITK.Instabug/tree/master/iphone/platform/iphone
* https://github.com/dieskim/countly-sdk-appcelerator-titanium-ios/tree/master/iphone/platform/iphone/Countly.momd
* https://github.com/The-Virtual-Forge/ti.S3FileTransferManager/tree/master/iphone/platform/iphone
* https://github.com/hansemannn/Ti.GoogleMaps/tree/master/iphone/platform/ios/GoogleMaps.bundle
* https://github.com/BOXOUT-THINKERS/TiOpenChat/tree/master/modules/iphone/com.leftlanelab.firebase/1.1.1/platform/iphone
This can't be solved with a CLI hook. This can only be fixed by fixing the iOS build. I propose we introduce a
Resources
directory to modules. Module developers can place bundles and other files in theResources
directory. There will not be aResources/ios
directory since theResources
directory would already be in the platform specific module project directory. This is a 1 line change to the iOS build. Then we need to add maybe 10 lines to the iOS module build. All module authors that use theplatform/ios
directory will need to update their modules and re-package them using whatever Titanium SDK includes this proposed fix. I think we can get by for now only doing this for iOS since supporting aResources
directory would be a new feature for Android, Windows, and Mobile Web.This sounds like a good plan [~cng]. Let's confirm on a fix, and then shove it into 5.2.1 if possible (as it's a bug fix more than a feature add).
By "good plan" I was referring to your comment.
Excellent plan [~cbarber]!
[~fokkezb] can you circulate this idea quickly with some of the above affected module parties to see how they feel about it?
Thanks Chris, sounds great! For me being affected with ti.googlemaps, it's fine.
[~ben.bahrenburg@gmail.com] [~timanrebel] what do you think of Chris is solution to have a
Resources
folder under the module?[~cbarber] one note on the name of the folder. Does it do exactly the same as if you would have these files in the project's Resources folder? If not then we should use a different name.
[~fokkezb] It does the same exact thing as the
Resources
in apps.master PR: https://github.com/appcelerator/titanium_mobile/pull/7790 5_2_X PR: https://github.com/appcelerator/titanium_mobile/pull/7791
Chris, thanks! How can we use this PR for the module development? Same "iphone/Resources/" folder?
Apply this PR. Create a new module. Put stuff in the
iphone/Resources
folder. Build it. Install it. Create a Titanium app. Add the module to the tiapp.xml. Build the app.Scons'd the SDK, made it the default SDK, created a folder "Resources" inside
<module_name>/iphone/
, copied the bundle (GoogleMaps.bundle) inside and built it using the module build-script (build.py). The packaged module does not seem to include the file and the module doesn't work. I'm sure I just have the wrong folder structure on module-side, but the users will definitely need at least a [updated guide](https://wiki.appcelerator.org/display/guides2/iOS+Module+Development+Guide) in order to update their modules properly. Module PR to pull and test: https://github.com/hansemannn/Ti.GoogleMaps/pull/13[~hansknoechel] The build.py is deprecated. There's a message at the top build.py output that told you to use the CLI.
Yes, but only for new modules. Existing module dev's will not get that message at all. Further notes: - If I don't have the
assets
directory, the build fails (build.py didn't). - All those discussions should into the guide before we merge - The update will force both module and app developers to use at least 5.2.1 Will test now. *EDIT*: Works fine!I would guess that you would keep the assets in two places for maximum compatibility? The only issue would be that you couldn't specifically use 5.2.0. * Old location for < 5.2.0 * New location for > 5.2.0
Part of the problem with the old build.py is it NEVER gets updated regardless of the SDK. So, that makes sense you didn't see the message. I'll fix the PR quick to not require an assets dir. Update: fixed!
PR merged.
So... we now need to create a.. TIDOC-2470 :) Do newly generated modules still have a
build.py
? Do Android modules also need to be build viati build
? And how about [Studio](http://docs.appcelerator.com/platform/latest/#!/guide/iOS_Module_Project-section-43288810_iOSModuleProject-BuildandPackagetheModule.1), is that already updated to useti build
instead of thebuild.py
script?[~fokkezb] Answered most of your questions on TIDOC-2470. We'll need someone from Studio to chime in.
Bit late to the party (was on holiday), but great idea to have a
Resources
folder. Also removes some tricks in themodule.xconfig
where I always forget the change the version number to the correct module version. Thanks!Verified fixed, using: MacOS 10.11.4 (15E65) Studio 4.5.0.201602170821 Ti SDK 5.2.1.v20160318225121 Appc NPM 4.2.4-2 Appc CLI 5.2.1-20 Alloy 1.8.1 Xcode 7.3 (7D175) Tested the new build process by building modules that did not need updating and contained a build.py. Verified commonJS modules, modules with multiple architectures, asset bundling, doc generation and the standard modules were able to build. Then updated several modules from the list in the ticket body and went through the same checklist after removing the build.py and verifying that the modules were working as expected with the new build process.