How to write an Eclipse plugin [message #1729150] |
Mon, 11 April 2016 14:20 |
Kauan Klein Messages: 8 Registered: April 2016 Location: Brazil, RJ, Petrópolis |
Junior Member |
|
|
Hello, I'm new to the forum. I've been using eclipse for some time, though.
I have a plan to implement a few Java annotations that would check things like immutability and out parameters. My first intuition was to write a standalone application but I have no idea of how to check an entire project and it's dependencies
So my doubts are:
Which languages can I use to write a plugin?
Is the following list of actions possible to be achieved by a plugin:
- invoke the Build action to report build errors (without actually generating any output would be ideal, but not a requirement).
- if the Build action succeed, run my plugin as a "compiler" of sorts. It wont compile, only perform syntatic and semantic analysis and emit errors regarding my annotations.
- if my plugin analysis passes, invoke Build for real this time, otherwise just output to the user what is wrong.
Can it be done?
|
|
|
Re: How to write an Eclipse plugin [message #1729210 is a reply to message #1729150] |
Tue, 12 April 2016 08:33 |
Felix Dorner Messages: 392 Registered: December 2015 |
Senior Member |
|
|
On 11-Apr-16 16:51, Kauan Klein wrote:
> Hello, I'm new to the forum. I've been using eclipse for some time, though.
>
> I have a plan to implement a few Java annotations that would check
> things like immutability and out parameters. My first intuition was to
> write a standalone application but I have no idea of how to check an
> entire project and it's dependencies
>
> So my doubts are:
>
> Which languages can I use to write a plugin?
Java is the obvious choice..
> Is the following list of actions possible to be achieved by a plugin:
>
>
> invoke the Build action to report build errors (without actually
> generating any output would be ideal, but not a requirement).
>
> if the Build action succeed, run my plugin as a "compiler" of sorts. It
> wont compile, only perform syntatic and semantic analysis and emit
> errors regarding my annotations.
>
> if my plugin analysis passes, invoke Build for real this time, otherwise
> just output to the user what is wrong.
>
>
> Can it be done?
>
Yes. First look at eclipse plugin tutorials, I don't have a favourite.
Then maybe you could get along with
https://eclipse.org/articles/Article-Builders/builders.html
|
|
|
Re: How to write an Eclipse plugin [message #1729376 is a reply to message #1729210] |
Wed, 13 April 2016 13:24 |
Kauan Klein Messages: 8 Registered: April 2016 Location: Brazil, RJ, Petrópolis |
Junior Member |
|
|
How do I log messagers for the user? How do I know my plugin is in use?
My plugin's console shows this when I start a Runtime eclipse on top of my normal workbench:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [bundleresource://540.fwk101601906:1/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [bundleresource://540.fwk101601906:2/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
!SESSION 2016-04-13 10:54:00.955 -----------------------------------------------
eclipse.buildId=4.5.2.M20160212-1500
java.version=1.8.0_77
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=pt_BR
Framework arguments: -product org.eclipse.platform.ide
Command-line arguments: -product org.eclipse.platform.ide -data C:\Users\Starless\Documents\Nova pasta/../runtime-EclipseApplication -dev file:C:/Users/Starless/Documents/Nova pasta/.metadata/.plugins/org.eclipse.pde.core/Eclipse Application/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog
!ENTRY org.eclipse.egit.ui 2 0 2016-04-13 10:54:07.321
!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git
user global configuration and to define the default location to store repositories: 'C:\Users\Starless'. If this is
not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and
EGit might behave differently since they see different configuration options.
This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.
This is my plugin code (mostly auto generated)
https://github.com/Starless2001/Plugin-for-Eclipse
[Updated on: Wed, 13 April 2016 16:12] Report message to a moderator
|
|
|
|
|
Re: How to write an Eclipse plugin [message #1729546 is a reply to message #1729513] |
Fri, 15 April 2016 09:55 |
Tauno Voipio Messages: 742 Registered: August 2014 |
Senior Member |
|
|
Kauan Klein wrote on Fri, 15 April 2016 02:20When I run the runtime eclipse application, how do I know it is being built using my plugin?
Are you intending to invoice based on your plugin use?
It is not in accordance of the Eclipse philosophy.
You can see if the plugin is in your Eclipse by Help -> Installation Details -> Plug-ins.
Please note that the plug-in is dynamically added in, the base Eclipse needs not be built with it. Please read the Eclipse platform documentation.
--
Tauno Voipio
|
|
|
Powered by
FUDForum. Page generated in 0.08517 seconds