2016-01-08 36 views
1

我試圖擴展第三方類。代碼是這樣的。注意我指定在哪裏加載openGL.viewExtJS的 - 煎茶應用構建依賴錯誤

Ext.Loader.setPath({ 
    'openGL.view': 'C:/Users/«username»/Documents/third-party/openGL/view/' 
}); 

Ext.define('myOpenGL.view.Qxga',{ 
    extend: 'openGL.view.Uxga', 
    alias: 'widget.qxga', 
    itemId: 'qxga', 
    requires: [ 
      'openGL.view.Uxga', 
      'myOpenGL.view.QxgaController' 
    ], 
    controller: 'QxgaController' 
}); 

當我建立它,我得到這樣的錯誤:

[ERR] Failed to resolve dependency openGL.view.Uxga for file myOpenGL.view.Qxga 
[ERR] 
[ERR] BUILD FAILED 
[ERR] com.sencha.exceptions.ExNotFound: Unknown definition for dependency : openGL.view.Uxga 
[ERR] 
[ERR] Total time: 6 seconds 
[ERR] The following error occurred while executing this line: 
C:\Users\«username»\Applications\Sencha\Cmd\5.1.0.26\plugins\ext\current\plugin.xml:403: The following error occurred while executing this line: 
C:\Users\«username»\Documents\workspace\openGL\.sencha\app\build-impl.xml:378: The following error occurred while executing this line: 
C:\Users\«username»\Documents\workspace\openGL\.sencha\app\init-impl.xml:303: com.sencha.exceptions.ExNotFound: Unknown definition for dependency : openGL.view.Uxga 

一些問題:

  • 爲什麼沒有發現openGL.view.Uxga
  • 我讀過有關修改build-impl.xml,但不同程度的成功。我需要做什麼,有沒有辦法做到這一點,而不必修改文件?說某種重寫或命令行參數?
  • 如果有一種方法可以做到這一點使用setPath,該third-party目錄可能不會在同一個地方。有沒有辦法包含Windows環境變量或類似的東西?

回答

1

Sencha Cmd不知道Ext.Loader.setPath調用,Cmd不執行JavaScript。相反,在你app.json您可以添加C:/Users/«username»/Documents/third-partyclasspath配置。 classpath是一個逗號分隔的(我認爲它甚至可以是一個數組,這些天)的路徑列表Cmd的將用來檢查文件中它搜索的Ext JS類(或通過像@require和某些註釋標記@類)。

"classpath": "app,C:/Users/«username»/Documents/third-party" 
+0

謝謝。 'myOpenGL'實際上是一個試圖擴展應用中使用的'openGL'的包。當它們應該與包相關時,它似乎正在輸出與應用相關的錯誤。我會重新提出一些更專注於不同問題的東西。 – Buddy