简体   繁体   English

如何在Eclipse Buildship插件中运行“ gradle init”任务?

[英]How to run the 'gradle init' task in Eclipse Buildship plugin?

I want to use Gradle for my Android project, and I use Eclipse (rather than Android Studio). 我想将Gradle用于我的Android项目,并使用Eclipse(而不是Android Studio)。 My web-search pointed me to Eclipse's Gradle Plugin called Buildship. 我的网络搜索将我指向Eclipse的名为Buildship的Gradle插件。 I downloaded and installed it following this guide . 我按照本指南下载并安装了它。

My need is to convert my Android project in my Eclipse workspace into something that works with Gradle build system. 我需要将Eclipse工作区中的Android项目转换为可与Gradle构建系统一起使用的项目。 So following this section of the guide mentioned , I added Gradle support to my project. 因此,按照上述指南的这一部分 ,我向项目添加了Gradle支持。 But I still can not see a build.gradle file in my project. 但是我仍然看不到我的项目中的build.gradle文件。 I did refresh the project. 我确实刷新了项目。

So what do I do to get a build.gradle file in my project? 那么,如何在项目中获取build.gradle文件?

在此处输入图片说明

*The guide I linked to says, * *我链接的指南说,*

Run the 'gradle init' task to create the initial Gradle files, in case you do not have them yet. 运行“ gradle init”任务以创建初始Gradle文件(如果您还没有的话)。

but I can't figure out how to run the gradle init task. 但是我不知道如何运行gradle init任务。

In the "Gradle Tasks" panel, expand the node of your project. 在“ Gradle Tasks”面板中,展开项目的节点。 Then expand the "build setup" node. 然后展开“构建设置”节点。 Right click on "init" and select "Run Gradle Tasks". 右键单击“初始化”,然后选择“运行Gradle任务”。

Then in the project explorer, right click on your project and select "Gradle", then select "Refresh Gradle Project". 然后在项目资源管理器中,右键单击您的项目并选择“ Gradle”,然后选择“ Refresh Gradle Project”。 And voila! 瞧! You must be able to see your build.gradle now. 您现在必须能够看到build.gradle。

Go to windows-->Show View-->Gradle Tasks. 转到窗口->显示视图->成绩任务。 In this view you will be able to see your project.Expand build setup and double click "init" task. 在此视图中,您将能够看到您的项目。展开构建设置,然后双击“ init”任务。

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

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