Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
645 views
in Technique[技术] by (71.8m points)

intellij-idea - 如何从intellij社区版仓库导入和运行现有插件(How to import and run existing plugins from intellij community edition repo)

I'm trying to import and run the IntelliJ git4idea (Git Integration) plugin in order to play around and contribute some of my own code.

(我正在尝试导入和运行IntelliJ git4idea(Git集成)插件,以便进行试验并贡献一些自己的代码。)

I've pulled the Intellij community edition from the github repo , and imported the git4idea plugin as a project.

(我已经从github repo中提取了Intellij社区版,并将git4idea插件导入为一个项目。)

I'm running the Intellij community edition

(我正在运行Intellij社区版)

My main issue is this:

(我的主要问题是:)

After importing all the modules, the git4idea module comes up as a general module type, and not a plugin module type.

(导入所有模块后,git4idea模块作为常规模块类型出现,而不是插件模块类型出现。)

在此处输入图片说明

This means that when trying to create a new run\debug configuration, I get [none] under "Use classpath of module", instead of of the ability to select the git4idea plugin.

(这意味着,当尝试创建新的run \ debug配置时,我在“使用模块的类路径”下获得[none] ,而不是选择git4idea插件的能力。)

This obviously results in a "Run configuration error: no plugin module specified for configuration".

(显然,这会导致“运行配置错误:未指定用于配置的插件模块”。)

在此处输入图片说明

So the question is - How can I change the general type of imported "git4idea" to plugin type?

(所以问题是- 如何将导入的“ git4idea”的常规类型更改为插件类型?)

Or better yet, what are the steps required in order to import and build/debug/run a plugin from the Intellij community edition repo?

(或者更好的是,要从Intellij社区版仓库中导入和构建/调试/运行插件,需要执行哪些步骤?)

  ask by OpherV translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I was able to solve this by manually reordering file directories, sorting out dependencies and editing the .iml file.

(我可以通过手动重新排序文件目录,整理依赖性以及编辑.iml文件来解决此问题。)

The type of plugin is defined by changing type="JAVA_MODULE" to type="PLUGIN_MODULE" .

(该类型的插件是通过改变定义type="JAVA_MODULE"type="PLUGIN_MODULE" 。)

...

(...)

This is the answer given by Dmitry Jemerov on the official Jetbrains plugin development forum:

(这是Dmitry Jemerov在官方Jetbrains插件开发论坛上给出的答案 :)

The easiest answer to this is "don't".

(最简单的答案是“不要”。)

The IntelliJ IDEA Community Edition project is set up to be developed as a whole, and the dependencies are set up accordingly.

(将IntelliJ IDEA社区版项目设置为要整体开发,并相应地设置依赖项。)

If you want to hack on the Git plugin, you simply run IDEA using the provided run configuration, it runs with all plugins enabled, and you simply make whatever changes you need and test them using the main run configuration.

(如果您想破解Git插件,只需使用提供的运行配置运行IDEA,然后在启用所有插件的情况下运行IDEA,然后只需进行所需的任何更改,然后使用主运行配置进行测试即可。)

If you really want, you can set up a new plugin module and point it to the source code of the git4idea plugin inside the IntelliJ IDEA Community Edition Git checkout.

(如果确实需要,可以设置一个新的插件模块,并将其指向IntelliJ IDEA Community Edition Git签出中的git4idea插件的源代码。)

This is not too hard, but it's something you'll need to do from scratch, and you can't use the existing .iml file.

(这并不难,但是您需要从头开始做,并且您不能使用现有的.iml文件。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...