Steps to reproduce:
1. Create a default app with hyperloop enabled using SDK 6.0.0. (App will get created with hyperloop module 2.0.0).
2. Now, change the SDK to 5.5.0 in the tiapp.xml, the hyperloop module to 1.2.6 & aca to 1.0.0.
3. Make sure you have references for hyperloop in the app.js e.g
var View = require('android.view.View');
4. Build the app for android device/emulator.
Actual Result:
1. The app fails to build with error:
[ERROR] : You cannot use the Hyperloop compiler with a version of Titanium older than 6.0.0
[ERROR] : Set the value of <sdk-version> to a newer version in tiapp.xml.
[ERROR] : For example:
[ERROR] : <sdk-version>6.0.0.GA</sdk-version>
2. My modules in tiapp.xml:
<module platform="iphone" version="1.0">com.soasta.touchtest</module>
<module platform="android" version="1.0">com.soasta.touchtest</module>
<module platform="iphone" version="2.0.0">hyperloop</module>
<module platform="android" version="1.2.6">hyperloop</module>
<module platform="iphone">com.appcelerator.aca</module>
<module platform="android" version="1.0.0">com.appcelerator.aca</module>
<module platform="commonjs">ti.cloud</module>
Expected Results:
1. The app should build fine with 5.5.0 SDK & hyperloop 1.2.6, even if the app is created using SDK 6.0.0.
ya this is a problem because the hyperloop module contains both a plugin and a module. For every new version of hyperloop module installed, the new plugin always overwrite the previous one. [~fmiao] I like to ask, I have seen for plugins like soasta, it actually maintains versions in the plugins folder. I wonder if this is applicable to the hyperloop module whereby we maintain multiple versions of the plugin as well, and use the appropriate one for every corresponding version? If this is doable, we should get this into 5.5.0.GA, hyperloop 1.2.7.
[~cng] If we can bundle hyperloop plugin like this in the zip:
plugins/hyperloop/<version>/
, that should prevent the plugin being overwritten when CLI extracts it.[~fmiao] Then it's probably a good idea to implement this asap while we have only released 1 version of hyperloop then. Do you think you can implement this please?
[~cng], I was under the impressing that this is going to be handled when you are creating the zip file that contains both hyperloop module and plugin.
Here is what I came up with so far. Add the following lines before
echo "Creating combined zip with iOS and Android"
:It basically creates a new directory "1.2.7", copied everything except itself into it and removes the old files from the old location afterwards. It works when used in the terminal, but using it in the shell-script and with the
$VERSION
variable does not seem to work. If we can figure that out, it shouldn't make any problems. [~fmiao] Can you confirm that havingplugins/hyperloop/<version>/
will be detected by the CLI properly?[~hans123], I'm not sure how will the hyperloop plugin be called during project build, as far as I'm aware, putting the plugin in a version directory will work for appc cli.
PR here: https://github.com/appcelerator/hyperloop.next/pull/70 One big issue with this is that it will only work if you do
<plugin version="1.2.7">hyperloop<plugin>
If you don't set a version, CLI will use "latest". But the problem is, CLI thinks that the content in the root folder (formally 1.2.6 since it didn't do this versioning stuff), it uses that instead. [~fmiao] Any idea what we can do about CLI's priority in finding the latest version? Let me know if it's something we can change on the CLI side, then I'll set the min sdk requirement on this 1.2.7 module to 5.5.0.compiled binary for testing here: https://github.com/appcelerator/hyperloop.next/releases/tag/1.2.7-beta.2 Plus I'm having difficulty building hyperloop 2.0.0 fr Ti SDK 6.0.0 (due to android) but not urgent at this moment. will look into it later tomorrow.
[~cng], [~fmiao] Can we ensure that all new versions of Hyperloop will automatically get the version-tag in the tiapp.xml when installing Hyperloop?
Ok something strange happening here. I had it working earlier today but it's no longer working now. I have been testing with hyperloop-examples and I had tiapp.xml
<plugin version="1.2.7">hyperloop</plugin>
if you look at the trace:That is correct but further down the trace:
it should be running
/Users/kiat/Library/Application Support/Titanium/plugins/hyperloop/1.2.7/node_modules/hyperloop-metabase/bin/metabase
instead of/Users/kiat/Library/Application Support/Titanium/plugins/hyperloop/node_modules/hyperloop-metabase/bin/metabase
Not sure what went wrong. *Important thing to note*: This is tested with 1.2.6 installed prior. That means, there's already 1.2.6 plugin in the root folder (without a version folder). So this will happen to people who installed 1.2.6 before installing 1.2.7.https://github.com/appcelerator/node-appc/blob/master/lib/tiplugin.js#L278-L290, looks like if there are plugin files in the root folder, plugin in detection will not loop through the versions. I think we should also re-package hyperloop@1.2.6 tarballs to include the version folder, and also put a note to inform developers that they should remove the hyperloop plugins folder so the next time hyperloop module installation kicks in, the plugin will be in the version folder.
Master PR here for hyperloop versioning: https://github.com/appcelerator/hyperloop.next/pull/71 [~jvennemann]
Changes to the build script approved and merged for both 1.2.x and master branch.
TiSDK master PR: https://github.com/appcelerator/titanium_mobile/pull/8327 TiSDK 6_0_X PR: https://github.com/appcelerator/titanium_mobile/pull/8328 TiSDK 5_5_X PR: https://github.com/appcelerator/titanium_mobile/pull/8329
How to test for 5.5.0
Use the latest environment on preproduction for 5_5_X, and test the following scenarios whereby someone previously on 5.4.0.GA just updated to 5.5.0. - *Create a brand new app after upgrade*appc new --classic
appc run -p ios -I 10.0
App should build and run normally. Also to check in
- *Changing the sdk in tiapp.xml and running a pre-existing hyperloop-enabled app*Library/Application Support/Titanium/plugins/hyperloop
if there's both1.2.6
and1.2.7
folders, with no other files in the root.Using hyperloop-examples, in tiapp.xml, change the sdk-version to the version that contains this fix, and make sure that plugin and module of hyperloop has no specific version number assigned.
appc run -p ios -I 10.0
App should build and run normally. Also to check in
Library/Application Support/Titanium/plugins/hyperloop
if there's both1.2.6
and1.2.7
folders, with no other files in the root.Something to note for multiple Xcode installations and Hyperloop
If you have multiple Xcode installations, and you use the-I
flag in appc cli, make sure that the Active Xcode is consistent with that flag. -sudo xcode-select --switch /Applications/Xcode8.app
andappc run -p ios -I 10.0
-sudo xcode-select --switch /Applications/Xcode731.app
andappc run -p ios -I 9.3
will work well with Hyperloop. And if you switch between Xcodes, make sure to clean the project.CR and FT passed. PRs merged. However, to test this properly, this new ticket has to be addressed: CLI-1101
Verified the fix. We get version folders for both hyperloop plugin & module. FYI, when you have an app created with 6.0.0 SDK with hyperloop enabled & want to build it with 5.5.0.GA SDK with 1.2.7 hyperloop module you got to manually select the 1.2.7 plugin in the tiapp.xml.
Closing. Environment: Appc Studio : 4.8.0.201609061702 Ti SDK : 6.0.0.v20160913184210 , 5.5.0.GA Ti CLI : 5.0.9 Alloy : 1.9.1 MAC El Capitan : 10.11.6 Appc NPM : 4.2.8-6 Appc CLI : 6.0.0-38 Node: 4.4.4 Nexus 6 - Android 6.0.1