PDA

View Full Version : Sencha Cmd v3 - comments so far



westy
12 Dec 2012, 3:38 AM
Trying to setup a new application using sencha cmd.

I must say, this doesn't feel like a great solution when you have multiple products, clients, and need to control where stuff goes.

e.g.
It seems you cannot use dots in application names when generating an app, e.g. sencha -sdk ..\..\..\..\Ext\4.1.3\ generate app Clients.CompanyName.ProductName .


C:\Altus\repos\Clients\CompanyName\ProductName\web>sencha -sdk ..\..\..\..\Ext\4.1.3\ generate app Clients.CompanyName.ProductName .


Sencha Cmd v3.0.0.250
[INF] init-properties:
[INF] init-sencha-command:
[INF] init:
[INF] -before-generate-workspace:
[INF] generate-workspace-impl:
[WRN] Ignoring @require ../version/Version.js in js/String.js
[WRN] Ignoring @require ../Ext-more.js in js/Format.js
[INF] -before-copy-framework-to-workspace:
[INF] copy-framework-to-workspace-impl:
[INF] [copy] Copying 3023 files to C:\Altus\repos\Clients\CompanyName\ProductName\web\ext
[INF] [copy] Copying 86 files to C:\Altus\repos\Clients\CompanyName\ProductName\web\ext\src\ux
[INF] [propertyfile] Updating property file: C:\Altus\repos\Clients\CompanyName\ProductName\web\.sencha\workspace\sencha.cfg
[INF] -after-copy-framework-to-workspace:
[INF] copy-framework-to-workspace:
[INF] -after-generate-workspace:
[INF] generate-workspace:
[INF] init-properties:
[INF] init-sencha-command:
[INF] init:
[INF] -before-generate-app:
[INF] generate-app-impl:
[INF] update-app:
[INF] update-app:
[INF] [mkdir] Created dir: C:\Altus\repos\Clients\CompanyName\ProductName\web\app\model
[INF] [mkdir] Created dir: C:\Altus\repos\Clients\CompanyName\ProductName\web\app\store
[INF] init-properties:
[INF] init-sencha-command:
[INF] init:
[INF] -before-app-refresh:
[INF] app-refresh-impl:
[INF] Processing classPath entry : C:\Altus\repos\Clients\CompanyName\ProductName\web\sencha-compile-temp-dir
[INF] Processing classPath entry : C:\Altus\repos\Clients\CompanyName\ProductName\web\ext\src
[INF] Processing classPath entry : C:\Altus\repos\Clients\CompanyName\ProductName\web\app
[INF] Processing class inheritance graph
[INF] Processing instantiation refereces to classes and aliases
[INF] Processing source dependencies
[ERR] BUILD FAILED
[ERR] com.sencha.exceptions.ExBuild: java.lang.IllegalArgumentException: 0 > -1
[ERR] at com.sencha.tools.compiler.builder.MetaDataGenerator.doConcat(MetaDataGenerator.java:67)
[ERR] at com.sencha.command.compile.CompileCommands$MetadataCommand.execute(CompileCommands.java:794)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[ERR] at java.lang.reflect.Method.invoke(Unknown Source)
[ERR] at com.sencha.cli.Command.dispatch(Command.java:78)
[ERR] at com.sencha.cli.Commands.dispatch(Commands.java:49)
[ERR] at com.sencha.cli.Commands.dispatch(Commands.java:49)
[ERR] at com.sencha.cli.AbstractCommand.dispatch(AbstractCommand.java:182)
[ERR] at com.sencha.ant.SenchaCommandTask.doExecute(SenchaCommandTask.java:58)
[ERR] at com.sencha.ant.BaseAntTask.execute(BaseAntTask.java:22)
[ERR] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[ERR] at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[ERR] at java.lang.reflect.Method.invoke(Unknown Source)
[ERR] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[ERR] at org.apache.tools.ant.Task.perform(Task.java:348)
[ERR] at org.apache.tools.ant.Target.execute(Target.java:392)
[ERR] at org.apache.tools.ant.Target.performTasks(Target.java:413)
[ERR] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
[ERR] at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
[ERR] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[ERR] at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
[ERR] at com.sencha.ant.AntRunner.run(AntRunner.java:156)
[ERR] at com.sencha.ant.AntRunner.run(AntRunner.java:72)
[ERR] at com.sencha.command.BasePluginCommands$BasePluginCommand.run(BasePluginCommands.java:87)
[ERR] at com.sencha.command.BasePluginCommands$BasePluginCommand.run(BasePluginCommands.java:91)
[ERR] at com.sencha.command.BasePluginCommands$BaseNamePathCommand.run(BasePluginCommands.java:135)
[ERR] at com.sencha.command.app.AppCommands$RefreshCommand.execute(AppCommands.java:258)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[ERR] at java.lang.reflect.Method.invoke(Unknown Source)
[ERR] at com.sencha.cli.Command.dispatch(Command.java:78)
[ERR] at com.sencha.cli.Commands.dispatch(Commands.java:49)
[ERR] at com.sencha.cli.Commands.dispatch(Commands.java:49)
[ERR] at com.sencha.cli.AbstractCommand.dispatch(AbstractCommand.java:182)
[ERR] at com.sencha.ant.SenchaCommandTask.doExecute(SenchaCommandTask.java:58)
[ERR] at com.sencha.ant.BaseAntTask.execute(BaseAntTask.java:22)
[ERR] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[ERR] at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[ERR] at java.lang.reflect.Method.invoke(Unknown Source)
[ERR] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[ERR] at org.apache.tools.ant.Task.perform(Task.java:348)
[ERR] at org.apache.tools.ant.Target.execute(Target.java:392)
[ERR] at org.apache.tools.ant.Target.performTasks(Target.java:413)
[ERR] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
[ERR] at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
[ERR] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[ERR] at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
[ERR] at com.sencha.ant.AntRunner.run(AntRunner.java:156)
[ERR] at com.sencha.ant.AntRunner.run(AntRunner.java:72)
[ERR] at com.sencha.command.BasePluginCommands$BasePluginCommand.run(BasePluginCommands.java:87)
[ERR] at com.sencha.command.BasePluginCommands$BasePluginCommand.run(BasePluginCommands.java:91)
[ERR] at com.sencha.command.BasePluginCommands$BaseNamePathCommand.run(BasePluginCommands.java:135)
[ERR] at com.sencha.command.generator.GeneratorCommands$AppCommand.execute(GeneratorCommands.java:230)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[ERR] at java.lang.reflect.Method.invoke(Unknown Source)
[ERR] at com.sencha.cli.Command.dispatch(Command.java:78)
[ERR] at com.sencha.cli.Commands.dispatch(Commands.java:49)
[ERR] at com.sencha.cli.Commands.dispatch(Commands.java:49)
[ERR] at com.sencha.command.Sencha.main(Sencha.java:71)
[ERR] Caused by: java.lang.IllegalArgumentException: 0 > -1
[ERR] at java.util.Arrays.copyOfRange(Unknown Source)
[ERR] at java.util.Arrays.copyOfRange(Unknown Source)
[ERR] at com.sencha.tools.compiler.builder.LoaderPathsMetaDataGenerator.processPathMapping(LoaderPathsMetaDataGenerator.java:154)
[ERR] at com.sencha.tools.compiler.builder.LoaderPathsMetaDataGenerator.getData(LoaderPathsMetaDataGenerator.java:81)
[ERR] at com.sencha.tools.compiler.builder.MetaDataGenerator.doConcat(MetaDataGenerator.java:63)
[ERR] ... 65 more
[ERR] Total time: 3 seconds
[ERR] BUILD FAILED
[ERR] com.sencha.exceptions.BasicException: com.sencha.exceptions.ExBuild: java.lang.IllegalArgumentException:
0 > -1
[ERR] at com.sencha.exceptions.BasicException.wrap(BasicException.java:43)
[ERR] at com.sencha.cli.Command.dispatch(Command.java:104)
[ERR] at com.sencha.cli.Commands.dispatch(Commands.java:49)
[ERR] at com.sencha.cli.Commands.dispatch(Commands.java:49)
[ERR] at com.sencha.cli.AbstractCommand.dispatch(AbstractCommand.java:182)
[ERR] at com.sencha.ant.SenchaCommandTask.doExecute(SenchaCommandTask.java:58)
[ERR] at com.sencha.ant.BaseAntTask.execute(BaseAntTask.java:22)
[ERR] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[ERR] at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[ERR] at java.lang.reflect.Method.invoke(Unknown Source)
[ERR] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[ERR] at org.apache.tools.ant.Task.perform(Task.java:348)
[ERR] at org.apache.tools.ant.Target.execute(Target.java:392)
[ERR] at org.apache.tools.ant.Target.performTasks(Target.java:413)
[ERR] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
[ERR] at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
[ERR] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[ERR] at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
[ERR] at com.sencha.ant.AntRunner.run(AntRunner.java:156)
[ERR] at com.sencha.ant.AntRunner.run(AntRunner.java:72)
[ERR] at com.sencha.command.BasePluginCommands$BasePluginCommand.run(BasePluginCommands.java:87)
[ERR] at com.sencha.command.BasePluginCommands$BasePluginCommand.run(BasePluginCommands.java:91)
[ERR] at com.sencha.command.BasePluginCommands$BaseNamePathCommand.run(BasePluginCommands.java:135)
[ERR] at com.sencha.command.generator.GeneratorCommands$AppCommand.execute(GeneratorCommands.java:230)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[ERR] at java.lang.reflect.Method.invoke(Unknown Source)
[ERR] at com.sencha.cli.Command.dispatch(Command.java:78)
[ERR] at com.sencha.cli.Commands.dispatch(Commands.java:49)
[ERR] at com.sencha.cli.Commands.dispatch(Commands.java:49)
[ERR] at com.sencha.command.Sencha.main(Sencha.java:71)
[ERR] Caused by: C:\sencha\Sencha\Cmd\3.0.0.250\plugins\ext\current\plugin.xml:235: com.sencha.exceptions.ExBuild: java.lang.IllegalArgumentException: 0 > -1
[ERR] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:116)
[ERR] at org.apache.tools.ant.Task.perform(Task.java:348)
[ERR] at org.apache.tools.ant.Target.execute(Target.java:392)
[ERR] at org.apache.tools.ant.Target.performTasks(Target.java:413)
[ERR] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
[ERR] at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
[ERR] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[ERR] at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
[ERR] at com.sencha.ant.AntRunner.run(AntRunner.java:156)
[ERR] at com.sencha.ant.AntRunner.run(AntRunner.java:72)
[ERR] at com.sencha.command.BasePluginCommands$BasePluginCommand.run(BasePluginCommands.java:87)
[ERR] at com.sencha.command.BasePluginCommands$BasePluginCommand.run(BasePluginCommands.java:91)
[ERR] at com.sencha.command.BasePluginCommands$BaseNamePathCommand.run(BasePluginCommands.java:135)
[ERR] at com.sencha.command.app.AppCommands$RefreshCommand.execute(AppCommands.java:258)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[ERR] at java.lang.reflect.Method.invoke(Unknown Source)
[ERR] at com.sencha.cli.Command.dispatch(Command.java:78)
[ERR] ... 31 more
[ERR] Caused by: com.sencha.exceptions.ExBuild: java.lang.IllegalArgumentException: 0 > -1
[ERR] at com.sencha.tools.compiler.builder.MetaDataGenerator.doConcat(MetaDataGenerator.java:67)
[ERR] at com.sencha.command.compile.CompileCommands$MetadataCommand.execute(CompileCommands.java:794)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[ERR] at java.lang.reflect.Method.invoke(Unknown Source)
[ERR] at com.sencha.cli.Command.dispatch(Command.java:78)
[ERR] at com.sencha.cli.Commands.dispatch(Commands.java:49)
[ERR] at com.sencha.cli.Commands.dispatch(Commands.java:49)
[ERR] at com.sencha.cli.AbstractCommand.dispatch(AbstractCommand.java:182)
[ERR] at com.sencha.ant.SenchaCommandTask.doExecute(SenchaCommandTask.java:58)
[ERR] at com.sencha.ant.BaseAntTask.execute(BaseAntTask.java:22)
[ERR] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[ERR] at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[ERR] at java.lang.reflect.Method.invoke(Unknown Source)
[ERR] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[ERR] ... 49 more
[ERR] Caused by: java.lang.IllegalArgumentException: 0 > -1
[ERR] at java.util.Arrays.copyOfRange(Unknown Source)
[ERR] at java.util.Arrays.copyOfRange(Unknown Source)
[ERR] at com.sencha.tools.compiler.builder.LoaderPathsMetaDataGenerator.processPathMapping(LoaderPaths
MetaDataGenerator.java:154)
[ERR] at com.sencha.tools.compiler.builder.LoaderPathsMetaDataGenerator.getData(LoaderPathsMetaDataGen
erator.java:81)
[ERR] at com.sencha.tools.compiler.builder.MetaDataGenerator.doConcat(MetaDataGenerator.java:63)
[ERR] ... 65 more
[ERR] Total time: 4 seconds
[ERR] com.sencha.exceptions.BasicException: com.sencha.exceptions.ExBuild: java.lang.IllegalArgumentException:
0 > -1


Cannot seem to stop it copying the ext framework.
I want to be able to reference a common framework directory not have a copy for every application in source control!

The code spat out by the generation commands in very my-first-program style.
You should be able to configure or template it such that you can provide function headers, class comments, etc etc.



Sure will have more comments, but since you're forcing us down this route I'll have to make it work.
I'll try and get a shell up and running then hack it.

Cheers,
Westy

westy
12 Dec 2012, 3:40 AM
The workspace generation looks like it could be useful, but again, we're given no control.

Conceivably I could setup a workspace for all our products, or all of a clients products, and have some element of control...

westy
12 Dec 2012, 3:43 AM
Is "sencha app build" meant to spit out any progress or errors when it seemingly does nothing, even with debug enabled (at least I think it is, using sencha#debug=true in cfg)?


Edit:
The same could be said about many commands it would seem.
Currently got "sencha generate model User id:int,name" doing nothing, and writing nothing to stdout or stderr.
Suspect due to me trying to change app.framework to be a relative path, but still... an error would be nice!

westy
12 Dec 2012, 3:58 AM
Yeah, issues with parsing cfg file.

e.g.
"app.framework=ext #${app.dir}/../../../../Ext/4.1.3" causes it all to fall to bits, implying you need to trim comments then whitespace perhaps?

Note though, updating app.name to Clients.CompanyName.ProductName seems to have stuck for model generation. Hoping it works with the build, since we're unlikely to actually use the generation stuff.

westy
12 Dec 2012, 7:04 AM
In generated code, sometimes you seem to doublequote strings, other times you single quote.

westy
12 Dec 2012, 9:29 AM
Got a basic shell that references our common codebase building, so that's something.

One point that sounds like a bug to me is that any extends or requires that reference stuff in core/src/lang cannot be resolved, e.g. Ext.Error, Ext.Array.
Had to tweak our own Error class to get around this.

Another, the environment of testing is a little odd, wouldn't debug be more in keeping with Ext itself?


Will report back if run into other issues when adding more to the app.