Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Starting with Gradle [closed]

Tags:

gradle

I have no idea about any building tool like Ant, Maven, or Gradle. This is first time I am starting with Gradle ( and have less time to understand it :( ). So this is a stupid question I have in my mind.

My initial steps with Gradle:

  1. I created a simple java program in eclipse.
  2. I added dependencies manually from project properties window.
  3. I explored src folder from command line and created build.gradle there.
  4. I executed a command "gradle build" which prompted me that build is successful.

Please tell me how these steps can help me not to add dependencies manually in eclipse.

(For one of the project I installed maven plugin in eclipse. So whenever I need to add some dependencies, I just run Maven clean/build. And I add rest dependencies manually. It automatically add dependencies to my development environment)

like image 898
Amit Kumar Gupta Avatar asked Sep 26 '12 01:09

Amit Kumar Gupta


1 Answers

Gradle offers two ways to automate the Eclipse project setup:

  1. Apply the Eclipse Plugin to the Gradle build script. Run gradle eclipse to generate the Eclipse project files (.project, .classpath, etc.). Import the project into Eclipse (Import->Existing Project Into Workspace). Each time you declare some new dependencies in the Gradle build script, regenerate the project files and refresh the project in Eclipse.

  2. Install the Eclipse Gradle integration (installation instructions, tutorial). Import the project into Eclipse (Import->Gradle Project). Each time you declare some new dependencies in the Gradle build script, select Refresh Dependencies from the Gradle context menu on the Eclipse project.

In either case, you'll want to familiarize yourself with Gradle's dependency management.

like image 172
Peter Niederwieser Avatar answered Nov 05 '22 09:11

Peter Niederwieser