1. #1
    Ext JS Premium Member
    Join Date
    Aug 2007
    Location
    Seattle, WA
    Posts
    28
    Vote Rating
    0
    jakehurst is on a distinguished road

      0  

    Default Possible JSB2 error with file globbing

    Possible JSB2 error with file globbing


    As I don't have SVN access, I took the jsb2 file from 3.0rc3 and used it for 3.0 final, with the
    new JSBuilder2 builder (thanks btw for including the java files in the jar).

    Towards the end of the jsb2 file, it looks like this:

    resources: [{
    src: 'src/',
    dest: 'src/',
    filters: '*.js'
    },{
    src: 'examples/',
    dest: 'examples/',
    filters: '*.html;*.jpg;*.png;*.gif;*.css;*.js'
    },{
    src: 'resources/',
    dest: 'resources/',
    filters: '*.*'
    }]
    }

    The filters do not work, the builder gives an error:
    java.util.regex.PatternSyntaxException: Dangling meta character '*' near index 0
    *.html;*.jpg;*.png;*.gif;*.css;*.js

    To solve this, Java pattern matcher needs a true regex, not globs.

    I turned it into this:
    resources: [{
    src: 'src/',
    dest: 'src/',
    filters: '.*.js'
    },{
    src: 'examples/',
    dest: 'examples/',
    filters: '.*.(html|jpg|png|gif|css|js)'
    },{
    src: 'resources/',
    dest: 'resources/',
    filters: '.*'
    }]

    It seems to work after that.
    Just FYI. Might want to put in a function to turn globs into regexes into the Java.
    I found one here: http://syncdir.sourceforge.net/src/s...Node.java.html
    Though, not sure on the license.

    -Justin

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,445
    Vote Rating
    129
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Justin -

    The filters were changed to regex's and the jsb2 which resides in SVN and now in the download look almost the same as yours.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

Thread Participants: 1