You are on page 1of 51

Lê Xuân Tiến -15520884

Hứa Vĩ Trung - 15520940


Huỳnh Minh Tân - 15520763
Bùi Trường Thịnh - 15520833
GRADLE

Nguyễn Thị Thanh Trúc


University of Information Technology
3
01 INTRODUCTION
What is gradle ?

02 FEATURES
Standard - Advanced

03 WHO USING GRADLE


Company, technology, framework, …

04 RESOURCES
Documents

05 ANALYSIS
Marketing research and data

06 CONTACT US
Keep in touch
5

• Gradle is a general purpose build system


• It comes with a rich build description language (DSL) base on
Groovy
• It supports “build-by-convention” principle
• But it is very flexible and entensible
• It has built-in plug-in for Java, Groovy, Scala, Web, OSGi
• It derives all the best and integrates well with Ivy, Ant and
Maven
University of Information Technology
2000 Ant
VERTICAL TIMELINE An open source build tool (a program for
putting together all the pieces of a program)

Maven 2004
Upgraded version of Ant
Can download library through the internet

2012 Gradle
Combination of Ant and Maven and
improve by using Groovy in the settlement
of bundle package

Release Now

Release about 1 – 3 mounths / new version


8
Standard

• Declarative builds and build-by-convention


• Language for dependency based programming and many
ways to manage dependencies
• Groovy as a base language allows imperative programming

University of Information Technology


9
Standard

• Deep and rich API for managing projects, tasks, dependency


artefacts and much more.
• Sate of the art support for multi-project builds
• Ease of integraton and migration. Antm Maven, Ivy are
supported out-of-the-box
• Free and open source

University of Information Technology


1
0
Advanced

• Parallel unit test execution


• Dependency build
• Incremental build support
• Dynamic tasks and task rules
• Gradle daemon

University of Information Technology


1
1
Detail

• https://docs.gradle.org/current/dsl/
• A task represents a single atomic piece of work for a build,
such as compilling classes or generating Javadoc
• Each task belongs to a Project. You can use the various
methods on TaskContainer to create and lookup task
instances

University of Information Technology


1
2
Detail

University of Information Technology


1
3
Detail

• Gradle is composed of two concepts: Project and Tasks


• A project may represent the creation of a jar or a deploy
of an application on the server. Each project is
composed of several Tasks
• Task represent some atomic job

University of Information Technology


1
4
Example

University of Information Technology


1
5
Detail

• Like Ant, it allow you to setup default task and dependencies


between tasks

University of Information Technology


1
6
Detail

• Project build file

University of Information Technology


1
7
Detail

• Project structure

University of Information Technology


1
8
Detail
• Project build file

University of Information Technology


1
9
Detail

• Group and version of your application

University of Information Technology


2
0
Detail

• Information about your source

University of Information Technology


2
1
Detail

• Declare others repositories

University of Information Technology


2
2
Detail

• Plugins to configure your application to your preferred IDE

University of Information Technology


2
3

• Windows -> Eclipse Market -> Gradle ->


Buildship Gradle Integration + Minimalist Gradle Editor

University of Information Technology


2
4

• Importing project as a Gradle Project


Import as -> Select “Gradle Project”

University of Information Technology


2
5

• Importing project as a Gradle Project


Select the project location

University of Information Technology


2
6

• Importing project as
a Gradle Project
Use the Gradle
wrapper inside the
project or select the
gradle local instalation

University of Information Technology


2
7

• Executing Gradle in
the Eclipse
- Gradle Tasks tab -> Select
the tasks -> double click in it

University of Information Technology


2
8

• Executing Gradle in the Eclipse


• Usually when you import a Java project as a Gradle Project we have
compilation errors.
• Need to run the “eclipse” task to Gradle generate the .classpath and
.project files.
• The compilation errors will disappear.

University of Information Technology


2
9

• Real application usually consist in many project with


dependences between these project, for example a
common project that contains common code used by
others projects
• Gradle support this structure.

University of Information Technology


3
0

• Define a root project that consist of 3 projects


• App
• api
• build.gradle
• impl
• build.gradle
• common
• build.gradle
• build.gradle
• settings.gradle

University of Information Technology


3
1

• File settings.gradle of the root project

University of Information Technology


3
2

• With the buildship plugin, when you import the root project,
all subprojects are imported

University of Information Technology


3
3

• In the build.gradle of the root project you can apply general


configuration for all projects or call subprojects

University of Information Technology


3
4

• Dependence between projects


• impl project depend of common and api project
• So you can declare theses dependence in build.gradle of impl
project

University of Information Technology


3
5

• Dependence between projects


• impl project depend of common and api project
• So you can declare theses dependence in build.gradle of impl
project

University of Information Technology


3
6

• Your application has several modules, and you change a


module, usually you need build the moulde, publish the jar
to a repository and update other modules to have the
changes
• Composite builds helps us the split up the project into
smaller, independent builds. Ou can now quick-fix the
dependency and see the result right away.

University of Information Technology


3
7

• In the setting.gradle file of the root project you can include


others projects build.

University of Information Technology


3
8

• Or include all projects under the “module” directory.

University of Information Technology


3
9

• .gitignore file for Gradle project

University of Information Technology


4
0

• Jenkins is an award-winning, cross-platform, continuous integration


and continuous delivery application that increases your productivity.
• Use Jenkins to build and test your software projects continuously
making it easier for developers to integrate changes to the project.

University of Information Technology


4
1

• Jenkins basically schedule jobs to execute some task.

University of Information Technology


4
2

• Install plugin Jenkins.

University of Information Technology


4
3

• After install the plugin, the Jenkins job, select “Invoke Gradle script” then
write the tasks to be invoked.

University of Information Technology


4
4

• Projects that generated a JAR to be publish in artefactory.

University of Information Technology


4
5

• Projects that generated a EAR are deployed in JBOSS.

University of Information Technology


4
7

Google Android Unity Link In

University of Information Technology


4
8

Hibernate Grails Spring Griffon


• Spring integration

• Spring security

University of Information Technology


5
0
Standard

• https://www.gradle.org
• https://groovy.codehaus.org
• https://ant.apache.org/manual

University of Information Technology


ANY QUESTIONS?

You might also like