X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fapkbuilder.cpp;h=2568f33e081bce17a8852300ca09bf75da758e4f;hb=b45cfe5e437ca79bb3176618769628c58c0734d1;hp=9cd1a16b5b45e878bf194509438e9a06dd26d52b;hpb=68f084e4ed817da0c25cefa1772cadf97b8cfe5e;p=builder.git diff --git a/source/apkbuilder.cpp b/source/apkbuilder.cpp index 9cd1a16..2568f33 100644 --- a/source/apkbuilder.cpp +++ b/source/apkbuilder.cpp @@ -25,11 +25,11 @@ Target *ApkBuilder::create_target(const list &sources, const string &) { AndroidResourceBundle *resource_bundle = 0; list other_files; - for(list::const_iterator i=sources.begin(); i!=sources.end(); ++i) + for(Target *s: sources) { - if(AndroidResourceBundle *r = dynamic_cast(*i)) + if(AndroidResourceBundle *r = dynamic_cast(s)) resource_bundle = r; - else if(FileTarget *f = dynamic_cast(*i)) + else if(FileTarget *f = dynamic_cast(s)) other_files.push_back(f); } AndroidPackageFile *apk = new AndroidPackageFile(builder, *resource_bundle->get_component(), *resource_bundle, other_files); @@ -51,13 +51,12 @@ Task *ApkBuilder::run(const Target &tgt) const argv.push_back(executable->get_path().str()); argv.push_back("u"); - const Target::Dependencies &depends = apk.get_dependencies(); FS::Path input_path; list files; - for(Target::Dependencies::const_iterator i=depends.begin(); i!=depends.end(); ++i) + for(Target *d: apk.get_dependencies()) { - FileTarget *file = dynamic_cast(*i); - Target *real = (*i)->get_real_target(); + FileTarget *file = dynamic_cast(d); + Target *real = d->get_real_target(); if(dynamic_cast(real)) input_path = file->get_path(); @@ -67,8 +66,8 @@ Task *ApkBuilder::run(const Target &tgt) const FS::Path work_dir = FS::dirname(input_path); - for(list::const_iterator i=files.begin(); i!=files.end(); ++i) - argv.push_back(FS::relative(*i, work_dir).str()); + for(const FS::Path &f: files) + argv.push_back(FS::relative(f, work_dir).str()); ExternalTask *task = new ExternalTask(argv, work_dir); task->set_stdin(FS::basename(input_path));