void PlatformAddCmd::Run() { ToolSystem* tsystem = GetSubsystem<ToolSystem>(); Project* project = tsystem->GetProject(); Platform* platform = tsystem->GetPlatformByName(platformToAdd_); if (!platform) { Error(ToString("Unknown platform: %s", platformToAdd_.CString())); return; } if (project->ContainsPlatform(platform->GetPlatformID())) { Error(ToString("Project already contains platform: %s", platformToAdd_.CString())); return; } LOGINFOF("Adding platform: %s", platformToAdd_.CString()); project->AddPlatform(platform->GetPlatformID()); Finished(); }
void BuildCmd::Run() { ATOMIC_LOGINFOF("Building project for: %s", buildPlatform_.CString()); ToolSystem* tsystem = GetSubsystem<ToolSystem>(); Project* project = tsystem->GetProject(); Platform* platform = NULL; platform = tsystem->GetPlatformByName(buildPlatform_); if (!platform) { Error(ToString("Unknown build platform: %s", buildPlatform_.CString())); return; } // create the build BuildBase* buildBase = platform->NewBuild(project); if (!assetsBuildTag_.Empty()) { buildBase->SetAssetBuildTag(assetsBuildTag_); } buildBase->SetAutoLog(autoLog_); // add it to the build system BuildSystem* buildSystem = GetSubsystem<BuildSystem>(); buildSystem->QueueBuild(buildBase); SubscribeToEvent(E_BUILDCOMPLETE, ATOMIC_HANDLER(BuildCmd, HandleBuildComplete)); // TODO: parallel/serial builds buildSystem->StartNextBuild(); }