diff --git a/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java b/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java index 2bb4fad5d..5ae1bd991 100644 --- a/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java +++ b/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java @@ -66,8 +66,10 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.core.runtime.preferences.IEclipsePreferences; import org.eclipse.debug.core.DebugPlugin; @@ -278,7 +280,12 @@ private IBinary[] getBuildOutput(final IBinaryContainer binaries, final IPath ou public ICMakeToolChainFile getToolChainFile() throws CoreException { ICMakeToolChainManager manager = IDFCorePlugin.getService(ICMakeToolChainManager.class); - this.toolChainFile = manager.getToolChainFileFor(getToolChain()); + IToolChain toolChain = getToolChain(); + if (toolChain == null) + { + throw new CoreException(new Status(IStatus.ERROR, IDFCorePlugin.PLUGIN_ID, Messages.IDFToolChainsMissingErrorMsg)); + } + this.toolChainFile = manager.getToolChainFileFor(toolChain); return toolChainFile; } @@ -388,6 +395,8 @@ private boolean buildPrechecks(IConsole console) throws Exception return false; } + + return true; } diff --git a/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/Messages.java b/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/Messages.java index a38a424aa..52b468c4e 100644 --- a/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/Messages.java +++ b/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/Messages.java @@ -32,6 +32,7 @@ public class Messages extends NLS public static String ToolsInitializationDifferentPathMessageBoxTitle; public static String ToolsInitializationDifferentPathMessageBoxOptionYes; public static String ToolsInitializationDifferentPathMessageBoxOptionNo; + public static String IDFToolChainsMissingErrorMsg; public static String RefreshingProjects_JobName; diff --git a/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/messages.properties b/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/messages.properties index 64b830ab9..db0836990 100644 --- a/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/messages.properties +++ b/bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/messages.properties @@ -24,3 +24,4 @@ ToolsInitializationDifferentPathMessageBoxOptionYes=Use New Path ToolsInitializationDifferentPathMessageBoxOptionNo=Use Old Path RefreshingProjects_JobName=Refreshing Projects... IDFBuildConfiguration_PreCheck_DifferentIdfPath=The project was built using the ESP-IDF located at the {0} path.\nThe currently active ESP-IDF path in the IDE is {1}.\nPlease clean the project using "ESP-IDF:Project Full Clean" menu option to use the active ESP-IDF configuration. +IDFToolChainsMissingErrorMsg=Toolchains are missing. Please use ESP-IDF Manager for configuring \ No newline at end of file