有什么方法可以将 Eclipse 与 Android 项目中的 Gradle 集成? [英] Is there any way to integrate Eclipse with Gradle in Android project?

查看:25
本文介绍了有什么方法可以将 Eclipse 与 Android 项目中的 Gradle 集成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有带有标准 build.gradle 的 Android 项目(我还添加了 android 注释).

I have Android project with standard build.gradle (also I added android annotations).

我还安装了 Gradle 插件(来自 http://dist.springsource.org/release/GRECLIPSE/e4.3/) 到我的 Eclipse (Kepler) 并将项目转换为 Gradle 项目.

Also I installed Gradle plugin (from http://dist.springsource.org/release/GRECLIPSE/e4.3/) to my Eclipse (Kepler) and converted project to Gradle project.

很遗憾,我无法在 Eclipse 上运行 Gradle build(在 cmd 行中一切正常).

Unfortunately I cannot run Gradle build on my Eclipse (in cmd line everything works).

我的问题是如何让 Eclipse 像使用 Maven 一样使用 Gradle.

My question is how to make Eclipse works with Gradle just like with Maven.

推荐答案

为了能够使用 Eclipse 构建 Android gradle 项目,我遵循了以下说明:

In order to be able to build an Android gradle project with Eclipse I followed these instructions:

  1. 安装这些 Eclipse 插件:

  1. Install these Eclipse plugins:

  • Gradle IDE (3.4.0)
  • Android 开发工具 (22.3.0)

如果你有一个老式的android项目布局,改变你的build.gradle 配置源目录,如 Android 中所述Gradle 用户指南.

If you have an old-style android project layout, change your build.gradle to configure source directories as explained in the Android Gradle User Guide.

如果您有 gradle android 项目布局,请在项目的根目录中创建两个符号链接.

If you have a gradle android project layout, create two symbolic links into the root of your project.

ln -s src/main/res res
ln -s src/main/AndroidManifest.xml AndroidManifest.xml

ln -s src/main/res res
ln -s src/main/AndroidManifest.xml AndroidManifest.xml

希望能帮到你!

这篇关于有什么方法可以将 Eclipse 与 Android 项目中的 Gradle 集成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆