mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-01 23:29:28 +01:00
Added --preserve-temp-files command line option
This commit is contained in:
parent
3465fcf97b
commit
96c4576962
@ -404,6 +404,7 @@ public class Base {
|
|||||||
// Set verbosity for command line build
|
// Set verbosity for command line build
|
||||||
Preferences.set("build.verbose", "" + parser.isDoVerboseBuild());
|
Preferences.set("build.verbose", "" + parser.isDoVerboseBuild());
|
||||||
Preferences.set("upload.verbose", "" + parser.isDoVerboseUpload());
|
Preferences.set("upload.verbose", "" + parser.isDoVerboseUpload());
|
||||||
|
Preferences.set("runtime.preserve.temp.files", Boolean.toString(parser.isPreserveTempFiles()));
|
||||||
|
|
||||||
// Make sure these verbosity preferences are only for the
|
// Make sure these verbosity preferences are only for the
|
||||||
// current session
|
// current session
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package cc.arduino.files;
|
package cc.arduino.files;
|
||||||
|
|
||||||
|
import processing.app.PreferencesData;
|
||||||
import processing.app.helpers.FileUtils;
|
import processing.app.helpers.FileUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -27,6 +28,10 @@ public class DeleteFilesOnShutdown implements Runnable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
boolean preserveTempFiles = PreferencesData.getBoolean("runtime.preserve.temp.files");
|
||||||
|
if (preserveTempFiles) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
List<File> copyOfFiles;
|
List<File> copyOfFiles;
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
copyOfFiles = new LinkedList<File>(files);
|
copyOfFiles = new LinkedList<File>(files);
|
||||||
|
@ -36,6 +36,7 @@ public class CommandlineParser {
|
|||||||
private boolean doVerboseBuild = false;
|
private boolean doVerboseBuild = false;
|
||||||
private boolean doVerboseUpload = false;
|
private boolean doVerboseUpload = false;
|
||||||
private boolean doUseProgrammer = false;
|
private boolean doUseProgrammer = false;
|
||||||
|
private boolean preserveTempFiles;
|
||||||
private boolean noUploadPort = false;
|
private boolean noUploadPort = false;
|
||||||
private boolean forceSavePrefs = false;
|
private boolean forceSavePrefs = false;
|
||||||
private String getPref;
|
private String getPref;
|
||||||
@ -105,6 +106,12 @@ public class CommandlineParser {
|
|||||||
action = ACTION.NOOP;
|
action = ACTION.NOOP;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (args[i].equals("--preserve-temp-files")) {
|
||||||
|
preserveTempFiles = true;
|
||||||
|
if (action == ACTION.GUI)
|
||||||
|
action = ACTION.NOOP;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (args[i].equals("--verbose-build")) {
|
if (args[i].equals("--verbose-build")) {
|
||||||
doVerboseBuild = true;
|
doVerboseBuild = true;
|
||||||
if (action == ACTION.GUI)
|
if (action == ACTION.GUI)
|
||||||
@ -330,4 +337,8 @@ public class CommandlineParser {
|
|||||||
public String getLibraryToInstall() {
|
public String getLibraryToInstall() {
|
||||||
return libraryToInstall;
|
return libraryToInstall;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isPreserveTempFiles() {
|
||||||
|
return preserveTempFiles;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ SYNOPSIS
|
|||||||
--------
|
--------
|
||||||
*arduino* ['FILE.ino'...]
|
*arduino* ['FILE.ino'...]
|
||||||
|
|
||||||
*arduino* [*--verify*|*--upload*] [*--board* __package__:__arch__:__board__[:__parameters__]] [*--port* __portname__] [*--pref* __name__=__value__] [*-v*|*--verbose*] [__FILE.ino__]
|
*arduino* [*--verify*|*--upload*] [*--board* __package__:__arch__:__board__[:__parameters__]] [*--port* __portname__] [*--pref* __name__=__value__] [*-v*|*--verbose*] [--preserve-temp-files] [__FILE.ino__]
|
||||||
|
|
||||||
*arduino* [*--get-pref* __preference__]
|
*arduino* [*--get-pref* __preference__]
|
||||||
|
|
||||||
@ -117,6 +117,10 @@ OPTIONS
|
|||||||
verbose mode during build is *disabled* regardless of the current
|
verbose mode during build is *disabled* regardless of the current
|
||||||
preferences.
|
preferences.
|
||||||
|
|
||||||
|
*--preserve-temp-files*::
|
||||||
|
Keep temporary files (preprocessed sketch, object files...) after termination.
|
||||||
|
If omitted, temporary files are deleted.
|
||||||
|
|
||||||
{empty}::
|
{empty}::
|
||||||
This option is only valid together with *--verify* or
|
This option is only valid together with *--verify* or
|
||||||
*--upload*.
|
*--upload*.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user