Closed gusmanb closed 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.
@gusmanb, This is the initial design for this feature:
I add a file (Spectrum.projconf
) to the project template using JSON format, which allows you to set several extra build options:
preBuild
: command to run before the Z80/BASIC compilation.postBuild
: command to run after the Z80/BASIC compilation.buildError
: command to run when any of the prebuild
, postBuild
, or compilation events fails. You can use this build action for cleanup activities.All of these events use command-line strings, and accept placeholders that are substituted with the corresponding values before issuing a command:
$(SolutionPath)
: Full path of the .sln file$(SolutionDir)
: Solution folder$(ProjectFile)
: Name of the project file (without path information)$(ProjectDir)
: Name of the project directory$(ProjectName)
: Name of the active project$(SourcePath)
: Full path of the main file being compiled$(SourceDir)
: Name of the directory in which the main file being compiled is storedCommands use the active project's root folder as their working directory.
Should any of these tasks fail, their output would be displayed in the Z80 Assembler
output window pane.
If you have any recommendations, share it with me! I plan to issue this feature in v2 Preview 5.
I think that will be more than enough 👍
@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.
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!
Perfect, I will test it this weekend and post a report.
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!
@gusmanb, thanks for the export functionality specification. I will work on it.
@gusmanb, here is the modified private build with the export tasks.
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 :-)
Perfect, i will test it tomorrow-
Cheers.
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!
@gusmanb, please check the newset build!
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
I'm tickled pink to implement features that make community members happier :-). Soon, I will release the next preview.
Released in v2 Preview 5.
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