[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Call a custom preprocessor and display its results in console

Yes the thing is that I want to make it so every project that is created from my Custom Template Project will use that script in order to call the preprocessor. That's why I looked into the buildConfiguration extension point at first.

On 15 June 2012 14:21, StÃphane ANCELOT <sancelot@xxxxxxx> wrote:
Hi,
adding a custom script in the project Builders tab of your project should do it.
Regards
Steph




----- Mail original -----
De: "Lambros Petrou" <lambrospower@xxxxxxxx>
Ã: "CDT General developers list." <cdt-dev@xxxxxxxxxxx>
EnvoyÃ: Vendredi 15 Juin 2012 12:55:02
Objet: Re: [cdt-dev] Call a custom preprocessor and display its results in   Âconsole


I have been reading a lot about the toolchains in cdt. I made a custom project template ( that copies some files necessary for my project into the project dir ) and I tried to make a toolchain where I have a tool definition with a command that calls a binary that is located in a dir inside the project ( it is one of the files I copy with my project template ). And at the end I set a builder that is just a subclass of the " org.eclipse.cdt.build.core.internal.builder ".


When I try to build my project using my toolchain I get Nothing in the console. Not even the builder is run. I followed the tutorial here: http://www.drdobbs.com/cpp/197002115?pgno=6


Is there a way to make a configuration JUST TO RUN MY PREPROCESSOR with a single file as input that is located in a dir inside the project ? Or the best way to do it is just make a class that adds a button somewhere and calls the preprocessor manually and then display its output to the console ?


The problem is that I cannot define the toolchain completely because of some other tools used externally to make the final build of the project. I just want to call my preprocessor, that's all.


Thank you.


On 12 June 2012 12:48, Lambros Petrou < lambrospower@xxxxxxxx > wrote:


About the preprocessor calling, I am looking into the MBS configurations and I am trying to make a custom buildConfiguration but it seems that I need to define the WHOLE toolchain that's going to be used.

Is there any way to make a configuration that calls ONLY the preprocessor and display its results ?




On 11 June 2012 17:41, Andrew Gvozdev < angvoz.dev@xxxxxxxxx > wrote:


Hi Petrou,



On Sun, Jun 10, 2012 at 10:52 AM, Lambros Petrou < lambrospower@xxxxxxxx > wrote:


Hello,


I am making a plugin to support more preprocessor commands in C/C++. I made the Content Assist features to work as expected ( with the help of this mailing list ) and I made a Panel for some additional things. Now I'd like to have a button in my panel with the following functionality.



1) Get the text from the open and active editor
2) Call my custom preprocessor executable with some arguments given by a wizard or defaults at first
3) Display the results of the preprocessor at the Console Output or somewhere to be read by the user
In CDT, console functionality is implemented using CommandLauncher. I implemented CDT console fairly recently for scanner discovery to detect compiler built-in settings. It starts at AbstractBuiltinSpecsDetector.runForLanguage(), then you can take a look at BuildRunnerHelper.build() and CommandLauncher code.
The code in AbstractBuiltinSpecsDetector:
- Creates CDT build console which manages separate consoles for each project (like it is done for regular build)
- Connects ErrorParsers and scanner discovery parsers to parse console output
- Provides progress monitor for user to see progress or cancel the build


Andrew






My main problem is the 2-3 points. As for the 3rd one I think this will suffice:


http://www.jevon.org/wiki/Writing_to_a_Console_in_Eclipse


It's the 2nd part which I do not know how to do. Is there any easy way to do this or should I make my own Build System for CDT using my preprocessor ? If I have to, is there any tutorial or guide or even an example I can read ?


Thank you

--

Lambros Petrou


www.lambrospetrou.com
lambrospower@xxxxxxxx

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev




--

Lambros Petrou


www.lambrospetrou.com
lambrospower@xxxxxxxx




--

Lambros Petrou


www.lambrospetrou.com
lambrospower@xxxxxxxx

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



--
Lambros Petrou

www.lambrospetrou.com
lambrospower@xxxxxxxx