PDA

View Full Version : Failed to find file for Ext.ux.auth.controller.Sessions



$p00ky
26 Oct 2012, 10:54 PM
Sencha Cmd 3.0.0.230
Sencha Touch 2.1.0rc2

Right after generating an app, move to that app folder and type "sencha compile concatenate"
==> [ERROR] Failed to find file for Ext.ux.auth.controller.Sessions

Complete error:


>sencha compile concatenate -o test
Sencha Cmd v3.0.0.230
[INFO ] Processing classPath entry : C:\Users\...\SenchaCmd\sencha-compile-temp-dir
[INFO ] Processing classPath entry : C:\Users\...\SenchaCmd\touch\src
[INFO ] Processing classPath entry : C:\Users\...\SenchaCmd\app.js
[INFO ] Processing classPath entry : C:\Users\...\SenchaCmd\app
[INFO ] Processing class inheritance graph
[INFO ] Processing instantiation refereces to classes and aliases
[INFO ] Processing source dependencies
[ERROR] Failed to find file for Ext.ux.auth.controller.Sessions
required by C:\Users\...\SenchaCmd\touch\src\ux\auth2\Auth.js
[ERROR] Failed to find any files for Ext.ux.auth.controller.Sessions

themightychris
27 Oct 2012, 9:25 AM
Ext.ux isn't your namespace, the framework comes with classes already in Ext.ux and it has a specific place to find them within the SDK and you're custom files aren't in there. You want to avoid changing anything inside the SDK file tree as it will get wiped out every time you update the framework along with other headaches like this.

Put your custom classes under your application's namespace+folder or create a new namespace and add its folder to classPath in .sencha/app/sencha.cfg

I believe your app is called "SenchaCmd" so you should define your controller as SenchaCmd.controller.auth.Sessions and put in in SenchaCmd/app/controller/auth/Sessions.js

$p00ky
27 Oct 2012, 2:08 PM
That's the problem, I did not make any custom modification to the SDK file tree.
That's based on the self-generated code from sencha cmd (I am just testing it before moving to it).

Steps to reproduce (on a computer with no Sencha applications/frameworks):
- Download and extract Sencha Touch 2.1.0rc2
- Download and install Sencha Cmd 3.0.0.230
- Navigate to the Sencha Touch 2.1.0rc2 SDK and generate an application ("sencha generate app -p my/path")
- Navigate to the generated application and run "sencha compile concatenate" <= The error is raised

Full log from scratch:



C:\>cd sencha-touch-2.1.0-rc2


C:\sencha-touch-2.1.0-rc2>sencha generate app Test ./Test
Sencha Cmd v3.0.0.230
[INFO ]
[INFO ] init-properties:
[INFO ]
[INFO ]
[INFO ] init-sencha-command:
[INFO ]
[INFO ]
[INFO ] init:
[INFO ]
[INFO ]
[INFO ] -before-generate-workspace:
[INFO ]
[INFO ]
[INFO ] generate-workspace-impl:
[INFO ]
[INFO ]
[INFO ] -before-copy-framework-to-workspace:
[INFO ]
[INFO ]
[INFO ] copy-framework-to-workspace-impl:
[INFO ]
[INFO ] [copy] Copying 1105 files to C:\sencha-touch-2.1.0-rc2\Test\touch
[INFO ]
[INFO ] [copy] Copied 171 empty directories to 1 empty directory under C:\sencha-touch-2.1.0-rc2\Test\touch
[INFO ]
[INFO ] [copy] Copying 1 file to C:\sencha-touch-2.1.0-rc2\Test\touch
[INFO ]
[INFO ] [copy] Copying 1 file to C:\sencha-touch-2.1.0-rc2\Test\touch
[INFO ]
[INFO ] [propertyfile] Updating property file: C:\sencha-touch-2.1.0-rc2\Test\.sencha\workspace\sencha.cfg
[INFO ]
[INFO ]
[INFO ] -after-copy-framework-to-workspace:
[INFO ]
[INFO ]
[INFO ] copy-framework-to-workspace:
[INFO ]
[INFO ]
[INFO ] -after-generate-workspace:
[INFO ]
[INFO ]
[INFO ] generate-workspace:
[INFO ]
[INFO ]
[INFO ] init-properties:
[INFO ]
[INFO ]
[INFO ] init-sencha-command:
[INFO ]
[INFO ]
[INFO ] init:
[INFO ]
[INFO ]
[INFO ] -before-generate-app:
[INFO ]
[INFO ]
[INFO ] generate-app-impl:
[INFO ]
[INFO ] [mkdir] Created dir: C:\sencha-touch-2.1.0-rc2\Test\app\model
[INFO ]
[INFO ] [mkdir] Created dir: C:\sencha-touch-2.1.0-rc2\Test\app\controller
[INFO ]
[INFO ] [mkdir] Created dir: C:\sencha-touch-2.1.0-rc2\Test\app\store
[INFO ]
[INFO ] [mkdir] Created dir: C:\sencha-touch-2.1.0-rc2\Test\app\profile
[INFO ]
[INFO ] Generating new packager.json file using native packager
[INFO ]
[INFO ] copy-sdk:
[INFO ]
[INFO ] [copy] Copying 1 file to C:\sencha-touch-2.1.0-rc2\Test\resources\css
[INFO ]
[INFO ]
[INFO ] -after-generate-app:
[INFO ]
[INFO ]
[INFO ] generate-app:
[INFO ]




C:\sencha-touch-2.1.0-rc2>cd Test


C:\sencha-touch-2.1.0-rc2\Test>sencha compile concatenate
Sencha Cmd v3.0.0.230
[ERROR] sencha.compile.concatenate requires these parameters: output-file


C:\sencha-touch-2.1.0-rc2\Test>sencha compile concatenate -o test
Sencha Cmd v3.0.0.230
[INFO ] Processing classPath entry : C:\sencha-touch-2.1.0-rc2\Test\sencha-compile-temp-dir
[INFO ] Processing classPath entry : C:\sencha-touch-2.1.0-rc2\Test\touch\src
[INFO ] Processing classPath entry : C:\sencha-touch-2.1.0-rc2\Test\app.js
[INFO ] Processing classPath entry : C:\sencha-touch-2.1.0-rc2\Test\app
[INFO ] Processing class inheritance graph
[INFO ] Processing instantiation refereces to classes and aliases
[INFO ] Processing source dependencies
[ERROR] Failed to find file for Ext.ux.auth.controller.Sessions
required by C:\sencha-touch-2.1.0-rc2\Test\touch\src\ux\auth2\Auth.js
[ERROR] Failed to find any files for Ext.ux.auth.controller.Sessions


C:\sencha-touch-2.1.0-rc2\Test>


Running in the web browser works.

Maybe I'm not calling the right command.
My goal is just to compress the file like in ExtJS 4 so I have only one "app-all.js" that includes all the dependencies so I do not need the full framework and it's much faster to load.
Something similar to the old create JSB3 then create app-all.js from that file.

How can I achieve that?

Auto-Reply: Actually, "sencha app build" which is now working after installing compass seems to do what I was looking for.
The "compile" tools are just independent tools used during the build process?

dongryphon
28 Oct 2012, 5:10 PM
Actually, "sencha app build" which is now working after installing compass seems to do what I was looking for.

Right, "sencha app build" is the way to build a generated app. You can use the low-level commands like "sencha compile" but there are many steps to producing an app, especially a Sencha Touch app beyond just that.

Good to hear you have compass working. Just in case you (or someone else reading this) needs to disable compass, you can set the "skip.sass" property for your app in .sencha/app/sencha.cfg, for the whole workspace in .sencha/workspace/sencha.cfg or locally (for you only) in ./local.properties (this file won't exist by default). Whichever file is appropriate, add this line:



skip.sass=1


The "local.properties" file is intended to be ignored by source control and kept locally only.

Obviously disabling compass can help speed up your builds but can give you stale results if something in the SASS changes.


The "compile" tools are just independent tools used during the build process?

Yes, the compile command is a rather low-level command. We use it internally for building apps to keep things simple and stay at a pretty high-level. There are other situations, however, where you might need to take more direct control over the compile step. There are some guides on some of these here:

http://docs.sencha.com/ext-js/4-1/#!/guide/command_app
http://docs.sencha.com/ext-js/4-1/#!/guide/command_app_single
http://docs.sencha.com/ext-js/4-1/#!/guide/command_app_multi

And the compiler reference:

http://docs.sencha.com/ext-js/4-1/#!/guide/command_compiler

$p00ky
29 Oct 2012, 4:23 AM
OK, thanks for your detailed explanation.
I don't really mind having it enabled.

Just a quick recommendation then: include compass along with Sencha Cmd so we don't have to install a full Ruby/Gem environment if we don't need.

tangix
30 Oct 2012, 7:53 AM
A big THANK YOU for "skip.sass=1"!!! - I have been trying for an hour to get compass running in my Debian build-server and probably nuked most of ruby in the process. While compass may be a wonderful tool (I don't know and haven't got a clue about SASS) it sure is a pain to get installed and even after I *think* I got everything right, still "sencha app build production" did not work on a completely new project:

[INFO ] [shellscript] /home/msa/.rvm/bin/compass: line 6: /home/msa/.rvm/bin/compass: Argument list too long
[INFO ] [shellscript] /home/msa/.rvm/bin/compass: line 6: /home/msa/.rvm/bin/compass: Success


/Mattias

$p00ky
30 Oct 2012, 12:57 PM
sudo apt-get install ruby-compass

tangix
30 Oct 2012, 10:00 PM
You must have added some other sources than I have:

root@debian-android:/home/msa# apt-get install ruby-compass
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package ruby-compass
I have a stock installation Debian 6.0.5 from the netinst ISO.

nefis
21 Jan 2013, 5:24 PM
Hello,

now Sencha Cmd states that build command obsolete and recommend to switch to compile. But when I try to compile a freshly generated app, it outputs error from the first post in the thread. How could I address this?
I have Sencha Cmd v3.0.0.250 and Sencha Touch 2.1.0.

Sergey

dongryphon
21 Jan 2013, 8:52 PM
Hello,

now Sencha Cmd states that build command obsolete and recommend to switch to compile. But when I try to compile a freshly generated app, it outputs error from the first post in the thread. How could I address this?
I have Sencha Cmd v3.0.0.250 and Sencha Touch 2.1.0.

Sergey

First off, please post the exact command you are running and the error message(s) you get. I suspect the choice of commands is the issue you are running in to.

Secondly, I would recommend upgrading to the current patch release (3.0.2) (http://www.sencha.com/forum/showthread.php?252466-Sencha-Cmd-v3.0.2-is-Now-Available) but that won't effect this issue. In a nutshell, with a generated app, when you run "sencha app build" there are some files excluded from the Sencha Touch framework. I believe this is one of a small number in the "ignores" set. If you are running a direct "sencha compile" command then this ignored set will not be used - you would need to add that to the "sencha compile" command line... that said, I don't think you want to run "sencha compile" for a generated app - "sencha app build" is the high-level build process that covers compilation and more.

dongryphon
21 Jan 2013, 8:59 PM
Hello,

now Sencha Cmd states that build command obsolete and recommend to switch to compile.


Sorry for the second reply, but just noticed a piece of your question I wanted to clarify (above).

The "sencha build" command is a low-level command that is equivalent in scope to "sencha compile". So if you have a build process based on JSB files and the like, "sencha compile" is the logical upgrade to that.

On the other hand, if you had used the SDK Tools v2 "sencha app build" process previously, then this is the same in Cmd - except that internally Cmd uses the compiler vs the old JSB process. This is the best option in many cases because "sencha app build" automates so many more pieces of the build process.

But if you had not been using that in previous versions, the upgrade from "SDK Tools and JSB files" to "Cmd and app build" is a bit of apples-and-oranges as it were. I believe you will be better off basing higher-level builds on "sencha app build" but it is a bit different than the low-level approach.

interfasys
26 Jan 2013, 10:06 AM
I just ran into the same issue...

The only reason I got interested in compile instead of build is so that I could:
- Choose the compressor
- Only generate the JS (not the HTML, assets, etc.)

Are there config switches for build that would do that?
Wouldn't it be easier for Sencha to publish the exact compile command used to build a project?

dongryphon
26 Jan 2013, 1:33 PM
There are options in the build script you can set to control this - more so in an Ext JS app than Touch at the current time, but we are working to regularize that. I encourage you to read the build script to see what is going on - it is found in .sencha/app/build-impl.xml. I would not recommend changing that file as it is replaced when you upgrade Cmd, but that should give you the details you are wanting. In a pinch, of course, you can edit the file if needed but just be aware of this or you may lose your edits on upgrade.

The "sencha app build" command simply loads the generated build,xml (which imports .sencha/app/build-impl.xml) and invokes the "build" target. This target comes from the build-impl and consists of many stages to handle JS compilation, SASS building and resource copying. Each of these stages can be "hooked" by providing "-before-" or "-after-" targets in your build.xml.

This is only going to gain more features as we ship Cmd 3.1 with vastly improved theme support, so the ideal division of labor is to leverage "sencha app build" or the build.xml directly and look at the tuning properties we provide. If we have missed some, let us know.

Having said all the above, there are advanced use cases that require more direct interaction with the compile command. This can be addressed by augmenting or editing the build scripts or by learning what they do and making your own. According to the "one size never fits all" rule, we also need to document this low level support provided by Cmd. Sadly, all that documentation can just be misleading for folks that would be content on the simple path.

interfasys
27 Jan 2013, 3:24 AM
For 3.1, I'll definitely want more granularity with steps like these

js, generates app.js
html, generates both the JS and html
sass
theme
assets, could take care of all the non-js things?
available from the command line, so that we can script some common operations:
"sencha app build testing js" to build app.js
"sencha app build package sass" to compile the finalized css for our app
etc.

Compression could be available per classpath, defined in sencha.cfg
And I agree, documentation is key. Took me a while to figure out what to put in a command file as the syntax differs from what you would type on the command line.

Regarding build-impl.xml, I'm guessing that we can only play with the properties found in the "-page" target, which means that things like compression are not available. Correct?