Skip to content

Commit f5aa2c5

Browse files
author
jantje
committed
remove convenient method
1 parent 682a3c5 commit f5aa2c5

File tree

6 files changed

+18
-26
lines changed

6 files changed

+18
-26
lines changed

io.sloeber.core/src/io/sloeber/core/api/SloeberProject.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -477,16 +477,6 @@ private static void setEnvVars(ICConfigurationDescription confDesc, Map<String,
477477
}
478478
}
479479

480-
/**
481-
* get the Arduino project description based on a project description
482-
* Convenience method for getSloeberProject(project, false);
483-
*
484-
* @param project
485-
* @return
486-
*/
487-
public static synchronized SloeberProject getSloeberProject(IProject project) {
488-
return getSloeberProject(project, false);
489-
}
490480

491481
/**
492482
* get the Arduino project description based on a project description

io.sloeber.core/src/io/sloeber/core/tools/Libraries.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private static Map<String, IPath> findAllSubFolders(IPath ipath) {
113113
private static Map<String, IPath> findAllHarwareLibraries(ICConfigurationDescription confDesc) {
114114
Map<String, IPath> ret = new HashMap<>();
115115
IProject project = confDesc.getProjectDescription().getProject();
116-
SloeberProject sProject = SloeberProject.getSloeberProject(project);
116+
SloeberProject sProject = SloeberProject.getSloeberProject(project, false);
117117
BoardDescription boardDescriptor = sProject.getBoardDescription(confDesc, false);
118118
// first add the referenced
119119
IPath libPath = boardDescriptor.getReferencedLibraryPath();

io.sloeber.core/src/io/sloeber/core/tools/uploaders/UploadSketchWrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static public Job upload(IProject Project,
5656
private Job internalUpload(IProject project,
5757
ICConfigurationDescription confDesc) {
5858

59-
SloeberProject sProject = SloeberProject.getSloeberProject(project);
59+
SloeberProject sProject = SloeberProject.getSloeberProject(project, false);
6060
BoardDescription boardDescriptor = sProject.getBoardDescription(confDesc, false);
6161

6262
String UpLoadTool = boardDescriptor.getActualUploadTool();

io.sloeber.tests/src/io/sloeber/core/RegressionTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public void issue555() {
104104
e.printStackTrace();
105105
fail("Failed to compile the project:" + unoBoardid.getBoardName() + " as uno exception");
106106
}
107-
SloeberProject arduinoProject = SloeberProject.getSloeberProject(theTestProject);
107+
SloeberProject arduinoProject = SloeberProject.getSloeberProject(theTestProject, false);
108108
ICProjectDescription cProjectDescription = CCorePlugin.getDefault().getProjectDescription(theTestProject);
109109
arduinoProject.setBoardDescription(cProjectDescription.getActiveConfiguration(), teensyBoardid, true);
110110

@@ -348,7 +348,7 @@ public void openAndClosePreservesSettings() throws Exception {
348348

349349
// Read the data we want to test
350350
Shared.waitForAllJobsToFinish(); // for the indexer
351-
SloeberProject sloeberDesc = SloeberProject.getSloeberProject(theTestProject);
351+
SloeberProject sloeberDesc = SloeberProject.getSloeberProject(theTestProject, false);
352352
ICProjectDescription projDesc = CoreModel.getDefault().getProjectDescription(theTestProject);
353353
ICConfigurationDescription confDesc = projDesc.getActiveConfiguration();
354354
BoardDescription createdBoardDesc = sloeberDesc.getBoardDescription(confDesc, false);
@@ -363,7 +363,7 @@ public void openAndClosePreservesSettings() throws Exception {
363363
Shared.waitForAllJobsToFinish();
364364

365365
// read the data we want to test
366-
sloeberDesc = SloeberProject.getSloeberProject(theTestProject);
366+
sloeberDesc = SloeberProject.getSloeberProject(theTestProject, false);
367367
projDesc = CoreModel.getDefault().getProjectDescription(theTestProject);
368368
confDesc = projDesc.getActiveConfiguration();
369369
BoardDescription reopenedBoardDesc = sloeberDesc.getBoardDescription(confDesc, false);
@@ -448,13 +448,13 @@ public void openAndCloseUsesSavedSettings() throws Exception {
448448

449449
// Read the data we want to test
450450
Shared.waitForAllJobsToFinish(); // for the indexer
451-
SloeberProject proj1SloeberDesc = SloeberProject.getSloeberProject(proj1);
451+
SloeberProject proj1SloeberDesc = SloeberProject.getSloeberProject(proj1, false);
452452
ICProjectDescription proj1Desc = CoreModel.getDefault().getProjectDescription(proj1);
453453
ICConfigurationDescription proj1ConfDesc = proj1Desc.getActiveConfiguration();
454454
BoardDescription proj1CreatedBoardDesc = proj1SloeberDesc.getBoardDescription(proj1ConfDesc, false);
455455
CompileDescription proj1CreatedCompileDesc = proj1SloeberDesc.getCompileDescription(proj1ConfDesc, false);
456456

457-
SloeberProject proj2SloeberDesc = SloeberProject.getSloeberProject(proj2);
457+
SloeberProject proj2SloeberDesc = SloeberProject.getSloeberProject(proj2, false);
458458
ICProjectDescription proj2Desc = CoreModel.getDefault().getProjectDescription(proj2);
459459
ICConfigurationDescription proj2ConfDesc = proj2Desc.getActiveConfiguration();
460460
BoardDescription proj2CreatedBoardDesc = proj2SloeberDesc.getBoardDescription(proj2ConfDesc, false);
@@ -482,7 +482,7 @@ public void openAndCloseUsesSavedSettings() throws Exception {
482482
Shared.waitForAllJobsToFinish();
483483

484484
// reread project 2
485-
proj2SloeberDesc = SloeberProject.getSloeberProject(proj2);
485+
proj2SloeberDesc = SloeberProject.getSloeberProject(proj2, false);
486486
proj2Desc = CoreModel.getDefault().getProjectDescription(proj2);
487487
proj2ConfDesc = proj2Desc.getActiveConfiguration();
488488
BoardDescription proj2OpenedBoardDesc = proj2SloeberDesc.getBoardDescription(proj2ConfDesc, false);

io.sloeber.ui/src/io/sloeber/ui/actions/OpenSerialMonitorHandler.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,15 @@ public Object execute(ExecutionEvent event) throws ExecutionException {
4343
for (IProject curproject : SelectedProjects) {
4444
int baud = Sketch.getCodeBaudRate(curproject);
4545
if (baud > 0) {
46-
SloeberProject sProject=SloeberProject.getSloeberProject(curproject);
47-
ICConfigurationDescription activeConf = CoreModel.getDefault().getProjectDescription(curproject)
48-
.getActiveConfiguration();
49-
BoardDescription boardDescription = sProject.getBoardDescription(activeConf, false);
50-
String comPort = boardDescription.getUploadPort();
51-
if (!comPort.isEmpty()) {
52-
io.sloeber.ui.monitor.SerialConnection.add(comPort, baud);
46+
SloeberProject sProject = SloeberProject.getSloeberProject(curproject, true);
47+
if (sProject != null) {
48+
ICConfigurationDescription activeConf = CoreModel.getDefault()
49+
.getProjectDescription(curproject).getActiveConfiguration();
50+
BoardDescription boardDescription = sProject.getBoardDescription(activeConf, false);
51+
String comPort = boardDescription.getUploadPort();
52+
if (!comPort.isEmpty()) {
53+
io.sloeber.ui.monitor.SerialConnection.add(comPort, baud);
54+
}
5355
}
5456
}
5557
}

io.sloeber.ui/src/io/sloeber/ui/project/properties/SloeberCpropertyTab.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public void createControls(Composite parent, ICPropertyProvider provider) {
4848
// This is needed so that when a copy is made
4949
// the root compile description is known
5050
ICProjectDescription projDesc = getConfdesc().getProjectDescription();
51-
mySloeberProject = SloeberProject.getSloeberProject(projDesc.getProject());
51+
mySloeberProject = SloeberProject.getSloeberProject(projDesc.getProject(), false);
5252
for (ICConfigurationDescription curConfig : projDesc.getConfigurations()) {
5353
Object description = getFromSloeber(curConfig);
5454
if (description == null) {

0 commit comments

Comments
 (0)