1. #1
    Sencha User
    Join Date
    Jan 2009
    Posts
    9
    Vote Rating
    0
    blagerweij is on a distinguished road

      0  

    Default Ignore server-side generated javascripts

    Ignore server-side generated javascripts


    Hi,

    I'm currently struggling to get SenchaCmd to work in our project. We use JSP in our project, and we store the permissions and messages (resource-bundle) in a server-generated JavaScript.

    For example:
    Code:
        <script type="text/javascript">
        Ext.Loader.setConfig({
            enabled: true,
            disableCaching: true,
            paths: {
                'Ext': '<c:url value="/js/extjs/src"/>',
                'Ext.ux': '<c:url value="/js/ux"/>',
                'Rest.ux': '<c:url value="/rest/ux"/>'
            }
        });
        Ext.define('App.app.Application',{
            extend: 'Ext.app.Application',
            requires: [
                'Ext.ux.window.Notification',
                'Rest.ux.Messages',
                'Rest.ux.Permissions'
            ],
    The problem is that when we run SenchaCmd, it cannot find the Rest.ux.* files:
    Failed to find any files for C:\dev\example\example-web\src\main\webapp\js\app\Application.js::ClassRequire::Rest.ux.Messages
    [ant:x-sencha-command] at com.sencha.tools.compiler.sources.SymbolData.resolveDependencies(SymbolData.java:185)
    [ant:x-sencha-command] at com.sencha.tools.compiler.sources.SourceFile.resolveDependencies(SourceFile.java:153)
    [ant:x-sencha-command] at com.sencha.tools.compiler.sources.SymbolCache.resolveDependencies(SymbolCache.java:373)
    [ant:x-sencha-command] at com.sencha.tools.compiler.sources.SymbolCache.processReferences(SymbolCache.java:206)
    [ant:x-sencha-command] at com.sencha.tools.compiler.sources.ClassPathScope.initialize(ClassPathScope.java:301)
    [ant:x-sencha-command] at com.sencha.tools.compiler.sources.ClassPathScope.excludeAll(ClassPathScope.java:535)
    [ant:x-sencha-command] at com.sencha.tools.compiler.CompilerContext.excludeAll(CompilerContext.java:132)
    [ant:x-sencha-command] at com.sencha.command.compile.UnionCommand.execute(UnionCommand.java:18)
    We tried to ignore / exclude the Rest.ux namespace and the /rest/ux files, but failed so far. This is the config we're using:
    Code:
            ant.property(name: 'cmd.dir', location: "${senchaCmdDir}")
            ant.path(id: 'classpath') {
                ant.pathelement(path: configurations.sencha.asPath)
            }
            ant.taskdef(resource: 'com/sencha/ant/antlib.xml', classpathref: 'classpath')
            ant."x-sencha-command"("""
                -debug
                compile
                    -classpath=${webAppDir}/js/extjs/src,${webAppDir}/js/app,${webAppDir}/js/ux
                    -ignore=Rest.ux
                    -debug=false
                union
                    -namespace=App,Ext
                and
                exclude
                    -namespace=Rest.ux
                and
                concat
                    -yui
                    -out=example-web/build/example-web/js/app.js""")
        }
    Is anyone else using server-side generated javascript ? If so, how do you get SenchaCmd to play nice ?

    Barry

  2. #2
    Sencha User
    Join Date
    Jan 2009
    Posts
    9
    Vote Rating
    0
    blagerweij is on a distinguished road

      0  

    Default


    As a workaround, for now I've added the 'rest/ux' folder to my project, and added dummy files there:

    Ext.define('Rest.ux.Messages', {
    });

    In the generated app.js file, the ignore and exclude seem to have worked, but it would be nice if we can ignore files and namespaces during dependency resolving as well, so we can drop the dummy files from our project.