Gradle
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
4,647
On Slideshare
1,551
From Embeds
3,096
Number of Embeds
11

Actions

Shares
Downloads
41
Comments
0
Likes
7

Embeds 3,096

http://www.sw-samuraj.cz 2,797
http://www-ig-opensocial.googleusercontent.com 257
http://587243673491863943_664dc731d127312ee939ce369c74467407087252.blogspot.com 17
http://www.linkedin.com 5
http://translate.googleusercontent.com 5
https://www.linkedin.com 5
http://www.zdrojak.cz 5
http://plus.url.google.com 2
http://www.feedspot.com 1
https://twitter.com 1
http://samuraj2.rssing.com 1

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. www.adastra.czGradleModern Automation ToolVít Kotačka25. 4. 2013
  • 2. Gradle? What is it?• Build automation tool– building, testing, deployment, reporting etc.• Domain Specific Language (DSL) based on Groovy• Combines the power and flexibility of Ant with thedependency management and conventions of Maven.• Features are added by plugins.• Out-of-the-box support: Java, Groovy, Scala, Web, OSGi• Free and Open Source (Apache Licence)www.adastra.cz 2
  • 3. Is it really good?www.adastra.cz 3
  • 4. Project & Task• Project represents a component which can be built.• Project defines a related set of tasks.ProjectDir/build.gradle• Task is an atomic unit of work which a build performs.task helloWorld << {println Hello, world!}www.adastra.cz 4
  • 5. Java Projectapply plugin: java• Maven default layout– src/main/java– src/main/resource– src/test/java– src/test/resources• Additional tasks– clean– build– jar– test– javadocwww.adastra.cz 5
  • 6. Unit Testsapply plugin: javarepositories {mavenCentral()}dependencies {testCompile junit:junit:4.11}• JUnit default• TestNG explicittest.useTestNG()JUnitwww.adastra.cz 6
  • 7. Web Projectapply plugin: warwar {baseName = deepThought}dependencies {providedCompile javax.servlet:servlet-api:3.0}• Project layout– src/main/webapp• Additional task– warJUnitwww.adastra.cz 7
  • 8. Jettyconfigurations {jetty8}dependencies {jetty8 org.mortbay.jetty:jetty-runner:8.1.10.v20130312}task runJetty8(type: JavaExec) {main = org.mortbay.jetty.runner.Runnerargs = [war.archivePath]classpath configurations.jetty8}• Plugin jettysupports Jetty 6only.JUnitwww.adastra.cz 8
  • 9. Code Qualityapply {plugin checkstyleplugin pmdplugin findbugsplugin jdepend‚plugin sonar}www.adastra.cz 9
  • 10. Multi Projectbuild.gradleallprojects {task work << {...}}subprojects { ... }project(:nonJava) { ... }settings.gradleinclude nonJava,java,webwww.adastra.cz 10
  • 11. Antbuild.xml<project name="DeepThought"><property name="ultimateAnswer" value="12"/><target name="answer"><echo>${ultimateAnswer}</echo></target></project>build.gradleant.importBuild ant/build.xmlant.properties[ultimateAnswer] = 42www.adastra.cz 11
  • 12. Gradle GUIgradle --guiwww.adastra.cz 12
  • 13. IDE Supportwww.adastra.cz 13
  • 14. About Mehttp://sw-samuraj.cz@sw_samurajhttp://linkedin.com/in/vitkotackawww.adastra.cz 14
  • 15. www.adastra.cz 15