Closed pingdynasty closed 2 years ago
ok so I'm thinking we'd probably be looking at adding a new property to the patch object known as type? or fileType ? or language ? (incase type is too generic, whatever you think is best) and then we need to pass that through to the compiler, or rather the compiler needs to read that prop off the patch rather than the file extension. but use the file extension if no type prop is present to support legacy patches which are already in the db?
Yes that sounds about right - let's call it compilationType
.
The API handler should be updated to read the property and pass the right option to the build script.
As a first stage we just need to see if the property is available and set to 'gen', and add '-gen' to the build command if true.
I've just checked in the build script changes to accept '-gen': https://github.com/pingdynasty/OwlServer/blob/dev/web/scripts/patch-builder/patch-builder.php
For the UI, I have an 'ideal' solution in mind and a simple one. The simple solution simply adds a drop-down to the Create Patch form. The ideal solution hides the drop down until a file has been added, then shows it with the value set according to the uploaded file suffix. So for most situations no additional user interaction is needed.
The Edit form doesn't have to be updated with compilation type until it is rewritten in the SPA.
ok, yes makes sense, I think I had something similar in mind too.
what would the list of valid compilationTypes be?
Compilation display name and type:
what would be the file extensions for each, (as we're trying to auto detect) ?
Default: cpp
.pd
: pd
.dsp
: faust
gen can only be selected manually
done
At the moment the patch type (faust, c++ or heavy) is determined by the build script based on file suffix. To support other compilation types (e.g. gen) and mixed compilation the user should have the option of setting a patch type, from one of C++, FAUST, Heavy or Gen.