-
Notifications
You must be signed in to change notification settings - Fork 133
IEP-1089 , IEP-1062: Project Creation Page updated #846
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
7b2eb1d
dbb9ea6
692bc3f
2a61f62
177aeb5
001a800
1601a97
68a9caa
71e9020
d710d91
787fccd
70b89b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,10 @@ | |
| import org.eclipse.core.runtime.CoreException; | ||
| import org.eclipse.core.runtime.IProgressMonitor; | ||
| import org.eclipse.core.runtime.Path; | ||
| import org.eclipse.launchbar.core.ILaunchBarManager; | ||
| import org.eclipse.launchbar.core.target.ILaunchTarget; | ||
| import org.eclipse.launchbar.core.target.ILaunchTargetManager; | ||
| import org.eclipse.ui.console.MessageConsoleStream; | ||
| import org.osgi.framework.Bundle; | ||
|
|
||
| import com.espressif.idf.core.IDFConstants; | ||
|
|
@@ -37,12 +41,17 @@ public class IDFProjectGenerator extends CMakeProjectGenerator | |
|
|
||
| private File sourceTemplatePath; | ||
| private boolean copyIntoWorkspace; | ||
| private String target; | ||
| protected MessageConsoleStream console; | ||
| private ILaunchBarManager launchBarManager; | ||
|
|
||
| public IDFProjectGenerator(String manifestFile, File source, boolean copyIntoWorkspace) | ||
| public IDFProjectGenerator(String manifestFile, File source, boolean copyIntoWorkspace, String target) | ||
| { | ||
| super(manifestFile); | ||
| this.sourceTemplatePath = source; | ||
| this.copyIntoWorkspace = copyIntoWorkspace; | ||
| this.target = target; | ||
| launchBarManager = UIPlugin.getService(ILaunchBarManager.class); | ||
| } | ||
|
|
||
| @Override | ||
|
|
@@ -66,6 +75,9 @@ public void generate(Map<String, Object> model, IProgressMonitor monitor) throws | |
| Logger.log("Source Template path:" + sourceTemplatePath); //$NON-NLS-1$ | ||
| if (sourceTemplatePath == null) | ||
| { | ||
| setTarget(); | ||
| // refresh to see the copied resources in the project explorer | ||
| getProject().refreshLocal(IResource.DEPTH_INFINITE, monitor); | ||
| return; // let's go with the default generate | ||
| } | ||
alirana01 marked this conversation as resolved.
Show resolved
Hide resolved
alirana01 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
|
|
@@ -85,8 +97,37 @@ public void generate(Map<String, Object> model, IProgressMonitor monitor) throws | |
| } | ||
| } | ||
|
|
||
| setTarget(); | ||
|
|
||
| // refresh to see the copied resources in the project explorer | ||
| project.refreshLocal(IResource.DEPTH_INFINITE, monitor); | ||
|
|
||
| } | ||
|
|
||
| private void setTarget() throws CoreException | ||
| { | ||
| ILaunchTarget launchTarget = findSuitableTargetForSelectedTargetString(); | ||
| launchBarManager.setActiveLaunchTarget(launchTarget); | ||
| Logger.log(""); | ||
|
||
| } | ||
|
|
||
| private ILaunchTarget findSuitableTargetForSelectedTargetString() | ||
| { | ||
| ILaunchTargetManager launchTargetManager = UIPlugin.getService(ILaunchTargetManager.class); | ||
| ILaunchTarget[] targets = launchTargetManager | ||
| .getLaunchTargetsOfType("com.espressif.idf.launch.serial.core.serialFlashTarget"); //$NON-NLS-1$ | ||
|
||
|
|
||
| for (ILaunchTarget iLaunchTarget : targets) | ||
| { | ||
| String idfTarget = iLaunchTarget.getAttribute("com.espressif.idf.launch.serial.core.idfTarget", //$NON-NLS-1$ | ||
|
||
| null); | ||
| if (idfTarget.contentEquals(target)) | ||
| { | ||
| return iLaunchTarget; | ||
| } | ||
| } | ||
|
|
||
| return null; | ||
| } | ||
|
|
||
| @Override | ||
|
|
@@ -130,4 +171,5 @@ protected void copyIDFTemplateToWorkspace(String projectName, File sourceTemplat | |
| } | ||
| } | ||
| } | ||
|
|
||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.