Author Topic: Command line Visual studio project conversion to the cbp  (Read 5325 times)

Offline Tomas

  • Single posting newcomer
  • *
  • Posts: 3
Command line Visual studio project conversion to the cbp
« on: January 09, 2013, 01:28:12 am »
Hello,
is it possible to convert through command line Visual studio project to the cbp?
(codeblocks --help does not show such possibility)

Tomas

P.S.
I have a huge amount (>100) of the workspace in the VC environment and would like
to start using code::blocks in the parallel way with the VC.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Command line Visual studio project conversion to the cbp
« Reply #1 on: January 09, 2013, 09:09:24 am »
is it possible to convert through command line Visual studio project to the cbp?
(codeblocks --help does not show such possibility)
Not really. There is no 1:1 silent conversion, but you are guided through the process for good reasons. So its interactive, but what you can do it to open the WS via command line -  this might work (never tried though). Then you can batch-process the projects interactively.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Tomas

  • Single posting newcomer
  • *
  • Posts: 3
Re: Command line Visual studio project conversion to the cbp
« Reply #2 on: January 26, 2013, 01:33:07 am »
is it possible to convert through command line Visual studio project to the cbp?
(codeblocks --help does not show such possibility)
Not really. There is no 1:1 silent conversion, but you are guided through the process for good reasons. So its interactive, but what you can do it to open the WS via command line -  this might work (never tried though). Then you can batch-process the projects interactively.
no it does not work, because of the:
CodeBlocksApp::ParseCmdLine
else if (ft == ftCodeBlocksWorkspace
else if (ft == ftCodeBlocksProject statements.

I've tried to modify sources in the straight way:
extended the if statements with the ftMSVC6Project, ftMSVC6Workspace  and etc.
A.
At least with the attached patch msw project/workspace is opened in the codeblocks with the messages:
codeblocks.exe my_project.dsp
1. Are you sure do you want to OWERWRITE it?
2. Select Compiler
3. Select configurations
4. 1. Are you sure do you want to OWERWRITE it? (again same message)
5. Select Compiler (again same message)
6. Select configurations (again same message)
B.
if I try this:
codeblocks.exe --build my_project.dsp
MainFrame::OpenGeneric do not receive the converted project and does the default call:
cbMimePlugin* plugin = Manager::Get()->GetPluginManager()->GetMIMEHandlerForFile(filename);

basically I want to have something like: (in the silent way)
codeblocks.exe --convert my_project.dsp my_project.cbp

Probably I am in the wrong way with the modifications in the CodeBlocksApp::ParseCmdLine.
I think ProjectImporter plugin somehow should be modified to parse the command line parameters.
Could you give me some hints howto parse command line inside the plugin?
 

anon

  • Guest
Re: Command line Visual studio project conversion to the cbp
« Reply #3 on: January 26, 2013, 10:32:46 am »
Hi there,

Maybe I can help, I did something like that some time back. You can obtain the command line parser from Manager in a plugin like:
wxCmdLineParser& parser = *Manager::Get()->GetCmdLineParser();
(or was it:
wxCmdLineParser& parser = *Manager::GetCmdLineParser();
)???

I think there is a cbEVT_APP_STARTUP_DONE event (or alike) which you can connect to and then parse the additional command line options from the importer plugin and react as needed.

But I think it should be done from within the plugin, not the main app as your patch looks like this. Maybe the developers can tell more.