1. #1
    Sencha User existdissolve's Avatar
    Join Date
    Jan 2010
    Location
    Kansas
    Posts
    522
    Vote Rating
    86
    existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice

      0  

    Default Compiling using Virtual Directory

    Compiling using Virtual Directory


    This may be an incredibly stupid question, but it is possible to compile an app using an extjs library housed in a virtual directory? I have a virtual directory in my app which includes the library I want (currently 4.1.2a).

    During development, this setup works just fine. All of the dependencies for my app files are found in the framework, and everything moves along without issues. However, when I compile, I get errors about dependency resolution - e.g., "Failed to resolve dependency Ext.container.Viewport for file..."

    Is this possible to do, and if so, what am I missing?

    NOTE: I haven't modified either of the .cfg files, and my compile looks like this:

    Code:
    sencha compile -classpath=ext\src,app page -in=index.html -out=build/index.html
    EDIT:
    I should also mention that:
    * When I specify the full path to ext/src in classpath, the compile succeeds, but excludes any app classes
    * When I put the library in my application root (no virtual directory), the compile succeeds and resolves all dependencies as expected

    I appreciate any help anyone can offer. Thanks!
    Last edited by existdissolve; 13 Nov 2012 at 10:59 AM. Reason: Additional Info

  2. #2
    Sencha User existdissolve's Avatar
    Join Date
    Jan 2010
    Location
    Kansas
    Posts
    522
    Vote Rating
    86
    existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice

      0  

    Default


    Okay, I believe I have it working. If anyone else is interested, here's the setup I have:

    App Structure (Created via CMD)
    PHP Code:
    /myapp
        
    /sencha
        
    /app
        
    /build
        
    /ext (virtual directorty)
        /
    resources 
    App Sencha.cfg (Not modified)
    PHP Code:
    app.name=MyApp 
    app
    .framework=extapp.classpath=${app.dir}/app 
    Workspace Sencha.cfg (Path changed)
    PHP Code:
    workspace.build.dir=${workspace.dir}/build/${app.name}
    ext.dir=ABSOLUTE_PATH_TO_SOURCE/extjs-4.1.3 
    Compile
    PHP Code:
    sencha compile -classpath=ext\src,app page -in=index.html -out=build/index.html 

  3. #3
    Sencha User existdissolve's Avatar
    Join Date
    Jan 2010
    Location
    Kansas
    Posts
    522
    Vote Rating
    86
    existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice

      0  

    Default


    For anyone interested, I did a fuller write-up on this here: http://existdissolve.com/2012/11/vir...4-development/

  4. #4
    Sencha User Stormseeker's Avatar
    Join Date
    Jan 2010
    Location
    Evanston, Illinois
    Posts
    55
    Vote Rating
    1
    Stormseeker is on a distinguished road

      0  

    Default


    Quote Originally Posted by existdissolve View Post
    For anyone interested, I did a fuller write-up on this here: http://existdissolve.com/2012/11/vir...4-development/
    Unfortunately, it doesn't look this works with the full "sencha app build" command since the themeing portions such as compass/sass don't reference the sencha.cfg file but a hard-coded reference to the ext directory. Take a look at "youapp/resources/theme/default/theme.html".

    It has a hard-coded reference to ext at the following location: src="../../../ext/ext-all.js".

    Also the config.rb for the sass file is looking in the same place.

  5. #5
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    1,424
    Vote Rating
    150
    dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold dongryphon is a splendid one to behold

      0  

    Default


    The path to the framework we etch in to the SASS world is computed at theme generation time... so it may work to generate a new theme after changing the configuration of your workspace.
    Don Griffin
    Engineering Manager - Frameworks (Ext JS / Sencha Touch)

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

    "Use the source, Luke!"

  6. #6
    Sencha User Stormseeker's Avatar
    Join Date
    Jan 2010
    Location
    Evanston, Illinois
    Posts
    55
    Vote Rating
    1
    Stormseeker is on a distinguished road

      0  

    Default


    Quote Originally Posted by dongryphon View Post
    The path to the framework we etch in to the SASS world is computed at theme generation time... so it may work to generate a new theme after changing the configuration of your workspace.
    Yup, that seemed to work perfectly. I just replaced the default theme.html file with the newly generated one and all is working. Thanks!

  7. #7
    Sencha User existdissolve's Avatar
    Join Date
    Jan 2010
    Location
    Kansas
    Posts
    522
    Vote Rating
    86
    existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice

      0  

    Default


    Generating the theme after the config change partially works. If you browse the "theme.html" file via the file system, all of the assets will be loaded correctly. However, if you try to access it via a hostname (e.g., dev.somesenchasite.com), your assets may fail to load, depending on where they exist in relation to your site's root.

    What I did to get around this is kind of a kludge, but it seems to work. In my theme's config.rb, I changed the $ext_path to the absolute file path for the ExtJS library I want to use. And in theme.html, I set the ext-all.js to a faux-site (dev.senchaassets.com) I setup to allow access to the ExtJS library. This allows me to view the theme.html file via the hostname, but still correctly slices images when compiling SASS during the build process. Sadly, a virtual directory path in theme.html doesn't work when building, even though it works when browsing via the hostname.

    While these changes represent a bit more work re: modifying configuration files on a per-app basis, at least it allows me to still maintain an abstract relationship between the library, global assets, and my sites.

    If anyone has thoughts on how to better accomplish this, I'd love to hear your ideas.

    Thanks!

Thread Participants: 2