Results 1 to 2 of 2

Thread: Possible JSB2 error with file globbing

  1. #1
    Ext JS Premium Member
    Join Date
    Aug 2007
    Location
    Seattle, WA
    Posts
    29
    Vote Rating
    0
      0  

    Default 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 User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,487
    Vote Rating
    145
      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

Posting Permissions

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