1
1
//////////////////////////////////////////////////////////////////////////////
2
2
//////////////////////////////////////////////////////////////////////////////
4
// copyright : (C) 2008 by Eran Ifrah
5
// file name : custombuildrequest.cpp
4
// copyright : (C) 2008 by Eran Ifrah
5
// file name : custombuildrequest.cpp
7
7
// -------------------------------------------------------------------------
10
// / __ \ | | | | (_) |
11
// | / \/ ___ __| | ___| | _| |_ ___
12
// | | / _ \ / _ |/ _ \ | | | __/ _ )
13
// | \__/\ (_) | (_| | __/ |___| | || __/
14
// \____/\___/ \__,_|\___\_____/_|\__\___|
18
// This program is free software; you can redistribute it and/or modify
19
// it under the terms of the GNU General Public License as published by
20
// the Free Software Foundation; either version 2 of the License, or
21
// (at your option) any later version.
10
// / __ \ | | | | (_) |
11
// | / \/ ___ __| | ___| | _| |_ ___
12
// | | / _ \ / _ |/ _ \ | | | __/ _ )
13
// | \__/\ (_) | (_| | __/ |___| | || __/
14
// \____/\___/ \__,_|\___\_____/_|\__\___|
18
// This program is free software; you can redistribute it and/or modify
19
// it under the terms of the GNU General Public License as published by
20
// the Free Software Foundation; either version 2 of the License, or
21
// (at your option) any later version.
23
23
//////////////////////////////////////////////////////////////////////////////
24
24
//////////////////////////////////////////////////////////////////////////////
56
56
BuildSettingsConfig *bsc(manager ? manager->GetBuildSettingsConfigManager() : BuildSettingsConfigST::Get());
57
57
Workspace *w(manager ? manager->GetWorkspace() : WorkspaceST::Get());
58
58
EnvironmentConfig *env(manager ? manager->GetEnv() : EnvironmentConfig::Instance());
60
60
ProjectPtr proj = w->FindProjectByName(m_info.GetProject(), errMsg);
62
62
AppendLine(wxT("Cant find project: ") + m_info.GetProject());
67
67
// Notify plugins that a compile process is going to start
68
68
wxCommandEvent event(wxEVT_BUILD_STARTING);
70
70
wxString pname (proj->GetName());
71
71
event.SetClientData((void*)&pname);
72
event.SetString( m_info.GetConfiguration() );
73
74
// since this code can be called from inside the application OR
74
75
// from inside a DLL, we use the application pointer from the manager
75
76
// when available, otherwise, events will not be processed inside
77
78
wxApp *app = manager ? manager->GetTheApp() : wxTheApp;
78
79
app->ProcessEvent(event);
81
if(app->ProcessEvent(event)){
83
// the build is being handled by some plugin, no need to build it
84
// using the standard way
82
91
//TODO:: make the builder name configurable
189
198
BuildManager *bm(manager ? manager->GetBuildManager() : BuildManagerST::Get());
190
199
Workspace *w(manager ? manager->GetWorkspace() : WorkspaceST::Get());
192
201
// collect all enabled commands
193
202
BuildCommandList::iterator iter = preBuildCmds.begin();
194
203
for (; iter != preBuildCmds.end(); iter ++) {