SlideShare une entreprise Scribd logo
1  sur  17
Building with 
Laurynas Tret jakovas 
laurynas.tret jakovas@gmail.com 
Kaunas Java User Group, 2014 1
Why Gradle? 
• Ant makes you reinvent the wheel every time; 
• Ant build scripts can get hard to maintain very quickly; 
• Maven does not care about your project, you must make sure that your project 
works well with Maven – it enforces convention; 
• You must do everything “The Maven Way” or implement custom plugins; 
• Gradle combines the power and flexibility of Ant with dependency management 
of Ivy and conventions of Maven; 
• Gradle is a programming build tool with DSL based on Groovy. 
Kaunas Java User Group, 2014 2
Features 
• Build Java, Android, Scala, Groovy, c++ and others; 
• Dependency management; 
• Incremental builds; 
• Task exclusion; 
• Supports plugins; 
• Multi-project builds; 
• Hook into any build step; 
• Camel case invocation – helloWorld task can be called by doing gradle hW; 
• Gradle wrapper; 
• HTML test reporting; 
• Ant integration. 
Kaunas Java User Group, 2014 3
Hello World 
• Gradle has two phases – configuration and execution; 
• Run each task and see what gets printed out 
• How would you do that with Maven? 
Kaunas Java User Group, 2014 4
Tasks 
• Gradle has task types for most common operations; 
• You can specify inputs and outputs for a task. If those haven‘t changed since last 
execution, it won‘t be executed again; 
• You can create your own task types by extending DefaultTask. 
Kaunas Java User Group, 2014 5
Task Dependencies 
• shouldRunAfter is used for task ordering, not for dependencies. For example, it 
can be used for running unit tests before integration tests. This may be ignored 
during parallel task execution; 
• mustRunAfter will never be ignored, use this for strong ordering; 
Kaunas Java User Group, 2014 6
Building Java Projects 
• Simply include the plugin 
Kaunas Java User Group, 2014 7
Java Plugin Tasks 
• compileJava - compiles production Java source files using javac; 
• processResources - copies production resources into the production classes 
directory; 
• classes - assembles the production classes directory; 
• compileTestJava - compiles test Java source files using javac; 
• processTestResources - Copies test resources into the test classes directory; 
• testClasses - Assembles the test classes directory; 
• jar - Assembles the jar file; 
• javadoc - Generates API documentation for the production Java source, using 
Javadoc; 
• test - Runs the unit tests using JUnit or TestNG. 
Kaunas Java User Group, 2014 8
Lifecycle Tasks 
• assemble - Assembles all the archives in the project; 
• check - Performs all verification tasks in the project; 
• build - Performs a full build of the project (check and assemble); 
• buildNeeded - Performs a full build of the project and all projects it depends on; 
• buildDependents - Performs a full build of the project and all projects which 
depend on it. 
Kaunas Java User Group, 2014 9
Dependency Management 
Kaunas Java User Group, 2014 10
Source Sets 
Kaunas Java User Group, 2014 11
Test Reporting 
• Tests have XML and HTML reporting by default; 
• If you have multiple test tasks, you will need a separate reporting task; 
• HTML reporting includes execution time, stdout and stderr outputs. 
Kaunas Java User Group, 2014 12
The Gradle Wrapper 
• Gradle wrapper allows developers to use gradle, without even downloading it 
manually; 
• Every developer will be using the same version for building and CI server won‘t 
need additional configuration; 
• Run wrapper task once, it will create gradle executables which you will commit 
into source control; 
• You can specify the version or full url. 
Kaunas Java User Group, 2014 13
Init Scripts 
• Init scripts can be run each time before task execution; 
• You can pass init scripts with -I flag or include .gradle files in 
GRADLE_HOME/init.d/ directory; 
• This can be useful for enterprise policies and repositories. 
Kaunas Java User Group, 2014 14
Roadmap 
• Incremental Java compilation; 
• Persistable and much faster configuration; 
• Improved parallel execution; 
• Global cache; 
• Dependency variants; 
• Watcher mode; 
Kaunas Java User Group, 2014 15
Demo 
• Sources - https://github.com/n3ziniuka5/gradle-examples 
Kaunas Java User Group, 2014 16
Thank You! 
Laurynas Tret jakovas 
laurynas.tret jakovas@gmail.com 
Kaunas Java User Group, 2014 17

Contenu connexe

Tendances

An Introduction to Maven
An Introduction to MavenAn Introduction to Maven
An Introduction to MavenVadym Lotar
 
JUnit & Mockito, first steps
JUnit & Mockito, first stepsJUnit & Mockito, first steps
JUnit & Mockito, first stepsRenato Primavera
 
Deep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKDeep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKJosé Paumard
 
Clean Architecture
Clean ArchitectureClean Architecture
Clean ArchitectureBadoo
 
Golang - Overview of Go (golang) Language
Golang - Overview of Go (golang) LanguageGolang - Overview of Go (golang) Language
Golang - Overview of Go (golang) LanguageAniruddha Chakrabarti
 
Clean Architecture Essentials - Stockholm Software Craftsmanship
Clean Architecture Essentials - Stockholm Software CraftsmanshipClean Architecture Essentials - Stockholm Software Craftsmanship
Clean Architecture Essentials - Stockholm Software CraftsmanshipIvan Paulovich
 
Continuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CIContinuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CIDavid Hahn
 
Service Worker Presentation
Service Worker PresentationService Worker Presentation
Service Worker PresentationKyle Dorman
 
An Introduction to Test Driven Development
An Introduction to Test Driven Development An Introduction to Test Driven Development
An Introduction to Test Driven Development CodeOps Technologies LLP
 
Introduction to the Dart language
Introduction to the Dart languageIntroduction to the Dart language
Introduction to the Dart languageJana Moudrá
 
Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub ActionsKnoldus Inc.
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker IntroductionPeng Xiao
 

Tendances (20)

An Introduction to Maven
An Introduction to MavenAn Introduction to Maven
An Introduction to Maven
 
JUnit & Mockito, first steps
JUnit & Mockito, first stepsJUnit & Mockito, first steps
JUnit & Mockito, first steps
 
Deep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKDeep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UK
 
Clean Architecture
Clean ArchitectureClean Architecture
Clean Architecture
 
Jenkins tutorial
Jenkins tutorialJenkins tutorial
Jenkins tutorial
 
Golang - Overview of Go (golang) Language
Golang - Overview of Go (golang) LanguageGolang - Overview of Go (golang) Language
Golang - Overview of Go (golang) Language
 
jQuery
jQueryjQuery
jQuery
 
Clean Architecture Essentials - Stockholm Software Craftsmanship
Clean Architecture Essentials - Stockholm Software CraftsmanshipClean Architecture Essentials - Stockholm Software Craftsmanship
Clean Architecture Essentials - Stockholm Software Craftsmanship
 
Continuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CIContinuous Integration/Deployment with Gitlab CI
Continuous Integration/Deployment with Gitlab CI
 
Service Worker Presentation
Service Worker PresentationService Worker Presentation
Service Worker Presentation
 
An Introduction to Test Driven Development
An Introduction to Test Driven Development An Introduction to Test Driven Development
An Introduction to Test Driven Development
 
Jenkins CI
Jenkins CIJenkins CI
Jenkins CI
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Maven tutorial
Maven tutorialMaven tutorial
Maven tutorial
 
Jenkins CI presentation
Jenkins CI presentationJenkins CI presentation
Jenkins CI presentation
 
Spring data jpa
Spring data jpaSpring data jpa
Spring data jpa
 
Nodejs presentation
Nodejs presentationNodejs presentation
Nodejs presentation
 
Introduction to the Dart language
Introduction to the Dart languageIntroduction to the Dart language
Introduction to the Dart language
 
Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub Actions
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 

En vedette

Gradle - time for a new build
Gradle - time for a new buildGradle - time for a new build
Gradle - time for a new buildIgor Khotin
 
From Ant to Maven to Gradle a tale of CI tools for JVM
From Ant to Maven to Gradle a tale of CI tools for JVMFrom Ant to Maven to Gradle a tale of CI tools for JVM
From Ant to Maven to Gradle a tale of CI tools for JVMBucharest Java User Group
 
Gradle: The Build System you have been waiting for!
Gradle: The Build System you have been waiting for!Gradle: The Build System you have been waiting for!
Gradle: The Build System you have been waiting for!Corneil du Plessis
 

En vedette (6)

Gradle - time for a new build
Gradle - time for a new buildGradle - time for a new build
Gradle - time for a new build
 
Gradle
GradleGradle
Gradle
 
From Ant to Maven to Gradle a tale of CI tools for JVM
From Ant to Maven to Gradle a tale of CI tools for JVMFrom Ant to Maven to Gradle a tale of CI tools for JVM
From Ant to Maven to Gradle a tale of CI tools for JVM
 
Gradle: The Build System you have been waiting for!
Gradle: The Build System you have been waiting for!Gradle: The Build System you have been waiting for!
Gradle: The Build System you have been waiting for!
 
Gradle presentation
Gradle presentationGradle presentation
Gradle presentation
 
Gradle by Example
Gradle by ExampleGradle by Example
Gradle by Example
 

Similaire à Building with Gradle

Сергей Моренец: "Gradle. Write once, build everywhere"
Сергей Моренец: "Gradle. Write once, build everywhere"Сергей Моренец: "Gradle. Write once, build everywhere"
Сергей Моренец: "Gradle. Write once, build everywhere"Provectus
 
Gradle 2.breaking stereotypes.
Gradle 2.breaking stereotypes.Gradle 2.breaking stereotypes.
Gradle 2.breaking stereotypes.Stfalcon Meetups
 
Gradle 2.Write once, builde everywhere
Gradle 2.Write once, builde everywhereGradle 2.Write once, builde everywhere
Gradle 2.Write once, builde everywhereStrannik_2013
 
Gradle.Enemy at the gates
Gradle.Enemy at the gatesGradle.Enemy at the gates
Gradle.Enemy at the gatesStrannik_2013
 
Gradle 2.Breaking stereotypes
Gradle 2.Breaking stereotypesGradle 2.Breaking stereotypes
Gradle 2.Breaking stereotypesStrannik_2013
 
What's new in Gradle 4.0
What's new in Gradle 4.0What's new in Gradle 4.0
What's new in Gradle 4.0Eric Wendelin
 
Gradle - Build system evolved
Gradle - Build system evolvedGradle - Build system evolved
Gradle - Build system evolvedBhagwat Kumar
 
Comparison of Java Web Application Frameworks
Comparison of Java Web Application FrameworksComparison of Java Web Application Frameworks
Comparison of Java Web Application FrameworksAngelin R
 
OUG Ireland Meet-up 12th January
OUG Ireland Meet-up 12th JanuaryOUG Ireland Meet-up 12th January
OUG Ireland Meet-up 12th JanuaryBrendan Tierney
 
Getting to Walk with DevOps
Getting to Walk with DevOpsGetting to Walk with DevOps
Getting to Walk with DevOpsEklove Mohan
 
Gradle,the new build system for android
Gradle,the new build system for androidGradle,the new build system for android
Gradle,the new build system for androidzhang ghui
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulMert Çalışkan
 
Ci jenkins maven svn
Ci jenkins maven svnCi jenkins maven svn
Ci jenkins maven svnAnkur Goyal
 

Similaire à Building with Gradle (20)

Building with Gradle
Building with GradleBuilding with Gradle
Building with Gradle
 
Сергей Моренец: "Gradle. Write once, build everywhere"
Сергей Моренец: "Gradle. Write once, build everywhere"Сергей Моренец: "Gradle. Write once, build everywhere"
Сергей Моренец: "Gradle. Write once, build everywhere"
 
Gradle 2.breaking stereotypes.
Gradle 2.breaking stereotypes.Gradle 2.breaking stereotypes.
Gradle 2.breaking stereotypes.
 
Gradle 2.Write once, builde everywhere
Gradle 2.Write once, builde everywhereGradle 2.Write once, builde everywhere
Gradle 2.Write once, builde everywhere
 
Gradle.Enemy at the gates
Gradle.Enemy at the gatesGradle.Enemy at the gates
Gradle.Enemy at the gates
 
Gradle 2.Breaking stereotypes
Gradle 2.Breaking stereotypesGradle 2.Breaking stereotypes
Gradle 2.Breaking stereotypes
 
Gradle - Build System
Gradle - Build SystemGradle - Build System
Gradle - Build System
 
Automated infrastructure
Automated infrastructureAutomated infrastructure
Automated infrastructure
 
What's new in Gradle 4.0
What's new in Gradle 4.0What's new in Gradle 4.0
What's new in Gradle 4.0
 
Gradle
GradleGradle
Gradle
 
Gradle - Build system evolved
Gradle - Build system evolvedGradle - Build system evolved
Gradle - Build system evolved
 
Comparison of Java Web Application Frameworks
Comparison of Java Web Application FrameworksComparison of Java Web Application Frameworks
Comparison of Java Web Application Frameworks
 
Automated Infrastructure
Automated InfrastructureAutomated Infrastructure
Automated Infrastructure
 
OUG Ireland Meet-up 12th January
OUG Ireland Meet-up 12th JanuaryOUG Ireland Meet-up 12th January
OUG Ireland Meet-up 12th January
 
Gradle
GradleGradle
Gradle
 
Maven
MavenMaven
Maven
 
Getting to Walk with DevOps
Getting to Walk with DevOpsGetting to Walk with DevOps
Getting to Walk with DevOps
 
Gradle,the new build system for android
Gradle,the new build system for androidGradle,the new build system for android
Gradle,the new build system for android
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
 
Ci jenkins maven svn
Ci jenkins maven svnCi jenkins maven svn
Ci jenkins maven svn
 

Plus de Kaunas Java User Group

Plus de Kaunas Java User Group (12)

Smart House Based on Raspberry PI + Java EE by Tadas Brasas
Smart House Based on Raspberry PI + Java EE by Tadas BrasasSmart House Based on Raspberry PI + Java EE by Tadas Brasas
Smart House Based on Raspberry PI + Java EE by Tadas Brasas
 
Presentation
PresentationPresentation
Presentation
 
Adf presentation
Adf presentationAdf presentation
Adf presentation
 
Bye Bye Cowboy Coder Days! (Legacy Code & TDD)
Bye Bye Cowboy Coder Days! (Legacy Code & TDD)Bye Bye Cowboy Coder Days! (Legacy Code & TDD)
Bye Bye Cowboy Coder Days! (Legacy Code & TDD)
 
Flyway
FlywayFlyway
Flyway
 
Eh cache in Kaunas JUG
Eh cache in Kaunas JUGEh cache in Kaunas JUG
Eh cache in Kaunas JUG
 
Apache Lucene Informacijos paieška
Apache Lucene Informacijos paieška Apache Lucene Informacijos paieška
Apache Lucene Informacijos paieška
 
Java 8 Stream API (Valdas Zigas)
Java 8 Stream API (Valdas Zigas)Java 8 Stream API (Valdas Zigas)
Java 8 Stream API (Valdas Zigas)
 
Intro to Java 8 Closures (Dainius Mezanskas)
Intro to Java 8 Closures (Dainius Mezanskas)Intro to Java 8 Closures (Dainius Mezanskas)
Intro to Java 8 Closures (Dainius Mezanskas)
 
Kaunas JUG#1: Intro (Valdas Zigas)
Kaunas JUG#1: Intro (Valdas Zigas)Kaunas JUG#1: Intro (Valdas Zigas)
Kaunas JUG#1: Intro (Valdas Zigas)
 
Kaunas JUG#1: Java History and Trends (Dainius Mezanskas)
Kaunas JUG#1: Java History and Trends (Dainius Mezanskas)Kaunas JUG#1: Java History and Trends (Dainius Mezanskas)
Kaunas JUG#1: Java History and Trends (Dainius Mezanskas)
 
Kaunas JUG#2: Devoxx 2013 (Saulius Tvarijonas)
Kaunas JUG#2: Devoxx 2013 (Saulius Tvarijonas)Kaunas JUG#2: Devoxx 2013 (Saulius Tvarijonas)
Kaunas JUG#2: Devoxx 2013 (Saulius Tvarijonas)
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 

Dernier (20)

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

Building with Gradle

  • 1. Building with Laurynas Tret jakovas laurynas.tret jakovas@gmail.com Kaunas Java User Group, 2014 1
  • 2. Why Gradle? • Ant makes you reinvent the wheel every time; • Ant build scripts can get hard to maintain very quickly; • Maven does not care about your project, you must make sure that your project works well with Maven – it enforces convention; • You must do everything “The Maven Way” or implement custom plugins; • Gradle combines the power and flexibility of Ant with dependency management of Ivy and conventions of Maven; • Gradle is a programming build tool with DSL based on Groovy. Kaunas Java User Group, 2014 2
  • 3. Features • Build Java, Android, Scala, Groovy, c++ and others; • Dependency management; • Incremental builds; • Task exclusion; • Supports plugins; • Multi-project builds; • Hook into any build step; • Camel case invocation – helloWorld task can be called by doing gradle hW; • Gradle wrapper; • HTML test reporting; • Ant integration. Kaunas Java User Group, 2014 3
  • 4. Hello World • Gradle has two phases – configuration and execution; • Run each task and see what gets printed out • How would you do that with Maven? Kaunas Java User Group, 2014 4
  • 5. Tasks • Gradle has task types for most common operations; • You can specify inputs and outputs for a task. If those haven‘t changed since last execution, it won‘t be executed again; • You can create your own task types by extending DefaultTask. Kaunas Java User Group, 2014 5
  • 6. Task Dependencies • shouldRunAfter is used for task ordering, not for dependencies. For example, it can be used for running unit tests before integration tests. This may be ignored during parallel task execution; • mustRunAfter will never be ignored, use this for strong ordering; Kaunas Java User Group, 2014 6
  • 7. Building Java Projects • Simply include the plugin Kaunas Java User Group, 2014 7
  • 8. Java Plugin Tasks • compileJava - compiles production Java source files using javac; • processResources - copies production resources into the production classes directory; • classes - assembles the production classes directory; • compileTestJava - compiles test Java source files using javac; • processTestResources - Copies test resources into the test classes directory; • testClasses - Assembles the test classes directory; • jar - Assembles the jar file; • javadoc - Generates API documentation for the production Java source, using Javadoc; • test - Runs the unit tests using JUnit or TestNG. Kaunas Java User Group, 2014 8
  • 9. Lifecycle Tasks • assemble - Assembles all the archives in the project; • check - Performs all verification tasks in the project; • build - Performs a full build of the project (check and assemble); • buildNeeded - Performs a full build of the project and all projects it depends on; • buildDependents - Performs a full build of the project and all projects which depend on it. Kaunas Java User Group, 2014 9
  • 10. Dependency Management Kaunas Java User Group, 2014 10
  • 11. Source Sets Kaunas Java User Group, 2014 11
  • 12. Test Reporting • Tests have XML and HTML reporting by default; • If you have multiple test tasks, you will need a separate reporting task; • HTML reporting includes execution time, stdout and stderr outputs. Kaunas Java User Group, 2014 12
  • 13. The Gradle Wrapper • Gradle wrapper allows developers to use gradle, without even downloading it manually; • Every developer will be using the same version for building and CI server won‘t need additional configuration; • Run wrapper task once, it will create gradle executables which you will commit into source control; • You can specify the version or full url. Kaunas Java User Group, 2014 13
  • 14. Init Scripts • Init scripts can be run each time before task execution; • You can pass init scripts with -I flag or include .gradle files in GRADLE_HOME/init.d/ directory; • This can be useful for enterprise policies and repositories. Kaunas Java User Group, 2014 14
  • 15. Roadmap • Incremental Java compilation; • Persistable and much faster configuration; • Improved parallel execution; • Global cache; • Dependency variants; • Watcher mode; Kaunas Java User Group, 2014 15
  • 16. Demo • Sources - https://github.com/n3ziniuka5/gradle-examples Kaunas Java User Group, 2014 16
  • 17. Thank You! Laurynas Tret jakovas laurynas.tret jakovas@gmail.com Kaunas Java User Group, 2014 17