mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-14 12:49:28 +00:00
ATL-74: Added Export compiled Binary.
Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
@@ -23,7 +23,7 @@ export class CoreServiceImpl implements CoreService {
|
||||
@inject(NotificationServiceServer)
|
||||
protected readonly notificationService: NotificationServiceServer;
|
||||
|
||||
async compile(options: CoreService.Compile.Options): Promise<void> {
|
||||
async compile(options: CoreService.Compile.Options & { exportBinaries: boolean }): Promise<void> {
|
||||
this.outputService.append({ name: 'compile', chunk: 'Compile...\n' + JSON.stringify(options, null, 2) + '\n--------------------------\n' });
|
||||
const { sketchUri, fqbn } = options;
|
||||
const sketchFilePath = FileUri.fsPath(sketchUri);
|
||||
@@ -42,6 +42,7 @@ export class CoreServiceImpl implements CoreService {
|
||||
compilerReq.setPreprocess(false);
|
||||
compilerReq.setVerbose(options.verbose);
|
||||
compilerReq.setQuiet(false);
|
||||
compilerReq.setExportBinaries(options.exportBinaries);
|
||||
|
||||
const result = client.compile(compilerReq);
|
||||
try {
|
||||
@@ -74,7 +75,7 @@ export class CoreServiceImpl implements CoreService {
|
||||
responseHandler: (client: ArduinoCoreClient, req: UploadReq | UploadUsingProgrammerReq) => ClientReadableStream<UploadResp | UploadUsingProgrammerResp>,
|
||||
task: string = 'upload'): Promise<void> {
|
||||
|
||||
await this.compile(options);
|
||||
await this.compile(Object.assign(options, { exportBinaries: false }));
|
||||
const chunk = firstToUpperCase(task) + '...\n';
|
||||
this.outputService.append({ name: 'upload', chunk: chunk + JSON.stringify(options, null, 2) + '\n--------------------------\n' });
|
||||
const { sketchUri, fqbn, port, programmer } = options;
|
||||
|
||||
@@ -329,8 +329,8 @@ void loop() {
|
||||
const { client } = await this.coreClient();
|
||||
const archivePath = FileUri.fsPath(destinationUri);
|
||||
// The CLI cannot override existing archives, so we have to wipe it manually: https://github.com/arduino/arduino-cli/issues/1160
|
||||
if (await fs.exists(archivePath)) {
|
||||
await fs.unlink(archivePath);
|
||||
if (await promisify(fs.exists)(archivePath)) {
|
||||
await promisify(fs.unlink)(archivePath);
|
||||
}
|
||||
const req = new ArchiveSketchReq();
|
||||
req.setSketchPath(FileUri.fsPath(sketch.uri));
|
||||
|
||||
Reference in New Issue
Block a user