Dotneteer / spectnetide

ZX Spectrum IDE with Visual Studio 2017 and 2019 integration
MIT License
206 stars 27 forks source link

Request: add postbuild phase #171

Closed gusmanb closed 4 years ago

gusmanb commented 4 years ago

Hi.

I'm using the export function to create a .hex file, then parse it, create a byte array and use it on an arduino as a virtual ROM for the spectrum.

Each time I modify it I must export it, execute the conversion program and copy it to the arduino project. It would be very nice to have prebuild/postbuild actions in order to automate this, like the ones that Visual Studio provides.

Cheers

Dotneteer commented 4 years ago

@gusmanb, in SpectNetIDE I do not use the VS build infrastructure. Nonetheless, I review the design to find a way for implementing prebuild and postbuild actions.

Dotneteer commented 4 years ago

@gusmanb, This is the initial design for this feature:

If you have any recommendations, share it with me! I plan to issue this feature in v2 Preview 5.

gusmanb commented 4 years ago

I think that will be more than enough 👍

Dotneteer commented 4 years ago

@gusmanb, Here is the private build of v2 Preview 5 that implements this feature and fixes the debugging bugs. Please, rename the .zip file to .vsix so that you can install it.

Spect.Net.VsPackage.zip

You can find a quick summary about build tasks here: https://dotneteer.github.io/spectnetide/getting-started/build-tasks#article

Please, share your feedback with me!

gusmanb commented 4 years ago

Perfect, I will test it this weekend and post a report.

gusmanb commented 4 years ago

Hi.

I have been tested the new functionality and I think it needs two more phases: preExport and postExport.

When VS compiles a regular project the postBuild phase allows you to manipulate the end results, per example you can grab the binary files, move those to other folder and launch it. In SpectNetIDE this doesn't works this way as building doesn't creates the final output files, it happens when you export it as a tape or HEX file, so to allow this it will need that extra steps. I have checked and the preBuild and postBuild phases are executed before the export is executed so it's not possible to mimic this behavior with the current phases. Also it will need the corresponding vars to access the export info: $(ExportFile) and $(ExportPath)

Besides that the current phases are working correctly .

Cheers!

Dotneteer commented 4 years ago

@gusmanb, thanks for the export functionality specification. I will work on it.

Dotneteer commented 4 years ago

@gusmanb, here is the modified private build with the export tasks.

Spect.Net.VsPackage.zip

Please note, it has exactly the same version number as the previous private beta, so probably you should uninstall that before setting up this new build. Also (as you can read in the modified documentation: https://dotneteer.github.io/spectnetide/getting-started/build-tasks), the new macro names are $(ExportPath), and $(ExportDir), respectively, for the sake of consistency.

I'm waiting for your feedback :-)

gusmanb commented 4 years ago

Perfect, i will test it tomorrow-

Cheers.

gusmanb commented 4 years ago

Hi.

I have tested and it works perfectly. Sorry to be a pain in the ass but... could you add the $(ExportFile) variable (exported file name without path)? It will make easier to automate tasks.

Cheers!

Dotneteer commented 4 years ago

@gusmanb, please check the newset build!

Spect.Net.VsPackage.zip

gusmanb commented 4 years ago

Tested and working.

I've been all night working with the postbuild phases and it's wonderful how much time it saves. I have four virtual roms that I created with SpectNetIDE, these roms are loaded on the arduino firmware and then through serial commands I enable one of the four depending on what I need to do (these are to load exported .hex files from SpectNetIDE, load .SNA and .Z80 and tonight I was developing the one to create snapshots). Before the export facility each time I needed to modify a rom I had to export it to a folder, open a terminal on the path, launch a program I have done that converts .hex files into C++ headers and incorporate the changes to the final project, now with this I just click "export" and it's done.

Seriously, thanks a lot :D

Dotneteer commented 4 years ago

I'm tickled pink to implement features that make community members happier :-). Soon, I will release the next preview.

Dotneteer commented 4 years ago

Released in v2 Preview 5.