~quadrispro/codelite/trunk

« back to all changes in this revision

Viewing changes to ContinuousBuild/continuousbuild.cpp

  • Committer: eranif
  • Date: 2008-11-22 20:58:00 UTC
  • Revision ID: svn-v4:9da81c78-c036-0410-9e1f-a2b0375e4b5a:trunk:2455

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
#include "continousbuildconf.h"
9
9
 
10
10
static ContinuousBuild* thePlugin = NULL;
11
 
 
12
11
//Define the plugin entry point
13
12
extern "C" EXPORT IPlugin *CreatePlugin(IManager *manager)
14
13
{
57
56
 
58
57
ContinuousBuild::~ContinuousBuild()
59
58
{
60
 
        if(m_shellProcess) {
 
59
        if (m_shellProcess) {
61
60
                delete m_shellProcess;
62
61
                m_shellProcess = NULL;
63
62
        }
117
116
{
118
117
        if ( m_shellProcess && m_shellProcess->IsBusy() ) {
119
118
                // add the build to the queue
120
 
                if(m_files.Index(fileName) == wxNOT_FOUND){
 
119
                if (m_files.Index(fileName) == wxNOT_FOUND) {
121
120
                        m_files.Add(fileName);
122
121
                        // update the UI
123
122
                        m_view->AddFile(fileName);
124
123
                }
125
124
                return;
126
125
        }
127
 
        
 
126
 
128
127
        if ( m_shellProcess ) {
129
128
                delete m_shellProcess;
130
129
                m_shellProcess = NULL;
131
130
        }
132
131
 
133
132
        wxString conf;
134
 
        
 
133
 
135
134
        // get the file's project name
136
135
        wxString projectName = m_mgr->GetProjectNameByFile(fileName);
137
 
        if(projectName.IsEmpty()) {
 
136
        if (projectName.IsEmpty()) {
138
137
                return;
139
138
        }
140
 
        
 
139
 
141
140
        // get the selected configuration to be built
142
141
        BuildConfigPtr bldConf = m_mgr->GetWorkspace()->GetProjBuildConf ( projectName, wxEmptyString );
143
142
        if ( !bldConf ) {
144
143
                return;
145
144
        }
146
 
        
 
145
 
147
146
        m_currentBuildInfo.project = projectName;
148
147
        m_currentBuildInfo.file = fileName;
149
 
        
 
148
 
150
149
        m_view->AddFile(fileName);
151
 
        
 
150
 
152
151
        // construct a build command
153
152
        QueueCommand info ( projectName, conf, false, QueueCommand::Build );
154
153
        if ( bldConf && bldConf->IsCustomBuild() ) {
188
187
        // remove the file from the UI
189
188
        m_view->RemoveFile(m_currentBuildInfo.file);
190
189
        m_view->SetStatusMessage(wxEmptyString);
191
 
        
 
190
 
192
191
        // TODO:: handle the output here
193
192
        m_currentBuildInfo.Clear();
194
 
        
 
193
 
195
194
        // if the queue is not empty, start another build
196
 
        if(m_files.IsEmpty() == false) {
197
 
                
 
195
        if (m_files.IsEmpty() == false) {
 
196
 
198
197
                wxString fileName = m_files.Item(0);
199
198
                m_files.RemoveAt(0);
200
 
                
 
199
 
201
200
                DoBuild(fileName);
202
201
        }
203
202
}
206
205
{
207
206
        // empty the queue
208
207
        m_files.Clear();
209
 
        
 
208
 
210
209
        if ( m_shellProcess && m_shellProcess->IsBusy() ) {
211
210
                m_shellProcess->Stop();
212
211
        }