1. #1
    Sencha Premium Member
    Join Date
    Mar 2010
    Posts
    101
    Vote Rating
    -2
    predator has a little shameless behaviour in the past

      0  

    Default Hard to compile project, any help appreciated. Sending beers.

    Hard to compile project, any help appreciated. Sending beers.


    Hi all,

    Hopefully somebody can help me with this puzzle.

    $ uname -a
    Darwin MBP.local 12.2.1 Darwin Kernel Version 12.2.1: Thu Oct 18 16:32:48 PDT 2012; root:xnu-2050.20.9~2/RELEASE_X86_64 x86_64


    $ sencha
    Sencha Cmd v3.0.2.288

    ExtJS: 4.1.1.1

    Project structure:
    /application
    +views/interface.php

    /htdocs
    +app.js
    +app/
    +-modules/
    +-module1
    |+component1/MVCS
    |+component2/MVCS
    +-module2

    +libs/
    +-ext4/
    +-ext_ux/

    My application classes are defined like so: MYNS.modules.module1.component1.view.Component

    interface.php plays the role of index.hmtl in regular application, this is due to application being protected with authentication(regular html form) after successfull authentication the user is redirected to the interface view (codeigniter on the backend).

    Everything works fine in the browser, the loader picks all files and the application runs fine.

    Attempting to produce concatenated output dies pretty fast with unable to find file.

    Here is my loader configuration:
    Code:
    Ext.Loader.setConfig({
        enabled: true,
        paths: {
            'Ext': '/libs/ext4/src',
            'Ext.ux': '/libs/ext4_ux'
        }
    });
    This is the CMD output:
    [ERR] Failed to resolve dependency Object for file Ext.ux.ToolbarDroppable
    [ERR] Error executing page compilation Unknown definition for dependency : Object
    [ERR] com.sencha.exceptions.ExNotFound: Unknown definition for dependency : Object


    Any help appreciated.

    Thank you

  2. #2
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Posts
    1,295
    Vote Rating
    121
    dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all

      0  

    Default


    Sencha Cmd operates on a "class path" concept to resolve code. These paths are configured in your application's .sencha/app/sencha.cfg file.

    From what you have posted, it looks like you might need this in your sencha.cfg:

    Code:
    app.classpath=${app.dir}/app.js,${app.dir}/app,${app.dir}/libs/ext4_ux
    Given the above, the bootstrap.js file produced by sencha app refresh should provide the Loader with all the configuration it needs and you should not need code in your application to configure the loader paths.

    This is covered in more detail here - http://docs.sencha.com/ext-js/4-1/#!/guide/command_app
    Don Griffin
    Ext JS Development Team Lead

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

  3. #3
    Sencha Premium Member
    Join Date
    Mar 2010
    Posts
    101
    Vote Rating
    -2
    predator has a little shameless behaviour in the past

      0  

    Default


    Hi and thanks for the reply.

    I dont have .sencha directory in my project because it wasn't created with sencha cmd, I am trying to only compile it by sending --classpath as parameter like so:

    Code:
    $ sencha compile --classpath htdocs/libs/ext4/src,htdocs/libs/ext4_ux/,htdocs/app/* page -yui -in htdocs/application.js -out build/allclasses.js
    And this is the output:
    Code:
    Sencha Cmd v3.0.2.288
    [INF]		Compiling page null
    [INF]		Processing classPath entry : /_projects/project/sencha-compile-temp-dir
    [INF]		Processing classPath entry : htdocs/libs/ext4/src
    [INF]		Processing classPath entry : htdocs/libs/ext4_ux/
    [INF]		Processing classPath entry : htdocs/app/*
    [INF]		Processing class inheritance graph
    [ERR]		Failed to resolve dependency Object for file Ext.ux.ToolbarDroppable
    [ERR]		Error executing page compilation Unknown definition for dependency : Object
    [ERR]		com.sencha.exceptions.ExNotFound: Unknown definition for dependency : Object
    Any help appreciated.

  4. #4
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Posts
    1,295
    Vote Rating
    121
    dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all

      0  

    Default


    Do you see a "ux" folder with a "ToolbarDroppable.js" file in ext4_ux? The error is due to that class not being found though it looks like it should be given your classpath. You can enable the "-debug" log level and see if that provides you with any clues on that missing class.

    If you want to experiment with leveraging the generated app build process, you can generate one and copy its ".sencha" folder and build.xml to your app. You would have to change the config values to match your app so the benefits of doing so depend on how closely your app mirrors the structure of Cmd-generated apps.
    Don Griffin
    Ext JS Development Team Lead

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

  5. #5
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Posts
    1,295
    Vote Rating
    121
    dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all

      0  

    Default


    Also, you should not need an "*" in your classpath - just a list of files and folders. Folders are automatically assumed to be "*.js" and all subfolders are scanned as well.
    Don Griffin
    Ext JS Development Team Lead

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

  6. #6
    Sencha User mberrie's Avatar
    Join Date
    Feb 2011
    Location
    Bangkok, Thailand
    Posts
    506
    Vote Rating
    14
    mberrie will become famous soon enough mberrie will become famous soon enough

      0  

    Default


    Are you sure that you want the 'compile page' command here? The 'page' command works on html files as input and output, but you are referencing js files?

    What happens when you use

    Code:
    sencha --classpath htdocs/application.js,[your other paths] compile union -r -f application.js and concat -strip -compress build/allclasses.js
    That assumes that application.js is a standard javascript file that defines your 'entry point' dependencies in any way supported by the compiler. 'union -r -f application.js' will include application.js and all its dependencies (recursively).

  7. #7
    Sencha Premium Member
    Join Date
    Mar 2010
    Posts
    101
    Vote Rating
    -2
    predator has a little shameless behaviour in the past

      0  

    Default


    Thank you both for the attention. I believe that I am slowly starting to understand the situation.

    @mberrie thank you for clarifying the sencha cmd mysterious keys and options, it makes a lot more sense to me now. BTW the 'compile' should be between sencha and --classpath, right?

    However I am still not able to compile the application, what I have figured out to be the problem so far is the fact that some components extend on 'Object' and sencha cmd is looking for file Object.

    PHP Code:
     Ext.define('Ext.ux.ToolbarDroppable', {
        
    extend'Object'
    PHP Code:
    [ERR]        Failed to resolve dependency Object for file Ext.ux.ToolbarDroppable 
    I cannot find file Object.js in the extjs distribution. However it is present in the documentation http://docs.sencha.com/ext-js/4-1/#!/api/Object
    And the Object.js file is one big comment.

    Is is possible this to be somekind of CMD bug??

    Thanks

  8. #8
    Sencha User mberrie's Avatar
    Join Date
    Feb 2011
    Location
    Bangkok, Thailand
    Posts
    506
    Vote Rating
    14
    mberrie will become famous soon enough mberrie will become famous soon enough

      0  

    Default


    'Object' in the docs is referring to the Object defined by the JavaScript (EcmaScript) standard. There is no actual corresponding 'Object.js' file in the ExtJs framework (maybe there is one in JsDuck holding the meta data required for the docs to generate).

    Just drop the 'extend' entirely if you don't need a specific super class - all Objects in JavaScript derive from the standard Object anyway.

    Code:
    Ext.define('Ext.ux.ToolbarDroppable', {
    
    
    }

  9. #9
    Sencha Premium Member
    Join Date
    Mar 2010
    Posts
    101
    Vote Rating
    -2
    predator has a little shameless behaviour in the past

      0  

    Default


    Hi,

    This is exactly what I did.

    Then had to play with the command you gave me as it seems cmd 3 is different.
    Here what did the job for me:

    [PHP]Hi,

    This is exactly what I did.

    Then had to play with the command you gave me as it seems cmd 3 is different.
    Here what did the job for me:

    PHP Code:
    sencha -debug compile --classpath htdocs/application.js,\
    htdocs/app,\
    htdocs/libs/ext4/src,\
    htdocs/libs/ext4_ux,\
    htdocs/libs/ext4_overwrite \
    union --f application.js \
    and 
    concatenate -co -str -output-file htdocs/build/allclasses.js 
    However the build does not work because of singleton class of my own is messing things.. I have to look into it.

    Please send me your mailing address on PM to send you the beers.

    Thanks again.

    However the build does not work because of singleton class of my own is messing things.. I have to look into it.

    Please send me your mailing address on PM to send you the beers.

    Thanks again.

  10. #10
    Sencha User mberrie's Avatar
    Join Date
    Feb 2011
    Location
    Bangkok, Thailand
    Posts
    506
    Vote Rating
    14
    mberrie will become famous soon enough mberrie will become famous soon enough

      0  

    Default


    Haha. It's ok. And I doubt it's worth to send them to Thailand

    But I guess Don could really need a beer or two once in a while!

    Btw, glad you figured it out

Thread Participants: 2