You found a bug! We've classified it as SDKTOOLS-422 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium Member
    Join Date
    Oct 2012
    Posts
    7
    Vote Rating
    1
    hemp is on a distinguished road

      0  

    Default 3.1.0.256 - Command to start screenshot_runner.js fails with spaces (-before-slice)

    3.1.0.256 - Command to start screenshot_runner.js fails with spaces (-before-slice)


    <x-sencha-command> does not seem to pass correct arguments during the theme capture and slicing when the path has spaces.

    Context: I am setting up Sencha CMD on a Jenkins machine and my workspace for Jenkins has spaces in the name.

    This would occur with any Sencha CMD app build if the path has spaces in the name.

    So far though, this is the only problem related to having spaces in the path.

    screenshot-runner.js debug added at line 39:
    Code:
    console.log("loading page " + url);
    
    
    console.log('HEMP START');
    if (system.args.length === 1) {
        console.log('Try to pass some args when invoking this script!');
    } else {
        system.args.forEach(function (arg, i) {
                console.log(i + ': ' + arg);
        });
    }
    console.log('HEMP END');
    
    function waitFor(test, ready, timeout) {
    sencha app build log snippet. The UNDERLINED_BOLD text should have percent 20's between the words but the forum is sanitizing them out of this post.

    Code:
    [INF] slice:
    [INF]
    [INF] -before-slice:
    [INF]      [echo] Capture theme image to /var/lib/jenkins/workspace/My Web App Jenkins/myapp/build/myapp/production/theme-capture.png
    [INF] Capturing theme image
    [INF] loading page /var/lib/jenkins/workspace/My%20Web%20App%20Jenkins/custserv-webclient/public/admin/sass/example/theme.html
    HEMP START
    0: /opt/Sencha/Cmd/3.1.0.256/screenshot-runner.js
    1: /var/lib/jenkins/workspace/My%20Web%20App%20Jenkins/custserv-webclient/public/admin/sass/example/theme.html
    2: /var/lib/jenkins/workspace/My
    3: Web
    4: App
    5: Jenkins/myapp/build/myapp/production/theme-capture.png
    6: /var/lib/jenkins/workspace/My
    7: Web
    8: App
    9: Jenkins/myapp/build/myapp/production/theme-capture.json
    HEMP END
    Capturing screenshot
    Saving slicer widget manifest
    Capture complete
    
    
    [INF] Capture complete
    [INF]      [echo] Slicing theme images to /var/lib/jenkins/workspace/My Web App Jenkins/myapp/build/myapp/production/resources
    [INF] Slicing images...
    [ERR]
    [ERR] BUILD FAILED
    [ERR] com.sencha.exceptions.BasicException: Cannot find file : /var/lib/jenkins/workspace/My Web App Jenkins/myapp/build/myapp/production/theme-capture.json
    WORKAROUND:

    I ended up adding to my build-impl.xml (line 387) the following code.

    This is a poorman workaround (as it creates a new folder with rather than reuse the jenkins workspace folder). Since theme-capture(.png/.json) are built everytime, I don't care that they are in a different jenkins workspace folder though I wouldn't mind not having this workaround :-)

    Code:
    <path id="slicer.image.id">
        <pathelement location="${build.dir}/theme-capture.png"/>
    </path>
    <pathconvert targetos="unix" property="slicer.image" refid="slicer.image.id">
    <scriptmapper language="javascript">
      self.addMappedName(source.replace(/\s+/g, '%20'));
    </scriptmapper>
    </pathconvert>
    
    
    <path id="slicer.manifest.id">
        <pathelement location="${build.dir}/theme-capture.json"/>
    </path>
    <pathconvert targetos="unix" property="slicer.manifest" refid="slicer.manifest.id">
    <scriptmapper language="javascript">
      self.addMappedName(source.replace(/\s+/g, '%20'));
    </scriptmapper>
    </pathconvert>
    
    <echo>
    ${slicer.image}
    ${slicer.manifest}
    </echo>
    
            <x-sencha-command>
                theme
                    capture
                        -page=${app.example.dir}/theme.html
                        -image=${slicer.image}
                        -manifest=${slicer.manifest}
            </x-sencha-command>
    
    
            <echo>Slicing theme images to ${build.resources.dir}</echo>
            <x-sencha-command>
                fs
                    slice
                        ${build.slice.options}
                        -image=${slicer.image}
                        -manifest=${slicer.manifest}
                        -out=${build.resources.dir}
            </x-sencha-command>
    Last edited by hemp; 9 Apr 2013 at 6:35 AM. Reason: Fixing %20.

  2. #2
    Sencha Premium Member
    Join Date
    Oct 2012
    Posts
    7
    Vote Rating
    1
    hemp is on a distinguished road

      0  

    Default


    Edit: fixed the %20 stuff.

  3. #3
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Posts
    1,367
    Vote Rating
    136
    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


    Thanks for the report! I have opened a bug in our bug tracker.

Thread Participants: 1