Listen to pycharm run/debug events, and android studio gradle tasks.
Answered
I'm developing a plugin that does stuff before & after compilation / build events.
I used `CompileTask` & `<compiler.task execute="BEFORE" .... >` to catch the "before build" event.
I used `CompilationStatusListener` to catch the after execution event.
However, this only works on Intellij Idea, it doesn't work with android studio gradle tasks, even though it works with gradle on Idea.
But it works on AS when I Right-Click a folder and hit "build".
It also doesn't work at all in Pycharm.
What am I missing?
Please sign in to leave a comment.
See com.android.tools.idea.project.AndroidProjectBuildNotifications
@Yann Cebron
Thanks, which Android studio plugins/jars do I need to add to the classpath in order to use:
That is part of Android plugin, see http://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_dependencies.html
@Yann Cebron
Yeah I know, I added almost all the jars in
plugins/<pluginname>/lib
and it's still not recognised.Use
Still no luck
Well I cannot judge what "almost all the jars" means or not :)
I was hoping that you know which ones should be added. I'll try to add even more. These things really need a documentation.
android.jar is the necessary file. I'd recommend switching to Gradle setup to avoid all this manual hassle http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started.html
Thanks! that was it.
Is there a a listener for Pycharm's interpreter events?
You can implement com.intellij.execution.ExecutionListener and register on ExecutionManager.EXECUTION_TOPIC, then listen specifically for Python runners/specific configurations
So I've been searching, but I couldn't find any info about specific Python processes/ runners.
There's com.jetbrains.python.run.PythonRunner and com.jetbrains.python.run.PythonRunConfiguration (or super com.jetbrains.python.run.AbstractPythonRunConfiguration)
so I did this (plugin.xml):
(python_config.xml):
(PythonDrumroll):
Drumroll:
But it doesn't work, I also tried `AbstractPythonRunConfiguration<*>` instead of `PythonRunner` but still no luck.
I tried added the `play("wow") in `init` and it didn't play, which made me suspect the component isn't loaded.
I have the same setup with android and it works fine:
Are there any updates on this? I'm also trying to understand how to listen to PyCharm builds. I've tried
but it doesn't seem to fire and I haven't been able to find anything on https://plugins.jetbrains.com/intellij-platform-explorer/listeners
Please see https://github.com/metalbear-co/mirrord/blob/b054d76ae4f86c93bf6742aedc8308a33bc8439c/intellij-ext/src/main/kotlin/com/metalbear/mirrord/MirrordListener.kt as sample. see https://plugins.jetbrains.com/docs/intellij/plugin-listeners.html on how to register ExecutionListener declaratively.