您的位置:首页 > 移动开发 > Android开发

已存在的Android studio(Intellij )Plugin project (工程源码)如何导入intellij ?

2017-02-16 15:14 411 查看
最近对写intellij插件挺感兴趣的,写好一些插件可以有效提升开发的效率。不过在开发的时候实在有一些 功能不知道如何实现,看官方文档。。有一种云里雾里的感觉。

于是只好找一些 开源的Plugin实现,导入 intellij,编译运行 debug一下 看下 怎么运作的。 然后发现。。。 所有下载下来的plugin  工程 导入intellij后,都显示为普通工程。

无法作为插件运行,也就无法debug。

这类问题只能借助stackoverflow了
http://stackoverflow.com/questions/18278440/how-to-import-and-run-existing-plugins-from-intellij-community-edition-repo http://stackoverflow.com/questions/35470087/convert-java-project-into-intellij-idea-plugin https://intellij-support.jetbrains.com/hc/en-us/community/posts/206112379-How-to-import-and-run-existing-plugins-from-intellij-community-edition-repo-?page=1#community_comment_206112145
借助上面几个答案,只有 貌似是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. 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.

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. 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.

大概翻译一下:如何在Intellij 共享版本中导入和运行已有的plugin project?

答案是不行。Intellij IDEA 社区版本是作为一个整体来开发的,其依赖也同样按此设置。如果你想hack一下git plugin,你仅仅只需通过已经提供好的”运行设置“来配置运行IDEA,他会随着所有可用的plugin一起运行,你仅需在”运行设置”中做出你想要的改变然后同样在主“运行设置”中测试
你的设置。

如果你实在想(在代码层级来调试),你可以新建一个plugin module,然后把已有的git4idea源码check out 进去。这并不难,只不过有一些琐碎的事情需要你做,同时你也不能使用已有的.iml 文件。

OK,大意应该就是无法导入,只能新建plugin工程然后copy源码和resource进去了~  蛋疼。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: