简体   繁体   中英

Script to build multiple android projects

I have multiple android projects which I want do build, these projects comes in the form of zip files like 7612362T1.zip . I have this gradle script that already decompresses all the projects within directory then I'm trying to build against android libraries but I'm getting errors when I try to execute the android update program. These projects are created with ADT Eclipse. This is my gradle script.

task buildall {
    FileTree tree=fileTree(dir: '.').include('*.zip')

    tree.each { File file ->
        copy {
            from zipTree(file)
            into 'projects'
        }
    }

    tree.each { File file ->
        exec {
            commandLine 'cmd','/c','android','update','project','--name '+file.name.split("\\.")[0],'--target 2 --path projects/'+file.name.split("\\.")[0]
        }
    }           
}

Error: Flag '--name 7612362T1' is not valid for 'update project'.

Maybe try:

exec {
   commandLine 'cmd', '/c', 'android', 'update', 'project', '--name', file.name.split("\\.")[0], '--target', '2', '--path', 'projects/'+file.name.split("\\.")[0]
}

Every command line arg now is passed separately.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM