Added sketch structure check to the build method of Compile.

This commit is contained in:
Claudio Indellicati 2014-08-22 16:24:51 +02:00 committed by Cristian Maglie
parent 5db851cf9f
commit 1c8a4e9f58
1 changed files with 4 additions and 0 deletions

View File

@ -83,6 +83,10 @@ public class Compiler implements MessageConsumer {
private ProgressListener progressListener;
static public String build(SketchData data, String buildPath, File tempBuildFolder, ProgressListener progListener, boolean verbose) throws RunnerException {
if (!SketchData.checkSketchFile(data.getPrimaryFile()))
BaseNoGui.showError(_("Bad file selected"),
_("Bad sketch primary file or bad sketck directory structure"), null);
String primaryClassName = data.getName() + ".cpp";
Compiler compiler = new Compiler(data, buildPath, primaryClassName);
File buildPrefsFile = new File(buildPath, BUILD_PREFS_FILE);