Running external processes from a plugin via openapi

Hello,

I am writing a plugin which needs to execute an external process. I'm
not sure this can be a run-configuration as it is not considered running
the project, but an external tool of some sort.

Is there a standard way to do this (OpenAPI I assume)? If not, is there
a way I could do this via the non-openapi APIs?

Any help on this would be appreciated, as I am trying to avoid manually
creating a java.lang.Process and attaching a thread to its output stream...

10x!

Arik.

4 comments
Comment actions Permalink

Do you need just run something or you'd like to open Run toolwindow and redirect
process output there?

-


Maxim Shafirov
http://www.jetbrains.com
"Develop with pleasure!"

Hello,

I am writing a plugin which needs to execute an external process. I'm
not sure this can be a run-configuration as it is not considered
running the project, but an external tool of some sort.

Is there a standard way to do this (OpenAPI I assume)? If not, is
there a way I could do this via the non-openapi APIs?

Any help on this would be appreciated, as I am trying to avoid
manually creating a java.lang.Process and attaching a thread to its
output stream...

10x!

Arik.



0
Comment actions Permalink

Actually I've managed - but I'd love to get your input anyway:

What I need is to run my own process (not run the project iself). This
is done for maven integration, and I'm executing the maven runtime.

What I've done is manually open the java.lang.Process, and catch its
output onto my own ToolWindow which I registered via ToolWindowManager.
My tool window has my own JTextArea which displays the output as the
process emits it.

Is there a better way via IntelliJ's APIs?

Maxim Shafirov (JetBrains) wrote:

Do you need just run something or you'd like to open Run toolwindow and
redirect process output there?

-------------------
Maxim Shafirov
http://www.jetbrains.com
"Develop with pleasure!"

>> Hello,
>>
>> I am writing a plugin which needs to execute an external process. I'm
>> not sure this can be a run-configuration as it is not considered
>> running the project, but an external tool of some sort.
>>
>> Is there a standard way to do this (OpenAPI I assume)? If not, is
>> there a way I could do this via the non-openapi APIs?
>>
>> Any help on this would be appreciated, as I am trying to avoid
>> manually creating a java.lang.Process and attaching a thread to its
>> output stream...
>>
>> 10x!
>>
>> Arik.
>>


0
Comment actions Permalink

Upon investigation it appeared there's one small lack of the API to do what
you need. Watch http://www.jetbrains.net/jira/browse/IDEADEV-889 to be notfied
when it's done.

-


Maxim Shafirov
http://www.jetbrains.com
"Develop with pleasure!"

Actually I've managed - but I'd love to get your input anyway:

What I need is to run my own process (not run the project iself). This
is done for maven integration, and I'm executing the maven runtime.

What I've done is manually open the java.lang.Process, and catch its
output onto my own ToolWindow which I registered via
ToolWindowManager. My tool window has my own JTextArea which displays
the output as the process emits it.

Is there a better way via IntelliJ's APIs?

Maxim Shafirov (JetBrains) wrote:

>> Do you need just run something or you'd like to open Run toolwindow
>> and redirect process output there?
>>
>> -


>> Maxim Shafirov
>> http://www.jetbrains.com
>> "Develop with pleasure!"
>>> Hello,
>>>
>>> I am writing a plugin which needs to execute an external process.
>>> I'm not sure this can be a run-configuration as it is not considered
>>> running the project, but an external tool of some sort.
>>>
>>> Is there a standard way to do this (OpenAPI I assume)? If not, is
>>> there a way I could do this via the non-openapi APIs?
>>>
>>> Any help on this would be appreciated, as I am trying to avoid
>>> manually creating a java.lang.Process and attaching a thread to its
>>> output stream...
>>>
>>> 10x!
>>>
>>> Arik.
>>>


0
Comment actions Permalink

10x Maxim!

Looking forward to it.


Maxim Shafirov (JetBrains) wrote:

Upon investigation it appeared there's one small lack of the API to do
what you need. Watch http://www.jetbrains.net/jira/browse/IDEADEV-889 to
be notfied when it's done.

-------------------
Maxim Shafirov
http://www.jetbrains.com
"Develop with pleasure!"

>> Actually I've managed - but I'd love to get your input anyway:
>>
>> What I need is to run my own process (not run the project iself). This
>> is done for maven integration, and I'm executing the maven runtime.
>>
>> What I've done is manually open the java.lang.Process, and catch its
>> output onto my own ToolWindow which I registered via
>> ToolWindowManager. My tool window has my own JTextArea which displays
>> the output as the process emits it.
>>
>> Is there a better way via IntelliJ's APIs?
>>
>> Maxim Shafirov (JetBrains) wrote:
>>
>>> Do you need just run something or you'd like to open Run toolwindow
>>> and redirect process output there?
>>>
>>> -


>>> Maxim Shafirov
>>> http://www.jetbrains.com
>>> "Develop with pleasure!"
>>>
>>>> Hello,
>>>>
>>>> I am writing a plugin which needs to execute an external process.
>>>> I'm not sure this can be a run-configuration as it is not considered
>>>> running the project, but an external tool of some sort.
>>>>
>>>> Is there a standard way to do this (OpenAPI I assume)? If not, is
>>>> there a way I could do this via the non-openapi APIs?
>>>>
>>>> Any help on this would be appreciated, as I am trying to avoid
>>>> manually creating a java.lang.Process and attaching a thread to its
>>>> output stream...
>>>>
>>>> 10x!
>>>>
>>>> Arik.
>>>>


0

Please sign in to leave a comment.