简体   繁体   English

将Sencha Cmd与现有应用程序一起使用

[英]Using Sencha Cmd with an existing app

I created a theme using the sencha cmd on a dummy app and now I want to use that theme on other applicattion. 我在虚拟应用程序上使用sencha cmd创建了一个主题,现在我想在其他应用程序中使用该主题。 I've copied the theme folder to my app's packages folder and it's working fine. 我已将主题文件夹复制到我的应用程序的包文件夹中,并且工作正常。

I made some changes so I tried to use "sencha package build" to compile the theme and got this error: 我做了一些更改,所以我尝试使用“sencha package build”来编译主题并得到了这个错误:

[ERR] null
at com.sencha.command.environment.PackageEnvironment.loadBaseConfigs(PackageEnvironment.java:64)
at com.sencha.command.environment.PackageEnvironment.<init>(PackageEnvironment.java:46)
at com.sencha.command.environment.BuildEnvironment.load(BuildEnvironment.java:166)
at com.sencha.command.Sencha.loadBuildEnvironment(Sencha.java:361)
at com.sencha.command.Sencha.<init>(Sencha.java:67)
at com.sencha.command.Sencha.<init>(Sencha.java:61)
at com.sencha.command.Sencha.main(Sencha.java:106

I thought the error was related to the theme but I also get this if I try to execute a sencha command from my app folder: 我认为错误与主题有关但如果我尝试从我的app文件夹执行sencha命令,我也会得到这个:

[ERR] Command must be run from an application folder

Obviously it's some kind of misconfiguration but I have no idea how to solve it. 显然这是一种错误的配置,但我不知道如何解决它。 Any suggestions? 有什么建议么?

Edit: I've generated a new app with sencha cmd and copied the code from the old app to the new one. 编辑:我使用sencha cmd生成了一个新应用,并将旧应用中的代码复制到新应用中。 Now it's not building: 现在它没有建立:

BUILD FAILED
[ERR] com.sencha.exceptions.ExBuild: com.sencha.exceptions.ExParse: Failed parsing path/ext-all-rtl-sandbox-debug-w-comments.js
[ERR]   at
[ERR]  org.mozilla.javascript.ast.FunctionNode.visit(FunctionNode.java:421)

Is there a way to compile the theme without using the cmd on ExtJs 4.2? 有没有办法在不使用ExtJs 4.2上的cmd的情况下编译主题?

Actually, the issue with this error is that when you unzip the library, make sure you don't play around with the directory structure and/or content. 实际上,此错误的问题在于,当您解压缩库时,请确保不要使用目录结构和/或内容。

Basically in the sencha.cfg file, you will find the following entries 基本上在sencha.cfg文件中,您将找到以下条目

app.framework.version=4.2.1.883 app.cmd.version=3.1.2.342 app.framework.version = 4.2.1.883 app.cmd.version = 3.1.2.342

Initially, my extjs library was under extjs421, which was the root of the library as I hate to have a directory within a directory and no other content. 最初,我的extjs库在extjs421下,这是库的根,因为我讨厌在目录中有一个目录而没有其他内容。

I was able to generate the app, but, couldn't do a build. 我能够生成应用程序,但是,无法进行构建。

So, I took my zip file and unzipped it, but left it intact, no renaming and/or content shuffling. 所以,我把我的zip文件解压缩,但保留原样,没有重命名和/或内容改组。

sencha --sdk ext-4.2.1-ent/ext-4.2.1.883 generate app Blah myBlah I modified the sencha.cfg file to have the neptune theme I did sencha app build sencha --sdk ext-4.2.1-ent / ext-4.2.1.883生成app Blah myBlah我修改了sencha.cfg文件以获得海王星主题我做了sencha app build

worked like a charm, no errors 工作就像一个魅力,没有错误

Cheers! 干杯!

The structure of these applications is the same? 这些应用程序的结构是一样的吗? Ext versions? Ext版本? Look at sehcha.cfg file (yourAppFolder/.sencha/app/sencha.cfg). 查看sehcha.cfg文件(yourAppFolder / .sencha / app / sencha.cfg)。 Changes may be needed. 可能需要进行更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM