Skip to content

Commit 7910c76

Browse files
committed
Created Project View Build All Libraries. Change dependent build to use ALT+Program button. Remove Library Dependent Build.
1 parent d5f86a6 commit 7910c76

File tree

13 files changed

+209
-43
lines changed

13 files changed

+209
-43
lines changed

propside/IDE_LICENSE.txt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
21
+---------------------------------------------------------------------
3-
SimpleIDE is licensed according to the GNU GENERAL PUBLIC LICENSE V3
4-
(see license below).
2+
SimpleIDE is licensed as GNU GENERAL PUBLIC LICENSE V3 (see below).
53
+---------------------------------------------------------------------
64
SimpleIDE
75
Copyright (c) 2012-2016 Parallax Inc.
86

9-
SimpleIDE repository: https://github.com/parallaxinc/propside
10-
Repository includes SimpleIDE, icons, and ctags sources.
11-
Openspin repository: https://github.com/parallaxinc/openspin
12-
Propeller-GCC repository: https://github.com/parallaxinc/propgcc (git checkout release_1_0)
13-
Proploader repository: https://github.com/dbetz/proploader
14-
Parallax Learn Library: https://github.com/parallaxinc/propsideworkspace
7+
Open Source Repository List:
8+
9+
- SimpleIDE: https://github.com/parallaxinc/propside
10+
Includes SimpleIDE, icons, and ctags sources.
11+
- Openspin: https://github.com/parallaxinc/openspin
12+
- Propeller-GCC: https://github.com/parallaxinc/propgcc
13+
(git checkout release_1_0)
14+
- Proploader: https://github.com/dbetz/proploader
15+
- Parallax Learn Library:
16+
https://github.com/parallaxinc/propsideworkspace
1517

1618
+---------------------------------------------------------------------
1719
This package and the works contained within it is copyrighted by various owners and licensed under various terms. Component licenses and license files are noted below. Each component and significant portions within must be used under the corresponding license terms.

propside/build.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#define SHOW_ASM_EXTENTION ".asm"
2929
#define SHOW_ASMC_EXTENTION ".asmc"
3030
#define SHOW_MAP_EXTENTION ".map"
31+
#define BUILDALL_MEMTYPE "buildalltype"
3132

3233
class Build : public QWidget
3334
{

propside/buildc.cpp

Lines changed: 55 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "properties.h"
2525
#include "asideconfig.h"
2626
#include "hintdialog.h"
27+
#include "directory.h"
2728

2829
BuildC::BuildC(ProjectOptions *projopts, QPlainTextEdit *compstat, QLabel *stat, QLabel *progsize, QProgressBar *progbar, QComboBox *cb, Properties *p)
2930
: Build(projopts, compstat, stat, progsize, progbar, cb, p)
@@ -40,14 +41,19 @@ int BuildC::runBuild(QString option, QString projfile, QString compiler)
4041
aSideCompiler = compiler;
4142
aSideCompilerPath = sourcePath(compiler);
4243

43-
if (ensureOutputDirectory() != 0)
44-
return -1;
45-
44+
setMemModel(projectOptions->getMemModel());
4645

4746
projName = shortFileName(projectFile).replace(".side", ".c");
4847
exeName = projName.mid(0, projName.lastIndexOf(".")) + ".elf";
48+
if (option.indexOf(BUILDALL_MEMTYPE) == 0) {
49+
model = option.mid(option.indexOf("=")+1);
50+
setMemModel(model);
51+
}
4952
exePath = outputPath + exeName;
5053

54+
if (ensureOutputDirectory() != 0)
55+
return -1;
56+
5157
QStringList clist;
5258
QFile file(projectFile);
5359
QString proj = "";
@@ -105,10 +111,10 @@ int BuildC::runBuild(QString option, QString projfile, QString compiler)
105111
compileStatus->appendPlainText(workspace+"\n");
106112
}
107113

108-
bool rebuild = false;
114+
bool rebuild = true;
109115

110-
if (projectOptions->getDependentBuild().length() == 0)
111-
rebuild = true;
116+
//if (projectOptions->getDependentBuild().length() == 0)
117+
// rebuild = true;
112118

113119
Qt::KeyboardModifiers keymods = QApplication::keyboardModifiers();
114120
if ((keymods & Qt::AltModifier) != 0)
@@ -118,14 +124,27 @@ int BuildC::runBuild(QString option, QString projfile, QString compiler)
118124

119125
if (!rebuild) {
120126
rebuild = isOutdated(localList, sourcePath(projectFile), sourcePath(projectFile)+exePath);
121-
status->setText(tr("Build not needed. Just loading ..."));
127+
status->setText(tr("Build not needed."));
122128
}
123129

124130
/* if a local source is out of date, rebuild all */
125131
if (rebuild)
126132
{
127133
status->setText(tr("Building ..."));
128134

135+
QString model = projectOptions->getMemModel();
136+
if (option.indexOf(BUILDALL_MEMTYPE) == 0) {
137+
model = option.mid(option.indexOf("=")+1);
138+
model = ">memtype="+model;
139+
option = "";
140+
for (int n = 0; n < list.length(); n++) {
141+
if(list[n].contains(">memtype")) {
142+
list[n] = model;
143+
break;
144+
}
145+
}
146+
}
147+
129148
showCompilerVersion();
130149

131150
foreach(QString item, list) {
@@ -1203,6 +1222,12 @@ int BuildC::getCompilerParameters(QStringList copts, QStringList *args)
12031222
//boardName = cbBoard->itemText(cbBoard->currentIndex());
12041223

12051224
QString model = projectOptions->getMemModel();
1225+
QString newmodel;
1226+
if (copts.at(0).contains(BUILDALL_MEMTYPE)) {
1227+
QString mopt = copts.at(0);
1228+
newmodel = mopt.mid(mopt.indexOf("=")+1);
1229+
copts.removeAt(0);
1230+
}
12061231
model = model.mid(0,model.indexOf(" ")); // anything after the first word is just description
12071232

12081233
if(copts.length() > 0) {
@@ -1372,12 +1397,34 @@ int BuildC::getCompilerParameters(QStringList copts, QStringList *args)
13721397
if(projectOptions->getStripElf().length())
13731398
args->append(projectOptions->getStripElf());
13741399

1400+
if (newmodel.length() > 0) {
1401+
for (int n = 0; n < args->length(); n++) {
1402+
QString item = args->at(n);
1403+
if (item.indexOf(model) == 0) {
1404+
item.replace(model,newmodel);
1405+
args->removeAt(n);
1406+
args->insert(n,item);
1407+
}
1408+
}
1409+
}
1410+
13751411
return args->length();
13761412
}
13771413

1414+
void BuildC::setMemModel(QString model)
1415+
{
1416+
memModel = model;
1417+
}
1418+
1419+
QString BuildC::getMemModel()
1420+
{
1421+
return memModel;
1422+
}
1423+
13781424
int BuildC::ensureOutputDirectory()
13791425
{
1380-
QString modelOption = projectOptions->getMemModel();
1426+
//QString modelOption = projectOptions->getMemModel();
1427+
QString modelOption = getMemModel();
13811428
model = modelOption.mid(0, modelOption.indexOf(" "));
13821429
model = model.replace("-","_");
13831430
outputPath = model + separator;
@@ -1414,8 +1461,6 @@ void BuildC::appendLoaderParameters(QString copts, QString file, QStringList *ar
14141461
//qDebug() << args;
14151462
}
14161463

1417-
#include <directory.h>
1418-
14191464
bool BuildC::isOutdated(QStringList srclist, QString srcpath, QString target)
14201465
{
14211466
QFile outfile(target);

propside/buildc.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ class BuildC : public Build
4848

4949
QStringList getCompilerParameters(QStringList copts);
5050
int getCompilerParameters(QStringList copts, QStringList *args);
51+
void setMemModel(QString model);
52+
QString getMemModel();
5153
int ensureOutputDirectory();
5254
void appendLoaderParameters(QString copts, QString projfile, QStringList *args);
5355

@@ -65,7 +67,7 @@ class BuildC : public Build
6567
QString outputPath;
6668
QString exePath;
6769
QString exeName;
68-
70+
QString memModel;
6971
};
7072

7173
#endif // BUILDC_H

propside/directory.cpp

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,3 +403,42 @@ QString Directory::recursiveFindFile(QString dir, QString findfile)
403403
}
404404
return QString("");
405405
}
406+
407+
int Directory::recursiveFindFileList(QString dir, QString findfile, QStringList &filelist)
408+
{
409+
QDir dpath(dir);
410+
QString file;
411+
412+
QStringList dlist;
413+
QStringList flist;
414+
415+
QRegExp regex(findfile,Qt::CaseInsensitive,QRegExp::Wildcard);
416+
417+
if(dir.length() < 1)
418+
return 0;
419+
420+
QChar sep = dir.at(dir.length()-1);
421+
if(sep != '/' && sep != '\\')
422+
dir += "/";
423+
424+
flist = dpath.entryList(QDir::AllEntries, QDir::DirsLast);
425+
foreach(file, flist) {
426+
if(file.compare(".") == 0)
427+
continue;
428+
if(file.compare("..") == 0)
429+
continue;
430+
// check for find string
431+
if(file.indexOf(regex) > -1) {
432+
filelist.append(dir+file);
433+
}
434+
}
435+
dlist = dpath.entryList(QDir::AllDirs, QDir::DirsLast);
436+
foreach(file, dlist) {
437+
if(file.compare(".") == 0)
438+
continue;
439+
if(file.compare("..") == 0)
440+
continue;
441+
recursiveFindFileList(dir+file, findfile, filelist);
442+
}
443+
return filelist.length();
444+
}

propside/directory.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class Directory
3636
static QStringList findCSourceList(QString file, QString find);
3737
static QString recursiveFind(QString dir, QString find);
3838
static QString recursiveFindFile(QString dir, QString file);
39+
static int recursiveFindFileList(QString dir, QString findfile, QStringList &filelist);
3940

4041
private:
4142
static bool isCSourceCommented(QString find, QString line, int num, QStringList lines);

propside/mainspinwindow.cpp

Lines changed: 83 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@
100100

101101
#define FileToSDCard "File to SD Card"
102102

103+
#define BuildAllLibraries "Build All Libraries"
104+
103105
/**
104106
* @brief g_ApplicationClosing
105107
* Some events like terminal processes can cause bad behaviour if someone exits the program.
@@ -5139,6 +5141,70 @@ void MainSpinWindow::updateWorkspace()
51395141
}
51405142
}
51415143

5144+
void MainSpinWindow::programBuildAllLibraries()
5145+
{
5146+
compileStatus->setPlainText("Build All Libraries?");
5147+
5148+
QString workspace = propDialog->getCurrentWorkspace();
5149+
QStringList files;
5150+
if (workspace.endsWith("/") == false) workspace += "/";
5151+
int rc = Directory::recursiveFindFileList(workspace+"Learn/Simple Libraries", "*.side", files);
5152+
if (rc == 0) return;
5153+
5154+
QStringList newfiles;
5155+
for (int n = 0; n < files.length(); n++) {
5156+
QString file = files[n];
5157+
if (file.indexOf("simpletext") > -1) {
5158+
newfiles.insert(0,file);
5159+
}
5160+
else if (file.indexOf("fdserial") > -1) {
5161+
newfiles.insert(1,file);
5162+
}
5163+
else if (file.indexOf("Protocol") > -1) {
5164+
newfiles.insert(1,file);
5165+
}
5166+
else if (file.indexOf("simpletools") > -1) {
5167+
newfiles.append(file);
5168+
}
5169+
}
5170+
5171+
for (int n = 0; n < files.length(); n++) {
5172+
QString file = files[n];
5173+
if (file.indexOf("simpletext") > -1) {
5174+
}
5175+
else if (file.indexOf("fdserial") > -1) {
5176+
}
5177+
else if (file.indexOf("Protocol") > -1) {
5178+
}
5179+
else if (file.indexOf("simpletools") > -1) {
5180+
}
5181+
else {
5182+
newfiles.append(file);
5183+
}
5184+
}
5185+
5186+
for (int n = 0; n < newfiles.length(); n++) {
5187+
compileStatus->appendPlainText(newfiles[n]);
5188+
}
5189+
5190+
int question = QMessageBox::question(this,tr("Build All Libraries?"), tr("Building all libraries can take hours.")+
5191+
"\n"+tr("Do you really want to build all libraries?"),QMessageBox::Yes,QMessageBox::No);
5192+
if(question != QMessageBox::Yes) {
5193+
return;
5194+
}
5195+
5196+
QStringList memtype;
5197+
memtype.append("lmm");
5198+
memtype.append("cmm");
5199+
foreach (QString model, memtype) {
5200+
foreach (QString file, newfiles) {
5201+
openProject(file);
5202+
int rc = runBuild(QString(BUILDALL_MEMTYPE)+"="+model);
5203+
if (rc > 0) return;
5204+
}
5205+
}
5206+
}
5207+
51425208
void MainSpinWindow::programStopBuild()
51435209
{
51445210
if(builder != NULL)
@@ -8570,7 +8636,7 @@ void MainSpinWindow::setupFileMenu()
85708636
#ifdef ENABLE_AUTO_PORT
85718637
toolsMenu->addAction(tr("Identify Propeller"), this, SLOT(findChip()), Qt::Key_F7);
85728638
#endif
8573-
QMenu *programMenu = new QMenu(tr("&Program"), this);
8639+
programMenu = new QMenu(tr("&Program"), this);
85748640
menuBar()->addMenu(programMenu);
85758641

85768642
#if 1
@@ -8606,6 +8672,7 @@ void MainSpinWindow::setupFileMenu()
86068672
#endif
86078673
programMenu->addAction(QIcon(":/images/console.png"), tr("Open Terminal"), this, SLOT(menuActionConnectButton()));
86088674
programMenu->addAction(QIcon(":/images/reset.png"), tr("Reset Port"), this, SLOT(portResetButton()));
8675+
programMenu->addAction(tr(BuildAllLibraries), this, SLOT(programBuildAllLibraries()), Qt::CTRL+Qt::ALT+Qt::Key_F12);
86098676

86108677
#if defined(GDBENABLE)
86118678
QMenu *debugMenu = new QMenu(tr("&Debug"), this);
@@ -8883,6 +8950,7 @@ void MainSpinWindow::showSimpleView(bool simple)
88838950
*/
88848951
QList <QAction*> fileMenuList = fileMenu->actions();
88858952
QList <QAction*> projMenuList = projMenu->actions();
8953+
QList <QAction*> progMenuList = programMenu->actions();
88868954

88878955
/* simple view */
88888956
if(simple)
@@ -8950,6 +9018,13 @@ void MainSpinWindow::showSimpleView(bool simple)
89509018
pa->setVisible(false);
89519019
}
89529020
}
9021+
foreach(QAction *pa, progMenuList) {
9022+
QString txt = pa->text();
9023+
if(txt != NULL) {
9024+
if(txt.contains(BuildAllLibraries))
9025+
pa->setVisible(false);
9026+
}
9027+
}
89539028
if(ctags->enabled()) {
89549029
browseToolBar->setVisible(false);
89559030
}
@@ -9010,6 +9085,13 @@ void MainSpinWindow::showSimpleView(bool simple)
90109085
pa->setVisible(true);
90119086
}
90129087
}
9088+
foreach(QAction *pa, progMenuList) {
9089+
QString txt = pa->text();
9090+
if(txt != NULL) {
9091+
if(txt.contains(BuildAllLibraries))
9092+
pa->setVisible(true);
9093+
}
9094+
}
90139095
if(ctags->enabled()) {
90149096
browseToolBar->setVisible(true);
90159097
}

propside/mainspinwindow.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ public slots:
167167
void properties();
168168
void propertiesAccepted();
169169

170+
void programBuildAllLibraries();
170171
void programStopBuild();
171172
void programBuild();
172173
void programBurnEE();
@@ -388,6 +389,7 @@ public slots:
388389
QMenu *fileMenu;
389390
QMenu *projMenu;
390391
QMenu *toolsMenu;
392+
QMenu *programMenu;
391393

392394
QSplitter *vsplit;
393395
QSplitter *leftSplit;

0 commit comments

Comments
 (0)