1. #1
    Sencha User Dumas's Avatar
    Join Date
    Dec 2008
    Location
    Vienna, Austria
    Posts
    582
    Vote Rating
    9
    Dumas will become famous soon enough

      0  

    Default Exclude files from build

    Exclude files from build


    Is there any way to exclude certain files or folders from the app.classpath configuration?

    The documentation does not mention anything.

    Thanks,
    Roland

  2. #2
    Sencha Premium Member
    Join Date
    Jun 2008
    Posts
    323
    Vote Rating
    6
    Scorpie is on a distinguished road

      0  

    Default


    Quote Originally Posted by Dumas View Post
    Is there any way to exclude certain files or folders from the app.classpath configuration?

    The documentation does not mention anything.

    Thanks,
    Roland
    Set include and exclude

    These two set operations are probably the most common (and flexible) set operations. Both support these basic switches:
    • -namespace - Matches files that define types in the specified namespace.
    • -class - Matches a specific defined type.
    • -file - Matches filenames and/or folder names using Ant-style glob patterns (a "*" matches only filename characters, where "**" matches folders).
    • -tag - Matches any files with the specified tag(s) (see below).
    • -set - The files that are present in any of the specified named sets.
    In all of these cases, the next command line argument is a list of match criteria separated by commas. Also, a single exclude or include can have as many switch/value pairs as needed.
    So, let's start with a simple example and build an "ext-all-no-charts-debug-w-comments.js".

    sencha compile -classpath=sdk/src \ exclude -namespaceExt.chart and \ ...What is happening here is that we started with only the Ext JS sources (in "sdk/src") and they were all part of the "current set". We then performed a set difference by excluding all files in the Ext.chart namespace. The current set was then equivalent to "ext-all.js" but without any of the Chart package.
    Negating include and exclude with -not

    Both include and exclude support a rich set of matching criteria. This is rounded out by the -not switch, which negates the matching criteria that follows it. This means that the files included or excluded are all those that do not match the criteria.
    For example:

    sencha compile -classpath=sdk/src,js \ ... \ exclude -not-namespaceExtand \ ...The above exclude command will exclude from the current set any classes that are not in the Ext namespace.
    The all Set

    In some cases, it is very handy to restore the current set to all files or to the empty set. To do this, you simply use include or exclude with the -allswitch. To build on the previous example:

    sencha compile -classpath=sdk/src \ ... \ include -all and \ ... \ exclude -all and \ ...After the include -all, the current set is all files. After exclude -all it is the empty set.
    http://docs.sencha.com/cmd/3.1.2/#!/...mmand_compiler
    I`m from Holland!

  3. #3
    Sencha User Dumas's Avatar
    Join Date
    Dec 2008
    Location
    Vienna, Austria
    Posts
    582
    Vote Rating
    9
    Dumas will become famous soon enough

      0  

    Default


    Sorry, I forgot to say.

    I need this for the build command: sencha app build production

    Exclude excludes a already parsed file, but I want to prevent any parsing of some external files (because it would fail).

    Thanks,
    Roland

  4. #4
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,470
    Vote Rating
    202
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    You're looking to exclude a linked JS resource out of your index.html page? Or you're looking to exclude classes from your application?

  5. #5
    Sencha User Dumas's Avatar
    Join Date
    Dec 2008
    Location
    Vienna, Austria
    Posts
    582
    Vote Rating
    9
    Dumas will become famous soon enough

      0  

    Default


    Neither. Sorry, let me try to explain it again.

    When I run sencha app build productionthe build process runs through all javascript files which are in the folders defined in sencha.cfg's app.classpath. But I have some files there which should not even be parsed (there is a minified version in this folder, so some classes are defined twice, there is a build script files which does not validate via Rhino, etc.).

    Is there any way to exclude subfolders/files (not js classes) from the defined app.classpath?

  6. #6
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,470
    Vote Rating
    202
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    I take it moving the files / folders from the classpath is not an option.

    You can use the -ignore option and that will skip scanning any files / folders declared (comma separated file / folder list). Or, you can use app.ignores=somefile.js,someFolder/ inside the sencha.cfg config file.

    Once ignored they wont' be in the build at all, though. You'll still need to link to them directly from your index page.

  7. #7
    Sencha User Dumas's Avatar
    Join Date
    Dec 2008
    Location
    Vienna, Austria
    Posts
    582
    Vote Rating
    9
    Dumas will become famous soon enough

      0  

    Default


    sencha app build production does NOT HAVE an option ignore. This option is only available for the compile task. app.ignores also doesn't seem to work:

    sencha.cfg:
    app.classpath=${app.dir}/app.js,${app.dir}/app,${bancha.folder}/webroot/js
    app.ignores=${bancha.folder}/webroot/js/scaffold/builder/

    [ERR] C2000: Rhino Parse Error (unterminated string literal => ...) -- /.../app/Plugin/Bancha/webroot/js/scaffold/builder/config/gema-production-patterns.js:094

    Why is this not ignored?

  8. #8
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,470
    Vote Rating
    202
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    Hmm... looks like there's an issue with the build-impl.xml file's compile statement. Look in the build statement and replace:

    Code:
    # base build command
                
                compile
                    -options=${build.options}
                    page
                        -name=full-page
    with

    Code:
    # base build command
                
                compile
                    -ignore=${app.ignores}
                    -options=${build.options}
                    page
                        -name=full-page
    Then it should pick up the files / folders listed in the sencha.cfg file when doing sencha app build.

  9. #9
    Sencha User Dumas's Avatar
    Join Date
    Dec 2008
    Location
    Vienna, Austria
    Posts
    582
    Vote Rating
    9
    Dumas will become famous soon enough

      0  

    Default


    This doesn't even work for me in the console.

    From my console:
    Code:
    roland$ sencha compile -ignore=Initializer concatenate mybuild.js
    Sencha Cmd v3.1.2.342
    [INF] Loading classpath entry /Users/roland/Documents/AptanaWorkspace/TireCore/app/webroot/workorder/development/touch/src
    [INF] Loading classpath entry /Users/roland/Documents/AptanaWorkspace/TireCore/app/Plugin/Bancha/webroot/js
    [WRN] C1009: Circular reference in requirements chain (
    /../js/Initializer.js ->
    /../js/loader/Models.js ->
    /../js/Main.js ->
    /../js/Logger.js ->
    /../js/Main.js
    
    ) -- unknown-file:-1
    [WRN] C1009: Circular reference in requirements chain (
    /../js/Initializer.js ->
    /../js/loader/Models.js ->
    /../js/Main.js ->
    /../js/ScriptTagInitializer.js ->
    /../js/loader/Models.js
    ) -- unknown-file:-1
    [INF] Concatenating output to file mybuild.js
    So defining a ignore of Initializer does not exclude the file Initializer.js. Is this a bug or am I doing something wrong?

    Thanks,
    Roland

  10. #10
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,470
    Vote Rating
    202
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    Try setting the path in the -ignore to Initializer.
    ${app.dir}/path/to/Initializer

    In 4.x you won't need to set the -ignore=${app.ignores} in the build-impl. That is fixed in Beta.