cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Filip Maj (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-2075) cordova build fails when project added to subversion
Date Mon, 17 Dec 2012 19:24:30 GMT

    [ https://issues.apache.org/jira/browse/CB-2075?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13534195#comment-13534195
] 

Filip Maj commented on CB-2075:
-------------------------------

Response
----
Hey just some more issues with the .svn folders that ive worked around. This time in the ios_parser..
i havent got as far as checking the android_parser so there is maybe an issue there as well.
anyhow, when a build takes place there is an issue with the update_www method trying to copy
the .svn folder to the dest (platform www folder) This one wasnt as easy to get around and
so i added a method to the prototype; there is probably a much more elegant solution to this
but i changed the function called {{update_www}}

and replaced this line

    {{shell.cp('-rf', www, this.path);}}

with this line:

    {{this.copyFromTo(www, path.join(this.path, 'www'));}}

which is a call to the following function that i just added to the prototype. Its quite basic
in that if just checks for a .svn folder (with the assumption this is to be ignored) and then
skips it entirely. For other directories it operates recursively and basically copies the
www across to the iOS/www folder. I am no js expert but i think the intent is reasonably clear.
{code}
copyFromTo:function(root, dest) {
var contents = fs.readdirSync(root);        

var self = this;
contents.forEach(function(leaf) {

    var fullPath = path.join(root, leaf);
    var destPath = path.join(dest, leaf);

        var stats = fs.statSync(fullPath);

        if (leaf == ".svn") {
            return;
        }
        else    
        {
        if(stats.isDirectory())
        {

            //mkdir at dest and then call recursive

            fs.exists(destPath, function make(exists){
                if(!exists)
                {           
                    fs.mkdirSync(destPath);
                }
            });
                            // now recurse into this folder
            self.copyFromTo(fullPath, destPath);

        }   
        else
        {
            shell.cp('-f', fullPath, destPath);
        }
        }

});
{code}
                
> cordova build fails when project added to subversion
> ----------------------------------------------------
>
>                 Key: CB-2075
>                 URL: https://issues.apache.org/jira/browse/CB-2075
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CLI
>    Affects Versions: 2.2.0
>            Reporter: Filip Maj
>            Assignee: Filip Maj
>             Fix For: 2.3.0
>
>
> Ive set up an iOS and android project then used svn import to add to repository then
a checkout to create my local repo. When i run
> {{$ cordova build ios}}
> or
> {{$ cordova build android}}
> i get the following error
> {code}
> /bin/sh: /Users/{mydevpath}/.cordova/hooks/before_build/.svn: is a directory
> {code}
> Script ".svn"in the before_build hook exited with non-zero status code. Aborting.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message