mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-19 08:52:15 +01:00
Randomize the the build path name
Previously, this used a hash of the sketch filename, so the same build path would be generated for the same sketch between multiple compilations. Now that the build path is stored, this requirement has disappeared, so a random filename can be generated again. While here, this commit also changes the prefix from "build" to "arduino_build_", which makes it a bit more clear what the directory's purpose is.
This commit is contained in:
parent
4f0af2af57
commit
59b70c8373
@ -7,8 +7,6 @@ import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
|
||||
import cc.arduino.files.DeleteFilesOnShutdown;
|
||||
import processing.app.helpers.FileUtils;
|
||||
|
||||
@ -174,7 +172,7 @@ public class Sketch {
|
||||
*
|
||||
* This takes into account the build.path preference. If it is set,
|
||||
* that path is always returned, and the directory is *not* deleted on
|
||||
* shutdown. If the preference is not set, a pathname in a
|
||||
* shutdown. If the preference is not set, a random pathname in a
|
||||
* temporary directory is generated, which is automatically deleted on
|
||||
* shutdown.
|
||||
*/
|
||||
@ -184,7 +182,7 @@ public class Sketch {
|
||||
buildPath = BaseNoGui.absoluteFile(PreferencesData.get("build.path"));
|
||||
Files.createDirectories(buildPath.toPath());
|
||||
} else {
|
||||
buildPath = FileUtils.createTempFolder("build", DigestUtils.md5Hex(getMainFilePath()) + ".tmp");
|
||||
buildPath = FileUtils.createTempFolder("arduino_build_");
|
||||
DeleteFilesOnShutdown.add(buildPath);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user