【问题标题】:How to run the 'gradle init' task in Eclipse Buildship plugin?如何在 Eclipse Buildship 插件中运行“gradle init”任务?
【发布时间】:2016-11-22 16:28:54
【问题描述】:

我想在我的 Android 项目中使用 Gradle,并且我使用 Eclipse(而不是 Android Studio)。我的网络搜索将我指向了名为 Buildship 的 Eclipse 的 Gradle 插件。我按照this guide 下载并安装了它。

我需要将我的 Eclipse 工作区中的 Android 项目转换为与 Gradle 构建系统一起使用的项目。所以在this section of the guide mentioned 之后,我在我的项目中添加了 Gradle 支持。 但我仍然无法在我的项目中看到 build.gradle 文件。我确实刷新了项目。

那么我该怎么做才能在我的项目中获取 build.gradle 文件?

*我链接到的指南说,*

运行“gradle init”任务以创建初始 Gradle 文件,以防万一 你还没有。

但我不知道如何运行gradle init 任务。

【问题讨论】:

    标签: android eclipse gradle android-gradle-plugin buildship


    【解决方案1】:

    在“Gradle 任务”面板中,展开项目的节点。然后展开“构建设置”节点。右键单击“init”并选择“Run Gradle Tasks”。

    然后在项目资源管理器中,右键单击您的项目并选择“Gradle”,然后选择“刷新 Gradle 项目”。瞧!您现在必须能够看到您的 build.gradle。

    【讨论】:

    • 必须先添加“Gradle Tasks”,在window->show view->other..
    【解决方案2】:

    转到 windows--> 显示视图--> Gradle 任务。在此视图中,您将能够看到您的项目。展开构建设置并双击“init”任务。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多