我刚刚更新到最新的5.2.0.GA,我正在尝试一个简单的Hyperloop测试应用程序。
构建应用程序会导致重写源JavaScript中对超级循环代码的引用。然后由于Skipping Hyperloop compile, no usage found ...
错误导致下一次重建失败,因为JS代码被重写......
环境:
OS X : 10.10.5 node -v : v0.12.7 Studio : 4.5.0.201602170821 TiSDK : 5.2.0.GA ti -v : 5.0.6 appc -v : 5.2.0 hyperloop: 1.1.0
<plugins> <plugin>hyperloop</plugin> </plugins> <modules> <module>hyperloop</module> </modules>
和
<ios> <run-on-main-thread>true</run-on-main-thread> <use-jscore-framework>true</use-jscore-framework> </ios>
//FirstView Component Constructor function FirstView() { //create object instance, a parasitic subclass of Observable var self = Ti.UI.createView(); //label using localization-ready strings from /i18n/en/strings.xml var label = Ti.UI.createLabel({ color:'#000000', text:String.format(L('welcome'),'Titanium'), height:'auto', width:'auto' }); self.add(label); //Add behavior for UI label.addEventListener('click', function(e) { alert(e.source.text); }); // Test native view var UIView = require('UIKit/UIView'), UIColor = require('UIKit/UIColor'), CGRectMake = require('CoreGraphics').CGRectMake; var view = UIView.alloc().initWithFrame(CGRectMake(0,0,100,100)); view.backgroundColor = UIColor.redColor(); self.add(view); return self; } module.exports = FirstView;
appc ti build -p ios -f
该应用程序启动。左上角有一个小红色视图。
一切都好。
但是当我回顾源JavaScript FirstView.js时,对原生UIView,UIColor和CGRectMake的引用已被编辑。 (我还注意到构建过程在Resources文件夹中创建了hyperloop
文件夹,其中包含了新编辑引用的位置:
var UIView = require('hyperloop/uikit/uiview'), UIColor = require('hyperloop/uikit/uicolor'), CGRectMake = require('hyperloop/coregraphics/coregraphics').CGRectMake;
NOW 在尝试使用时再次构建应用时
appc ti build -p ios -f
- 在Hyperloop程序集期间,构建失败并显示此错误:
... [INFO] Starting Hyperloop assembly [INFO] Skipping Hyperloop compile, no usage found ... An uncaught exception was thrown! callback is not defined callback is not defined
有人有什么想法吗?我知道这是测试版,但我错过了一面旗帜吗?
BONUS BUG :-f
强制清除构建标志似乎没有清除build/hyperloop
文件夹。