Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

New Project Wizard - copying files

<< < (2/3) > >>

oBFusCATed:

--- Quote from: BlueHazzard on November 04, 2018, 11:50:23 pm ---@oBFusCATed
So is this a no or a go for the api changes to the script binding? Probably not before the next release?

--- End quote ---
It is fine to add stuff to the script bindings. We'll have to do some conflict resolving, but this is inevitable anyway.
But keep in mind that the project hooks aren't a good design and it is not really a good idea to expose them to scripting.

jimbo:

--- Quote from: BlueHazzard on November 04, 2018, 11:50:23 pm ---
--- Quote ---I am sure its obvious, but any hints? Are there functions to do this, is anything done automagically, do I have to simply grab the source file folder from somewhere, and use scripts to manually copy everything to the Projects folder?
--- End quote ---

The Wizard "asks" you for the file to generate in

--- Code: ---function GetGeneratedFile(file_index)
--- End code ---
function. As described you have to return the filename and content with the syntax:

--- Code: ---filename.ext;contents
--- End code ---
The variable index is incremented automatically on each call, so you can go trough an array of your files.
If you have templates you have to read them and return the content from this function

--- Code: ---    local path = Wizard.FindTemplateFile("YourTemplateFileName");
    local buffer = IO.ReadFileContents(path);
--- End code ---
You can modify the content of the file before you return it.

The function

--- Code: ---Wizard.FindTemplateFile
--- End code ---

Will search for the filename in the
--- Quote ---/templates/wizard/
--- End quote ---
sub folder. So you should put your template files in a  subfolder of these path. Ofc you have to add this subfolder to the name you provide to the FindTemplateFile function.

I hope this helps a bit...

@oBFusCATed
So is this a no or a go for the api changes to the script binding? Probably not before the next release?

--- End quote ---

Thanks.

So the process is :

Put all the requried template files in templates/wizard/jimbo/blahblah

In the script file GetGeneratedFile(idx)
   FindtemplateFile
   IO.ReadFileContents(path)
   Add required destintation file name to front of the file string read in.
   return that new string.
   If finished, return empty string.

Is this sort of process that could/should be in the common scripts file?


I see from the posts above that there are some gaps in the areas we would like to use (setting up debugger is one, we also need a functioning SVD dialog). I do not know who the lead developers are on Code::Blocks, but our company would likely be interested in funding development of any missing features that we are unable to add ourselves. Obviously experienced C::B developers are going to be able to produce results more quickly than we would be able to achieve internally, although we would be throwing resource at this. Who would I need to talk to about that? Would need all this stuff by Q2/3 next year or thereabouts.

oBFusCATed:
I'm available for doing patch reviews and guidance how to implement something. If you're going to change something in Code::Blocks it is better to ask first if the direction is good, so there is a change that your modification would be accepted.

I'm not sure if I'll be available to do feature implementations next year.

jimbo:

--- Quote from: oBFusCATed on November 09, 2018, 07:07:24 pm ---I'm available for doing patch reviews and guidance how to implement something. If you're going to change something in Code::Blocks it is better to ask first if the direction is good, so there is a change that your modification would be accepted.

I'm not sure if I'll be available to do feature implementations next year.

--- End quote ---

OK, thanks for getting back to me. I'm definitely going to be needing some pointers, but hopefully that will be enough to get the team here up to speed so we can make our own changes. We will of course run them by the devs here to make sure what we do is acceptable upstream  -we would want the work done to expand the feature set of CB for all, not just us. There's likely to be some GUI tidying up work, plus getting good SVD support and improving the New project stuff to allow debugger setup in project wizards.

oBFusCATed:
The remote debugging feature have been committed.
See these two links:
* https://sourceforge.net/p/codeblocks/tickets/512/#fcab
* http://forums.codeblocks.org/index.php/topic,16852.msg159912.html#msg159912

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version