Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ public class Messages extends NLS
public static String NewProjectHandler_PathErrorTitle;
public static String LanguageChange_ErrorTitle;
public static String LanguageChange_ErrorMessage;
public static String ProjectCleanCommandHandler_RunningProjectCleanJobName;
public static String ProjectFullCleanCommandHandler_RunningFullcleanJobName;
public static String PythonCleanCommandHandler_RunningPythonCleanJobName;
public static String UpdateEspIdfCommand_JobMsg;
public static String UpdateEspIdfCommand_InstallToolsJobMsg;
public static String UpdateEspIdfCommand_SuggestToOpenInstallToolsWizard;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public Object execute(ExecutionEvent event) throws ExecutionException

commands.add("clean"); //$NON-NLS-1$
Map<String, String> envMap = new IDFEnvironmentVariables().getSystemEnvMap();
console.println(commands.toString());
console.print((runCommand(commands, pathToProject, envMap)));
runCommandInNewJob(Messages.ProjectCleanCommandHandler_RunningProjectCleanJobName, commands, pathToProject,
envMap);
return event;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ public Object execute(ExecutionEvent event) throws ExecutionException
}
commands.add("fullclean"); //$NON-NLS-1$
Map<String, String> envMap = new IDFEnvironmentVariables().getSystemEnvMap();
console.println(commands.toString());
console.print((runCommand(commands, pathToProject, envMap)));
runCommandInNewJob(Messages.ProjectFullCleanCommandHandler_RunningFullcleanJobName, commands, pathToProject, envMap);
return event;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ public Object execute(ExecutionEvent event) throws ExecutionException
}
commands.add("python-clean"); //$NON-NLS-1$
Map<String, String> envMap = new IDFEnvironmentVariables().getSystemEnvMap();
console.println(commands.toString());
console.print((runCommand(commands, pathToProject, envMap)));
runCommandInNewJob(Messages.PythonCleanCommandHandler_RunningPythonCleanJobName, commands, pathToProject, envMap);
return event;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ NewProjectHandler_CouldntFindTools=Could't find installed tools path for GIT and
NewProjectHandler_MandatoryMsg=This is a mandatory step even if you've already installed the tools from the command line. Do you want to install the missing tools now?
NewProjectHandler_NavigateToHelpMenu=Please navigate to menu `Help > ESP-IDF Tools Manager > Install Tools` to install and configure the required paths for creating and building the ESP-IDF projects. \n \n
NewProjectHandler_PathErrorTitle=Path Error
ProjectCleanCommandHandler_RunningProjectCleanJobName=Running Project Clean...
ProjectFullCleanCommandHandler_RunningFullcleanJobName=Running fullclean...
PythonCleanCommandHandler_RunningPythonCleanJobName=Running python-clean command...
UpdateEspIdfCommand_JobMsg=Updating ESP-IDF master...
UpdateEspIdfCommand_InstallToolsJobMsg=Installing tools...
UpdateEspIdfCommand_SuggestToOpenInstallToolsWizard = A new set of tools might be required to install. Do you want to open the Install Tools dialog?
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.console.MessageConsoleStream;
Expand Down Expand Up @@ -161,7 +163,7 @@ protected IStatus runCommand(List<String> arguments, MessageConsoleStream consol

Map<String, String> environment = new HashMap<>(System.getenv());
Logger.log(environment.toString());
environment.put("PYTHONUNBUFFERED", "1");
environment.put("PYTHONUNBUFFERED", "1"); //$NON-NLS-1$ //$NON-NLS-2$

if (gitExecutablePath != null)
{
Expand Down Expand Up @@ -216,7 +218,7 @@ private IStatus processData(Process process)
return Status.OK_STATUS;
}

return new Status(IStatus.ERROR, IDFCorePlugin.PLUGIN_ID, "Error");
return new Status(IStatus.ERROR, IDFCorePlugin.PLUGIN_ID, "Error"); //$NON-NLS-1$

}
catch (InterruptedException e)
Expand Down Expand Up @@ -294,6 +296,23 @@ else if (!StringUtil.isEmpty(path2) && !path2.contains(gitDir)) // Git not found
}
}

protected void runCommandInNewJob(String jobName, List<String> commandArgs, Path pathToProject,
Map<String, String> envMap)
{
Job job = new Job(jobName)
{

protected IStatus run(IProgressMonitor monitor)
{
console.println(String.format(Messages.AbstractToolsHandler_RunningCommandFormatString,
String.join(" ", commandArgs))); //$NON-NLS-1$
console.println((runCommand(commandArgs, pathToProject, envMap)));
return Status.OK_STATUS;
}
};
job.schedule();
}

protected String getCommandString(List<String> arguments)
{
StringBuilder builder = new StringBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class Messages extends NLS
{
private static final String BUNDLE_NAME = "com.espressif.idf.ui.update.messages"; //$NON-NLS-1$
public static String AbstractToolsHandler_ExecutingMsg;
public static String AbstractToolsHandler_RunningCommandFormatString;
public static String DirectorySelectionDialog_Browse;
public static String DirectorySelectionDialog_CantbeEmpty;
public static String DirectorySelectionDialog_CheckTools;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Use is subject to license terms.
###############################################################################
AbstractToolsHandler_ExecutingMsg=Executing
AbstractToolsHandler_RunningCommandFormatString=Running command: %s
DirectorySelectionDialog_Browse=Browse...
DirectorySelectionDialog_CantbeEmpty=Fields can't be empty\!
DirectorySelectionDialog_CheckTools=Check Tools
Expand Down