Hyperloop正在重写源JS,然后失败后续的清理构建

时间:2016-02-26 23:01:17

标签: appcelerator appcelerator-hyperloop

我刚刚更新到最新的5.2.0.GA,我正在尝试一个简单的Hyperloop测试应用程序。

构建应用程序会导致重写源JavaScript中对超级循环代码的引用。然后由于Skipping Hyperloop compile, no usage found ...错误导致下一次重建失败,因为JS代码被重写......

参考OpsWorks CLIhere

环境:


    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 

  1. 创建新的Classic Single Window Application移动应用程序项目。测试构建。
  2. 将超级循环要求添加到tiapp.xml
  3. 
        <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>
    
    
    1. 根据“here”PDF中的示例代码,我尝试添加一个简单的红色UIView。 (在/Resources/ui/common/FirstView.js中)
    2. 
          //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;
      
      
      1. 在终端中,运行:appc ti build -p ios -f
      2. 该应用程序启动。左上角有一个小红色视图。

        一切都好。

        但是当我回顾源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文件夹。

0 个答案:

没有答案