简体   繁体   English

创建用于创建当前在编辑器上打开的源代码的快照的插件-Eclipse CDT

[英]Create plug-in that creates a snapshot of the source code currently opened on editor - Eclipse CDT

I need to create a plug-in for Eclipse CDT that sends a "snapshot" of the source code of the currently opened editor each time the code is "built". 我需要为Eclipse CDT创建一个插件,该插件在每次“构建”代码时都会发送当前打开的编辑器的源代码的“快照”。

I am already capable of doing it each time the user presses a custom button created by me, but it would be great if it could be done when the "standard" "build" action is performed. 每次用户按下由我创建的自定义按钮时,我已经能够执行此操作,但是如果可以在执行“标准”“构建”操作时执行该操作,那就太好了。

Do i need no create a plug-in of the type "builder"? 我不需要创建“ builder”类型的插件吗?

I am using Eclipse 4.4.0... 我正在使用Eclipse 4.4.0 ...

Can someone help me?! 有人能帮我吗?! (Sorry for some english mistakes... :( ) (对不起一些英语错误... :()

One solution would be to create your own custom "Builder". 一种解决方案是创建自己的自定义“生成器”。 Instead of actually building the code, it would invoke the functionality you already have. 而不是实际构建代码,它会调用您已经拥有的功能。

For information on how to use the eclipse build system, please have a look here: https://wiki.eclipse.org/Eclipse/FAQ/How_do_I_implement_an_Eclipse_builder%3F . 有关如何使用Eclipse构建系统的信息,请在此处查看: https : //wiki.eclipse.org/Eclipse/FAQ/How_do_I_implement_an_Eclipse_builder%3F

Also, this website goes into more details about building in eclipse: https://www.eclipse.org/articles/Article-Builders/builders.htm . 此外,该网站还提供了有关eclipse中构建的更多详细信息: https : //www.eclipse.org/articles/Article-Builders/builders.htm However, I think that the first one should do. 但是,我认为第一个应该这样做。

As a side note, this works with any kind of eclipse project (JDT and CDT). 附带说明,这适用于任何形式的日食项目(JDT和CDT)。 The build described there is common to all flavours. 那里描述的版本是所有口味共有的。

Hope it helps, -Caius 希望能有所帮助,-Caius

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM