简体   繁体   English

如何在IntelliJ IDEA中添加“库项目”?

[英]How can I add a “Library Project” in IntelliJ IDEA?

I'm using ActionBarSherlock in an Android project that I developed using Eclipse. 我在使用Eclipse开发的Android项目中使用ActionBarSherlock。 I'd like to migrate that project over to IntelliJ IDEA, but I'm not sure how to add a "Library Project" to IDEA. 我想将该项目迁移到IntelliJ IDEA,但我不确定如何向IDEA添加“库项目”。

Is this a feature IDEA supports? 这是IDEA支持的功能吗? If so, can someone help me figure out how to add one? 如果是这样,有人可以帮我弄清楚如何添加一个吗?

Thanks! 谢谢!

UPDATED: What I'm referring to is what they describe here -- Managing Projects from Eclipse with ADT . 更新:我所指的是他们在这里描述的内容 - 使用ADT从Eclipse管理项目 They allow you to add a reference to an uncompiled project as a "library." 它们允许您将对未编译项目的引用添加为“库”。

You need to create a new IDEA module from the existing source code. 您需要从现有源代码创建新的IDEA模块。 Ensure that Android facet is enabled for this module, in the facet settings you need to enable " Is Library Project " option. 确保为此模块启用了Android facet,在facet设置中需要启用“ Is Library Project ”选项。 Then add this module as a dependency to your main module. 然后将此模块添加为主模块的依赖项。

For new visitors: 对于新访客:

Create a module from existing sources (point to the library directory inside ABS), then add android-support-v4.jar as a dependency to your project and ABS modules. 从现有源创建模块(指向ABS内的库目录),然后将android-support-v4.jar添加为项目和ABS模块的依赖项。

There's also a detailed tutorial . 还有一个详细的教程

首先删除该库,然后将Library项目添加为模块,将Module添加为依赖项

You can have a dependency on another module in IntelliJ. 您可以依赖IntelliJ中的另一个模块。

You can import the existing Eclipse project into IntelliJ. 您可以将现有Eclipse项目导入IntelliJ。

You can add libraries to a module in IntelliJ. 您可以在IntelliJ中将库添加到模块。

I'm not clear on exactly what you want to do. 我不清楚你想要做什么。 Can you add info to your question? 你能在问题中添加信息吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM