X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fvssolutiongenerator.cpp;h=7dce0767e78ebd1138966d80442c80e9606c1436;hb=1ed833343bc83b83c5f61cbfd74423bbba677a04;hp=9f8a7ab9f936ed52aec9a5cb61166add543d0e4b;hpb=451ef4f33b5a57dcb56bd7cb671bed359ac86247;p=builder.git diff --git a/source/vssolutiongenerator.cpp b/source/vssolutiongenerator.cpp index 9f8a7ab..7dce076 100644 --- a/source/vssolutiongenerator.cpp +++ b/source/vssolutiongenerator.cpp @@ -2,6 +2,7 @@ #include #include #include "builder.h" +#include "internaltask.h" #include "sourcepackage.h" #include "vcxprojectfile.h" #include "vssolutionfile.h" @@ -10,30 +11,28 @@ using namespace std; using namespace Msp; -Target *VsSolutionGenerator::create_target(const vector &, const string &) +VsSolutionGenerator::VsSolutionGenerator(Builder &b): + Tool(b, "VSSG") { - throw logic_error("Not implemented"); + set_run_internal(_run); } -Task *VsSolutionGenerator::run(const Target &target) const +Target *VsSolutionGenerator::create_target(const vector &, const string &) { - const VsSolutionFile &solution = dynamic_cast(target); - Worker *worker = new Worker(solution); - return new InternalTask(worker); + throw logic_error("Not implemented"); } - -void VsSolutionGenerator::Worker::main() +bool VsSolutionGenerator::_run(const VsSolutionFile &solution) { - const SourcePackage &spkg = *target.get_package(); + const SourcePackage &spkg = *solution.get_package(); Builder &builder = spkg.get_builder(); - IO::BufferedFile out(target.get_path().str(), IO::M_WRITE); + IO::BufferedFile out(solution.get_path().str(), IO::M_WRITE); IO::print(out, "Microsoft Visual Studio Solution File, Format Version 12.00\n"); IO::print(out, "MinimumVisualStudioVersion = 10.0.40219.1\n"); vector projects; - for(const Target *t: target.get_dependencies()) + for(const Target *t: solution.get_dependencies()) if(const VcxProjectFile *project = dynamic_cast(t)) projects.push_back(project); @@ -66,5 +65,5 @@ void VsSolutionGenerator::Worker::main() IO::print(out, "\tEndGlobalSection\n"); IO::print(out, "EndGlobal\n"); - status = Task::SUCCESS; + return true; }