Results 1 to 3 of 3

Thread: sencha app build testing has trouble finding JS files outside app-directory

  1. #1
    Ext GWT Premium Member
    Join Date
    Nov 2009
    Posts
    14

    Default sencha app build testing has trouble finding JS files outside app-directory

    Hi,

    all my controllers, views, etc live in the app folder. But beside the app folder (on the same level) I have another folder called 'astCommon' which has a subfolder 'util' which contains a Logger.js file, which is defined as Ext.define('ast.util.Logger', ...

    In my app.js file I tell sencha touch that the namespace 'ast' can be found in the folder 'astCommon'

    Code:
    Ext.Loader.setPath({
        'Ext': 'touch/src',
        'ast': 'astCommon'
    });
    which works super when I load the index.html file into my browser. Everything is loaded as expected.

    But when I try to build using sencha-command: sencha app build testing

    I get the following error

    Code:
    [INF] Loading classpath entry C:\kepler\workspaces\mae\MaeMobile\src\main\webapp\touch\src
    [INF] Loading classpath entry C:\kepler\workspaces\mae\MaeMobile\src\main\webapp\app.js
    [INF] Loading classpath entry C:\kepler\workspaces\mae\MaeMobile\src\main\webapp\app
    [ERR] C2008: Requirement had no matching files (ast.util.Logger) -- C:\kepler\workspaces\mae\MaeMobile\src\main\webapp\app.js:2294
    [ERR] The following error occurred while executing this line:
    C:\kepler\workspaces\mae\MaeMobile\src\main\webapp\.sencha\app\build-impl.xml:165: The following error occurred while executing this line:
    C:\kepler\workspaces\mae\MaeMobile\src\main\webapp\.sencha\app\build-impl.xml:158: com.sencha.exceptions.ExScript: Wrapped com.sencha.exceptions.ExBuild: Failed to
    find any files for C:\kepler\workspaces\mae\MaeMobile\src\main\webapp\app.js::ClassRequire::ast.util.Logger (x-app-build#291)
       runAppBuild (x-app-build:291)
       [anonymous] (x-app-build:571)
       x_app_build (x-app-build:569)
       <script> (anonymous:1)
    What do I have to configure for Sencha Cmd to know about the location "astCommon"? Thanks in advance for any suggestions.

    Best,
    Ronald

  2. #2
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165

    Default

    For any custom classes defined outside of the default app folder youll need to add the folder for the common classes to the applications classPath. Look in appRoot/.sencha/app/sencha.cfg. If the folder where the common classes are kept is astCommon then youd add that to the comma separated classPath in the .cfg.
    i.e.
    app.classpath=${app.dir}/app,${app.dir}/app.js
    becomes
    app.classpath=${app.dir}/app,${app.dir}/astCommon,${app.dir}/app.js

  3. #3
    Ext GWT Premium Member
    Join Date
    Nov 2009
    Posts
    14

    Default

    Thank you!

    Works like a charm.

    Ronald

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •