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

New Project Wizard - copying files

(1/3) > >>

jimbo:
Hello all,

Writing a New Project Wizard. Need to be able to select a set of options using a multi select combo box (I can do that bit) which specifies which code files should be physically copied in to the project directories and added to the project files list, from a 'files' locations. I believe this files location should be under the folder the wizard.script file is in, but been trawling through various wizard.scripts files but not found what I need.

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? (They will be in a subfolder of the project itself if possible)

Jimbo

jimbo:
Forgot to ask, also need to be able to setup various debugger settings so the generated projects can immediately use OpenOCD. Not found any functions for setting debugger options in the Wiizard.script , so any information there would also be useful.

TIA

BlueHazzard:

--- Quote from: jimbo on November 02, 2018, 03:36:57 pm ---Forgot to ask, also need to be able to setup various debugger settings so the generated projects can immediately use OpenOCD. Not found any functions for setting debugger options in the Wiizard.script , so any information there would also be useful.

TIA

--- End quote ---
at the moment this is  not possible:
http://forums.codeblocks.org/index.php/topic,16852.msg149433.html#msg149433
https://sourceforge.net/p/codeblocks/tickets/513/

Maybe i find some time to fix this...
@obfuscated: are changes to the scripting interface still locked?

Can you list the options you want to change?

oBFusCATed:
The switch to scrat is frozen at the moment. The original changes you've made left the whole binding without proper error handling. I/we need to find a solution for this problem before continuing. But at the moment I don't have time/energy for it.

Also I'm not sure when I'll resume the work related to the removal of project hooks. Probably I should extract it from my branch with other changes.

BlueHazzard:

--- 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?

Navigation

[0] Message Index

[#] Next page

Go to full version