Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit627ed69

Browse files
committed
Support for 1.6.6
1 parent545c8c2 commit627ed69

File tree

2 files changed

+46
-6
lines changed

2 files changed

+46
-6
lines changed

‎make.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ echo "INSTALLDIR: $INSTALLDIR"
77

88
pde_path=`find ../../.. -name pde.jar`
99
core_path=`find ../../.. -name arduino-core.jar`
10+
lib_path=`find ../../.. -name commons-codec-1.7.jar`
1011
if [[-z"$core_path"||-z"$pde_path" ]];then
1112
echo"Some java libraries have not been built yet (did you run ant build?)"
1213
return 1
@@ -15,7 +16,7 @@ fi
1516
set -e
1617

1718
mkdir -p bin
18-
javac -target 1.8 -cp"$pde_path:$core_path" \
19+
javac -target 1.8 -cp"$pde_path:$core_path:$lib_path" \
1920
-d bin src/ESP8266FS.java
2021

2122
pushd bin

‎src/ESP8266FS.java

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@
2626
importjava.io.File;
2727
importjava.io.BufferedReader;
2828
importjava.io.InputStreamReader;
29+
importjava.io.IOException;
2930

3031
importjava.text.SimpleDateFormat;
3132
importjava.util.Date;
32-
33+
importjava.lang.reflect.Field;
34+
importjava.lang.reflect.InvocationTargetException;
3335
importjavax.swing.JOptionPane;
3436

3537
importprocessing.app.PreferencesData;
@@ -38,10 +40,15 @@
3840
importprocessing.app.BaseNoGui;
3941
importprocessing.app.Platform;
4042
importprocessing.app.Sketch;
43+
importprocessing.app.SketchData;
4144
importprocessing.app.tools.Tool;
4245
importprocessing.app.helpers.ProcessUtils;
4346
importprocessing.app.debug.TargetPlatform;
4447

48+
importorg.apache.commons.codec.digest.DigestUtils;
49+
importprocessing.app.helpers.FileUtils;
50+
51+
importcc.arduino.files.DeleteFilesOnShutdown;
4552

4653
/**
4754
* Example Tools menu entry.
@@ -99,6 +106,36 @@ public void run() {
99106
thread.start();
100107
}
101108

109+
privateStringgetBuildFolderPath(Sketchs) {
110+
try {
111+
FilebuildFolder =FileUtils.createTempFolder("build",DigestUtils.md5Hex(s.getMainFilePath()) +".spiffs");
112+
DeleteFilesOnShutdown.add(buildFolder);
113+
returnbuildFolder.getAbsolutePath();
114+
}
115+
catch (IOExceptione) {
116+
editor.statusError(e);
117+
}
118+
catch (NoSuchMethodErrore) {
119+
// Arduino 1.6.5 doesn't have FileUtils.createTempFolder
120+
// String buildPath = BaseNoGui.getBuildFolder().getAbsolutePath();
121+
java.lang.reflect.Methodmethod;
122+
try {
123+
method =BaseNoGui.class.getMethod("getBuildFolder");
124+
Filef = (File)method.invoke(null);
125+
returnf.getAbsolutePath();
126+
}catch (SecurityExceptionex) {
127+
editor.statusError(ex);
128+
}catch (IllegalAccessExceptionex) {
129+
editor.statusError(ex);
130+
}catch (InvocationTargetExceptionex) {
131+
editor.statusError(ex);
132+
}catch (NoSuchMethodExceptionex) {
133+
editor.statusError(ex);
134+
}
135+
}
136+
return"";
137+
}
138+
102139

103140
privatelonggetIntPref(Stringname){
104141
Stringdata =BaseNoGui.getBoardPreferences().get(name);
@@ -150,7 +187,7 @@ private void createAndUpload(){
150187
mkspiffsCmd ="mkspiffs.exe";
151188
else
152189
mkspiffsCmd ="mkspiffs";
153-
190+
154191
Filetool =newFile(platform.getFolder() +"/tools",mkspiffsCmd);
155192
if (!tool.exists()) {
156193
tool =newFile(PreferencesData.get("runtime.tools.mkspiffs.path"),mkspiffsCmd);
@@ -162,7 +199,10 @@ private void createAndUpload(){
162199
}
163200

164201
intfileCount =0;
165-
FiledataFolder =editor.getSketch().prepareDataFolder();
202+
FiledataFolder =newFile(editor.getSketch().getFolder(),"data");
203+
if (!dataFolder.exists()) {
204+
dataFolder.mkdirs();
205+
}
166206
if(dataFolder.exists() &&dataFolder.isDirectory()){
167207
File[]files =dataFolder.listFiles();
168208
if(files.length >0){
@@ -176,8 +216,7 @@ private void createAndUpload(){
176216
StringtoolPath =tool.getAbsolutePath();
177217
StringesptoolPath =esptool.getAbsolutePath();
178218
StringsketchName =editor.getSketch().getName();
179-
StringbuildPath =BaseNoGui.getBuildFolder().getAbsolutePath();
180-
StringimagePath =buildPath+"/"+sketchName+".spiffs.bin";
219+
StringimagePath =getBuildFolderPath(editor.getSketch()) +"/" +sketchName +".spiffs.bin";
181220
StringserialPort =PreferencesData.get("serial.port");
182221
StringresetMethod =BaseNoGui.getBoardPreferences().get("upload.resetmethod");
183222
StringuploadSpeed =BaseNoGui.getBoardPreferences().get("upload.speed");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp