SlideShare ist ein Scribd-Unternehmen logo
1 von 29
Downloaden Sie, um offline zu lesen
10 Cool Facts about Gradle


   Evgeny Goldin, @evgeny_goldin
Who am I?

•   12 years in the industry

•   Mostly JS and JVM-related experience: Java, Groovy, Scala

•   Ant, Maven, Gradle, Artifactory, TeamCity, Jenkins

•   https://github.com/evgeny-goldin/

•   Write for blog, wiki, GroovyMag and “Methods & Tools”

•   Groovy conference speaker: G8Conf, Gr8US
http://evgeny-goldin.com/wiki/Maven-jenkins-plugin
Gradle is ..
1. Gradle is .. Fast

•   Not verbose by default

    • gradle	
  -­‐q	
  clean	
  build
    • gradle	
  -­‐i	
  clean	
  build
•   Cheksum-based incremental builds (tasks)

    • gradle	
  build
    • gradle	
  build
2. Gradle is .. Concise


  apply	
  plugin:	
  'java'
3. Gradle is .. Groovy DSL
subprojects	
  {

	
  	
  	
  	
  dependencies	
  {
	
  	
  	
  	
  	
  	
  	
  	
  compile	
  	
  	
  	
  	
  'org.twitter4j:twitter4j-­‐core:2.2.4'
	
  	
  	
  	
  	
  	
  	
  	
  runtime	
  	
  	
  	
  	
  'ch.qos.logback:logback-­‐classic:0.9.29'
	
  	
  	
  	
  	
  	
  	
  	
  testCompile	
  'org.spockframework:spock-­‐core:0.6-­‐groovy-­‐1.8-­‐SNAPSHOT'
	
  	
  	
  	
  }

	
  	
  	
  	
  task	
  copyCommonResources(	
  type:	
  Copy	
  )	
  {
	
  	
  	
  	
  	
  	
  	
  	
  from	
  project(	
  ':twitter4j'	
  ).file(	
  'common-­‐resources'	
  )
	
  	
  	
  	
  	
  	
  	
  	
  into	
  compileJava.destinationDir
	
  	
  	
  	
  }

	
  	
  	
  	
  jar.dependsOn	
  copyCommonResources
}
3. Gradle is .. Groovy DSL
subprojects	
  {

	
  	
  	
  	
  dependencies	
  {
	
  	
  	
  	
  	
  	
  	
  	
  compile	
  	
  	
  	
  	
  'org.twitter4j:twitter4j-­‐core:2.2.4'
	
  	
  	
  	
  	
  	
  	
  	
  runtime	
  	
  	
  	
  	
  'ch.qos.logback:logback-­‐classic:0.9.29'
	
  	
  	
  	
  	
  	
  	
  	
  testCompile	
  'org.spockframework:spock-­‐core:0.6-­‐groovy-­‐1.8-­‐SNAPSHOT'
	
  	
  	
  	
  }

	
  	
  	
  	
  task	
  copyCommonResources(	
  type:	
  Copy	
  )	
  {
	
  	
  	
  	
  	
  	
  	
  	
  from	
  project(	
  ':twitter4j'	
  ).file(	
  'common-­‐resources'	
  )
	
  	
  	
  	
  	
  	
  	
  	
  into	
  compileJava.destinationDir
	
  	
  	
  	
  }

	
  	
  	
  	
  jar.dependsOn	
  copyCommonResources
}
3. Gradle is .. Groovy DSL
subprojects	
  {

	
  	
  	
  	
  dependencies	
  {
	
  	
  	
  	
  	
  	
  	
  	
  compile	
  	
  	
  	
  	
  'org.twitter4j:twitter4j-­‐core:2.2.4'
	
  	
  	
  	
  	
  	
  	
  	
  runtime	
  	
  	
  	
  	
  'ch.qos.logback:logback-­‐classic:0.9.29'
	
  	
  	
  	
  	
  	
  	
  	
  testCompile	
  'org.spockframework:spock-­‐core:0.6-­‐groovy-­‐1.8-­‐SNAPSHOT'
	
  	
  	
  	
  }

	
  	
  	
  	
  jar.doFirst	
  {
	
  	
  	
  	
  	
  	
  	
  	
  copy	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  from	
  project(	
  ':twitter4j'	
  ).file(	
  'common-­‐resources'	
  )
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  into	
  compileJava.destinationDir
	
  	
  	
  	
  	
  	
  	
  	
  }
	
  	
  	
  	
  }
}
4. Gradle is .. Groovy
	
  	
  	
  	
  task	
  assemblePlugin	
  <<	
  {

	
  	
  	
  	
  	
  	
  	
  	
  File	
  tempFile	
  =	
  File.createTempFile(	
  project.name,	
  null	
  )
	
  	
  	
  	
  	
  	
  	
  	
  tempFile.write(	
  file(	
  'src/main/resources/teamcity-­‐plugin.xml'	
  ).text.
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  replaceAll(	
  '@version@',	
  project.version	
  ))

	
  	
  	
  	
  	
  	
  	
  	
  File	
  compileLibs	
  =	
  new	
  File(	
  project.buildDir,	
  'compile-­‐libs'	
  )

	
  	
  	
  	
  	
  	
  	
  	
  (	
  configurations.compile.files	
  -­‐	
  configurations.provided.files	
  ).each	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  File	
  file	
  -­‐>	
  ant.copy(	
  file:	
  file,	
  todir:	
  compileLibs	
  )
	
  	
  	
  	
  	
  	
  	
  	
  }

	
  	
  	
  	
  	
  	
  	
  	
  ant.zip(	
  destfile:	
  destinationZip	
  )	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  zipfileset(	
  file:	
  tempFile,	
  	
  	
  	
  fullpath:	
  'teamcity-­‐plugin.xml'	
  )
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  zipfileset(	
  dir	
  :	
  compileLibs,	
  prefix	
  	
  :	
  'server'	
  )
	
  	
  	
  	
  	
  	
  	
  	
  }
	
  	
  	
  	
  }
4. Gradle is .. Groovy
	
  	
  	
  	
  task	
  assemblePlugin	
  <<	
  {

	
  	
  	
  	
  	
  	
  	
  	
  File	
  tempFile	
  =	
  File.createTempFile(	
  project.name,	
  null	
  )
	
  	
  	
  	
  	
  	
  	
  	
  tempFile.write(	
  file(	
  'src/main/resources/teamcity-­‐plugin.xml'	
  ).text.
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  replaceAll(	
  '@version@',	
  project.version	
  ))

	
  	
  	
  	
  	
  	
  	
  	
  File	
  compileLibs	
  =	
  new	
  File(	
  project.buildDir,	
  'compile-­‐libs'	
  )

	
  	
  	
  	
  	
  	
  	
  	
  (	
  configurations.compile.files	
  -­‐	
  configurations.provided.files	
  ).each	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  File	
  file	
  -­‐>	
  ant.copy(	
  file:	
  file,	
  todir:	
  compileLibs	
  )
	
  	
  	
  	
  	
  	
  	
  	
  }

	
  	
  	
  	
  	
  	
  	
  	
  ant.zip(	
  destfile:	
  destinationZip	
  )	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  zipfileset(	
  file:	
  tempFile,	
  	
  	
  	
  fullpath:	
  'teamcity-­‐plugin.xml'	
  )
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  zipfileset(	
  dir	
  :	
  compileLibs,	
  prefix	
  	
  :	
  'server'	
  )
	
  	
  	
  	
  	
  	
  	
  	
  }
	
  	
  	
  	
  }
4. Gradle is .. Groovy
	
  	
  	
  	
  task	
  assemblePlugin	
  <<	
  {

	
  	
  	
  	
  	
  	
  	
  	
  File	
  tempFile	
  =	
  File.createTempFile(	
  project.name,	
  null	
  )
	
  	
  	
  	
  	
  	
  	
  	
  tempFile.write(	
  file(	
  'src/main/resources/teamcity-­‐plugin.xml'	
  ).text.
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  replaceAll(	
  '@version@',	
  project.version	
  ))

	
  	
  	
  	
  	
  	
  	
  	
  File	
  compileLibs	
  =	
  new	
  File(	
  project.buildDir,	
  'compile-­‐libs'	
  )

	
  	
  	
  	
  	
  	
  	
  	
  (	
  configurations.compile.files	
  -­‐	
  configurations.provided.files	
  ).each	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  File	
  file	
  -­‐>	
  ant.copy(	
  file:	
  file,	
  todir:	
  compileLibs	
  )
	
  	
  	
  	
  	
  	
  	
  	
  }

	
  	
  	
  	
  	
  	
  	
  	
  ant.zip(	
  destfile:	
  destinationZip	
  )	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  zipfileset(	
  file:	
  tempFile,	
  	
  	
  	
  fullpath:	
  'teamcity-­‐plugin.xml'	
  )
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  zipfileset(	
  dir:	
  	
  compileLibs,	
  prefix	
  	
  :	
  'server'	
  )
	
  	
  	
  	
  	
  	
  	
  	
  }
	
  	
  	
  	
  }
5. Gradle .. knows Groovy

apply	
  plugin:	
  'groovy'	
  

dependencies	
  {	
  	
  
	
  	
  	
  	
  groovy	
  	
  'org.codehaus.groovy:groovy-­‐all:1.8.1'
}
5. Gradle .. knows Scala

apply	
  plugin:	
  'scala'	
  

dependencies	
  {
	
  	
  	
  	
  scalaTools	
  'org.scala-­‐lang:scala-­‐compiler:2.9.1.RC4',
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  'org.scala-­‐lang:scala-­‐library:2.9.1.RC4'
	
  	
  	
  	
  compile	
  	
  	
  	
  'org.scala-­‐lang:scala-­‐library:2.9.1.RC4'
}
6. Gradle .. knows Maven

•   Repositories: Maven/Artifactory

•   Dependencies: Maven/Ivy

•   Artifacts: gradle clean install

•   maven2gradle: https://github.com/jbaruch/maven2gradle

•   Import “pom.xml” - work in progress

•   Run Maven plugins or run Gradle from Maven - can be nice
7. Gradle .. knows testing
test	
  {	
  	
  	
  	
  
	
  	
  	
  	
  useJUnit()
	
  	
  	
  	
  useTestNG()
	
  	
  	
  	
  jvmArgs	
  ['-­‐Xmx512M']
	
  	
  	
  	
  include	
  '**/tests/special/**/*Test.class'
	
  	
  	
  	
  exclude	
  '**/Old*Test.class'
	
  	
  	
  	
  forkEvery	
  	
  	
  	
  	
  	
  	
  	
  =	
  30
	
  	
  	
  	
  maxParallelForks	
  =	
  Runtime.runtime.availableProcessors()
}
	
  
test	
  {
	
  	
  	
  	
  beforeTest	
  {	
  descr	
  	
  	
  	
  	
  	
  	
  	
  	
  -­‐>	
  ..	
  }
	
  	
  	
  	
  afterTest	
  	
  {	
  descr,	
  result	
  -­‐>	
  ..	
  }
	
  	
  	
  	
  beforeSuite{	
  descr	
  	
  	
  	
  	
  	
  	
  	
  	
  -­‐>	
  ..	
  }	
  	
  	
  	
  	
  
	
  	
  	
  	
  afterSuite	
  {	
  descr,	
  result	
  -­‐>	
  ..	
  }
}
7. Gradle .. knows testing
7. Gradle .. knows testing
test	
  {	
  	
  	
  	
  
	
  	
  	
  	
  useJUnit()
	
  	
  	
  	
  useTestNG()
	
  	
  	
  	
  jvmArgs	
  ['-­‐Xmx512M']
	
  	
  	
  	
  include	
  '**/tests/special/**/*Test.class'
	
  	
  	
  	
  exclude	
  '**/Old*Test.class'
	
  	
  	
  	
  forkEvery	
  	
  	
  	
  	
  	
  	
  	
  =	
  30
	
  	
  	
  	
  maxParallelForks	
  =	
  Runtime.runtime.availableProcessors()
}
	
  
test	
  {
	
  	
  	
  	
  beforeTest	
  {	
  descr	
  	
  	
  	
  	
  	
  	
  	
  	
  -­‐>	
  ..	
  }
	
  	
  	
  	
  afterTest	
  	
  {	
  descr,	
  result	
  -­‐>	
  ..	
  }
	
  	
  	
  	
  beforeSuite{	
  descr	
  	
  	
  	
  	
  	
  	
  	
  	
  -­‐>	
  ..	
  }	
  	
  	
  	
  	
  
	
  	
  	
  	
  afterSuite	
  {	
  descr,	
  result	
  -­‐>	
  ..	
  }
}
8. Gradle is .. Flexible

//	
  Multiple	
  source	
  directories

sourceSets.main.java.srcDirs	
  =	
  [	
  'src/main/java',	
  'srcAdditional/main/java'	
  ]
sourceSets.main.java.srcDirs	
  'srcAdditionalTwo/main/java'

//	
  Multiple	
  test	
  source	
  directories

sourceSets.test.java.srcDirs	
  =	
  [	
  'src/test/java',	
  'srcAdditional/test/java'	
  ]
sourceSets.test.java.srcDirs	
  'srcAdditionalTwo/test/java'
8. Gradle is .. Flexible
//	
  Multiple	
  dependencies	
  groups

configurations	
  {	
  myConf.extendsFrom	
  compile	
  }
	
  
dependencies	
  	
  	
  {
	
  	
  	
  	
  compile	
  	
  	
  	
  	
  'org.twitter4j:twitter4j-­‐core:2.2.4'
	
  	
  	
  	
  runtime	
  	
  	
  	
  	
  'ch.qos.logback:logback-­‐classic:0.9.29'
	
  	
  	
  	
  testCompile	
  'org.spockframework:spock-­‐core:0.6-­‐groovy-­‐1.8-­‐SNAPSHOT'
	
  	
  	
  	
  testRuntime	
  '	
  ...	
  '
	
  	
  	
  	
  
	
  	
  	
  	
  groovy	
  	
  	
  	
  	
  	
  'org.codehaus.groovy:groovy-­‐all:1.9.0-­‐beta-­‐2'
	
  	
  	
  	
  scalaTools	
  	
  'org.scala-­‐lang:scala-­‐compiler:2.9.1.RC4',
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  'org.scala-­‐lang:scala-­‐library:2.9.1.RC4'
	
  	
  	
  	
  myConf	
  	
  	
  	
  	
  	
  'org.slf4j:slf4j-­‐api:1.6.2'
}
8. Gradle is .. Flexible
//	
  Multiple	
  artifacts	
  per	
  project:	
  sources	
  +	
  javadoc	
  jars

task	
  packageSources(	
  type:	
  Jar	
  )	
  {
	
  	
  	
  from	
  sourceSets.main.allSource
	
  	
  	
  classifier	
  =	
  'sources'
}	
  

task	
  packageJavadoc(	
  type:	
  Jar,	
  dependsOn:	
  'javadoc'	
  )	
  {
	
  	
  	
  from	
  javadoc.destinationDir
	
  	
  	
  classifier	
  =	
  'javadoc'
}
	
  
artifacts	
  {
	
  	
  archives(	
  packageSources	
  )
	
  	
  archives(	
  packageJavadoc	
  )
}
9. Gradle is .. Programmable
task	
  assembleApi(	
  type:	
  Jar,	
  dependsOn:	
  compileGroovyApi	
  )	
  {
	
  	
  	
  	
  appendix	
  	
  	
  	
  =	
  'api'
	
  	
  	
  	
  includes	
  	
  	
  	
  =	
  [	
  '**/api/**'	
  ]
	
  	
  	
  	
  from	
  compileGroovyApi.destinationDir
}


task	
  copyCommonResources(	
  type:	
  Copy	
  )	
  {
	
  	
  	
  	
  from	
  project(	
  ':twitter4j'	
  ).file(	
  'common-­‐resources'	
  )
	
  	
  	
  	
  into	
  compileJava.destinationDir
}

jar.dependsOn	
  copyCommonResources
jar.doFirst{	
  ..	
  }
jar.doLast	
  {	
  ..	
  }
9. Gradle is .. Programmable
task	
  assembleApi(	
  type:	
  Jar,	
  dependsOn:	
  compileGroovyApi	
  )	
  {
	
  	
  	
  	
  appendix	
  	
  	
  	
  =	
  'api'
	
  	
  	
  	
  includes	
  	
  	
  	
  =	
  [	
  '**/api/**'	
  ]
	
  	
  	
  	
  from	
  compileGroovyApi.destinationDir
}


task	
  copyCommonResources(	
  type:	
  Copy	
  )	
  {
	
  	
  	
  	
  from	
  project(	
  ':twitter4j'	
  ).file(	
  'common-­‐resources'	
  )
	
  	
  	
  	
  into	
  compileJava.destinationDir
}

jar.dependsOn	
  copyCommonResources
jar.doFirst{	
  ..	
  }
jar.doLast	
  {	
  ..	
  }
10. Gradle is .. Fun and Open!



•   gradle-user: http://gradle.1045684.n5.nabble.com/gradle-user-f1431424.html

•   gradle-dev: http://gradle.1045684.n5.nabble.com/gradle-dev-f1436218.html
More Examples
•   Multi-Project (Groovy + Scala):
    https://github.com/evgeny-goldin/gradle-examples

•   Groovy Project:
    https://github.com/evgeny-goldin/gcommons/blob/master/build.gradle

•   TeamCity Plugins:
    https://github.com/evgeny-goldin/teamcity-plugins/blob/master/build.gradle

•   Gradle Plugins:
    https://github.com/evgeny-goldin/gradle-plugins/blob/master/build.gradle
Resources

•   http://gradle.org/

•   http://evgeny-goldin.com/wiki/Gradle

•   https://github.com/gradle

•   https://github.com/gradleware

•   http://gradleware.com/
Feel free to contact:

•   Groovy, Gradle, Builds

•   @evgeny_goldin

•   evgenyg@gmail.com

•   http://evgeny-goldin.com/blog/

•   http://evgeny-goldin.com/wiki/

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (19)

DevOps Odessa #TechTalks 21.01.2020
DevOps Odessa #TechTalks 21.01.2020DevOps Odessa #TechTalks 21.01.2020
DevOps Odessa #TechTalks 21.01.2020
 
Gradle in 45min - JBCN2-16 version
Gradle in 45min - JBCN2-16 versionGradle in 45min - JBCN2-16 version
Gradle in 45min - JBCN2-16 version
 
Using the Groovy Ecosystem for Rapid JVM Development
Using the Groovy Ecosystem for Rapid JVM DevelopmentUsing the Groovy Ecosystem for Rapid JVM Development
Using the Groovy Ecosystem for Rapid JVM Development
 
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume Laforge
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume LaforgeGroovy and Grails in Action - Devoxx 2008 - University - Guillaume Laforge
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume Laforge
 
Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010Gradle talk, Javarsovia 2010
Gradle talk, Javarsovia 2010
 
Jenkins' shared libraries in action
Jenkins' shared libraries in actionJenkins' shared libraries in action
Jenkins' shared libraries in action
 
Custom deployments with sbt-native-packager
Custom deployments with sbt-native-packagerCustom deployments with sbt-native-packager
Custom deployments with sbt-native-packager
 
Maven
MavenMaven
Maven
 
Ship your Scala code often and easy with Docker
Ship your Scala code often and easy with DockerShip your Scala code often and easy with Docker
Ship your Scala code often and easy with Docker
 
Cool JVM Tools to Help You Test
Cool JVM Tools to Help You TestCool JVM Tools to Help You Test
Cool JVM Tools to Help You Test
 
Gradle For Beginners (Serbian Developer Conference 2013 english)
Gradle For Beginners (Serbian Developer Conference 2013 english)Gradle For Beginners (Serbian Developer Conference 2013 english)
Gradle For Beginners (Serbian Developer Conference 2013 english)
 
Docker workshop 0507 Taichung
Docker workshop 0507 Taichung Docker workshop 0507 Taichung
Docker workshop 0507 Taichung
 
Idiomatic gradle plugin writing
Idiomatic gradle plugin writingIdiomatic gradle plugin writing
Idiomatic gradle plugin writing
 
The Gradle in Ratpack: Dissected
The Gradle in Ratpack: DissectedThe Gradle in Ratpack: Dissected
The Gradle in Ratpack: Dissected
 
Challenges of container configuration
Challenges of container configurationChallenges of container configuration
Challenges of container configuration
 
Cool Jvm Tools to Help you Test - Aylesbury Testers Version
Cool Jvm Tools to Help you Test - Aylesbury Testers VersionCool Jvm Tools to Help you Test - Aylesbury Testers Version
Cool Jvm Tools to Help you Test - Aylesbury Testers Version
 
Everything as a code
Everything as a codeEverything as a code
Everything as a code
 
うさぎ組 in G* WorkShop -うさみみの日常-
うさぎ組 in G* WorkShop -うさみみの日常-うさぎ組 in G* WorkShop -うさみみの日常-
うさぎ組 in G* WorkShop -うさみみの日常-
 
Idiomatic Gradle Plugin Writing - GradleSummit 2016
Idiomatic Gradle Plugin Writing - GradleSummit 2016Idiomatic Gradle Plugin Writing - GradleSummit 2016
Idiomatic Gradle Plugin Writing - GradleSummit 2016
 

Andere mochten auch

Surrealism and abstract expressionism
Surrealism and abstract expressionismSurrealism and abstract expressionism
Surrealism and abstract expressionism
alquea13
 
How to prepare for that first investment property(finsihed)
How to prepare for that first investment property(finsihed)How to prepare for that first investment property(finsihed)
How to prepare for that first investment property(finsihed)
RandyBett
 
活著都是特別日子
活著都是特別日子活著都是特別日子
活著都是特別日子
David Leung
 
Walmart Store Inc 1208412318223884 8
Walmart Store Inc 1208412318223884 8Walmart Store Inc 1208412318223884 8
Walmart Store Inc 1208412318223884 8
rogersjr33
 

Andere mochten auch (20)

Surrealism and abstract expressionism
Surrealism and abstract expressionismSurrealism and abstract expressionism
Surrealism and abstract expressionism
 
Bread
BreadBread
Bread
 
Personal Branding In A Wired World
Personal Branding In A Wired WorldPersonal Branding In A Wired World
Personal Branding In A Wired World
 
Virusni hepatitis, hrvatska konsenzus konferencija 2013.
Virusni hepatitis, hrvatska konsenzus konferencija 2013.Virusni hepatitis, hrvatska konsenzus konferencija 2013.
Virusni hepatitis, hrvatska konsenzus konferencija 2013.
 
How to prepare for that first investment property(finsihed)
How to prepare for that first investment property(finsihed)How to prepare for that first investment property(finsihed)
How to prepare for that first investment property(finsihed)
 
trabajo con fotografia digital
trabajo con fotografia digitaltrabajo con fotografia digital
trabajo con fotografia digital
 
Ski Classes in Tsakhkadzor_eng
Ski Classes in Tsakhkadzor_engSki Classes in Tsakhkadzor_eng
Ski Classes in Tsakhkadzor_eng
 
Siena International Photo Awards Honorable Mentions: Category Travel
Siena International Photo Awards Honorable  Mentions:  Category TravelSiena International Photo Awards Honorable  Mentions:  Category Travel
Siena International Photo Awards Honorable Mentions: Category Travel
 
תוכנית שיווק באינטרנט
תוכנית שיווק באינטרנטתוכנית שיווק באינטרנט
תוכנית שיווק באינטרנט
 
20141018群馬ベンチャーサミット
20141018群馬ベンチャーサミット20141018群馬ベンチャーサミット
20141018群馬ベンチャーサミット
 
活著都是特別日子
活著都是特別日子活著都是特別日子
活著都是特別日子
 
Get More Done with Less: A Team Approach to Delivering Results for Career Ce...
Get More Done with Less:  A Team Approach to Delivering Results for Career Ce...Get More Done with Less:  A Team Approach to Delivering Results for Career Ce...
Get More Done with Less: A Team Approach to Delivering Results for Career Ce...
 
Social Media Strategies With an Edu Angle - Social3i Consulting - April 2011
Social Media Strategies With an Edu Angle - Social3i Consulting - April 2011Social Media Strategies With an Edu Angle - Social3i Consulting - April 2011
Social Media Strategies With an Edu Angle - Social3i Consulting - April 2011
 
Walmart Store Inc 1208412318223884 8
Walmart Store Inc 1208412318223884 8Walmart Store Inc 1208412318223884 8
Walmart Store Inc 1208412318223884 8
 
Suicide prevention among students
Suicide prevention among studentsSuicide prevention among students
Suicide prevention among students
 
Impacto de las tecnologias de la informacion en los cuidados
Impacto de las tecnologias de la informacion en los cuidadosImpacto de las tecnologias de la informacion en los cuidados
Impacto de las tecnologias de la informacion en los cuidados
 
Defining Test Competence
Defining Test CompetenceDefining Test Competence
Defining Test Competence
 
Rediseño de la Tipografía
Rediseño de la TipografíaRediseño de la Tipografía
Rediseño de la Tipografía
 
Kompakt katalog gb
Kompakt katalog gbKompakt katalog gb
Kompakt katalog gb
 
Evaluación de las Necesidades de Dispositivos Médicos
Evaluación de las Necesidades de Dispositivos MédicosEvaluación de las Necesidades de Dispositivos Médicos
Evaluación de las Necesidades de Dispositivos Médicos
 

Ähnlich wie 10 Cool Facts about Gradle

Gradleintroduction 111010130329-phpapp01
Gradleintroduction 111010130329-phpapp01Gradleintroduction 111010130329-phpapp01
Gradleintroduction 111010130329-phpapp01
Tino Isnich
 
Gradle - time for a new build
Gradle - time for a new buildGradle - time for a new build
Gradle - time for a new build
Igor Khotin
 
Gradle - small introduction
Gradle - small introductionGradle - small introduction
Gradle - small introduction
Igor Popov
 

Ähnlich wie 10 Cool Facts about Gradle (20)

Gradleintroduction 111010130329-phpapp01
Gradleintroduction 111010130329-phpapp01Gradleintroduction 111010130329-phpapp01
Gradleintroduction 111010130329-phpapp01
 
Gradle
GradleGradle
Gradle
 
OpenCms Days 2012 - Developing OpenCms with Gradle
OpenCms Days 2012 - Developing OpenCms with GradleOpenCms Days 2012 - Developing OpenCms with Gradle
OpenCms Days 2012 - Developing OpenCms with Gradle
 
Gradle - Build system evolved
Gradle - Build system evolvedGradle - Build system evolved
Gradle - Build system evolved
 
Gradle - time for a new build
Gradle - time for a new buildGradle - time for a new build
Gradle - time for a new build
 
Gradle: The Build system you have been waiting for
Gradle: The Build system you have been waiting forGradle: The Build system you have been waiting for
Gradle: The Build system you have been waiting for
 
Gradle - small introduction
Gradle - small introductionGradle - small introduction
Gradle - small introduction
 
Gradle - the Enterprise Automation Tool
Gradle  - the Enterprise Automation ToolGradle  - the Enterprise Automation Tool
Gradle - the Enterprise Automation Tool
 
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!
 
Android presentation - Gradle ++
Android presentation - Gradle ++Android presentation - Gradle ++
Android presentation - Gradle ++
 
An introduction to maven gradle and sbt
An introduction to maven gradle and sbtAn introduction to maven gradle and sbt
An introduction to maven gradle and sbt
 
Agile Swift
Agile SwiftAgile Swift
Agile Swift
 
Config/BuildConfig
Config/BuildConfigConfig/BuildConfig
Config/BuildConfig
 
Config BuildConfig
Config BuildConfigConfig BuildConfig
Config BuildConfig
 
An Introduction to Gradle for Java Developers
An Introduction to Gradle for Java DevelopersAn Introduction to Gradle for Java Developers
An Introduction to Gradle for Java Developers
 
Make Your Build Great Again (DroidConSF 2017)
Make Your Build Great Again (DroidConSF 2017)Make Your Build Great Again (DroidConSF 2017)
Make Your Build Great Again (DroidConSF 2017)
 
Config BuildConfig
Config BuildConfigConfig BuildConfig
Config BuildConfig
 
Get Grulping with JavaScript Task Runners (Matt Gifford)
Get Grulping with JavaScript Task Runners (Matt Gifford)Get Grulping with JavaScript Task Runners (Matt Gifford)
Get Grulping with JavaScript Task Runners (Matt Gifford)
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with Gradle
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with Gradle
 

Mehr von Evgeny Goldin

Mehr von Evgeny Goldin (9)

Alexa skills
Alexa skillsAlexa skills
Alexa skills
 
Polyglot Gradle with Node.js and Play
Polyglot Gradle with Node.js and PlayPolyglot Gradle with Node.js and Play
Polyglot Gradle with Node.js and Play
 
Node.js meets jenkins
Node.js meets jenkinsNode.js meets jenkins
Node.js meets jenkins
 
Functional Programming in Groovy
Functional Programming in GroovyFunctional Programming in Groovy
Functional Programming in Groovy
 
Release It!
Release It!Release It!
Release It!
 
Spock Extensions Anatomy
Spock Extensions AnatomySpock Extensions Anatomy
Spock Extensions Anatomy
 
Start Writing Groovy
Start Writing GroovyStart Writing Groovy
Start Writing Groovy
 
Groovy Maven Builds
Groovy Maven BuildsGroovy Maven Builds
Groovy Maven Builds
 
Maven Plugins
Maven PluginsMaven Plugins
Maven Plugins
 

Kürzlich hochgeladen

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Kürzlich hochgeladen (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 

10 Cool Facts about Gradle

  • 1. 10 Cool Facts about Gradle Evgeny Goldin, @evgeny_goldin
  • 2. Who am I? • 12 years in the industry • Mostly JS and JVM-related experience: Java, Groovy, Scala • Ant, Maven, Gradle, Artifactory, TeamCity, Jenkins • https://github.com/evgeny-goldin/ • Write for blog, wiki, GroovyMag and “Methods & Tools” • Groovy conference speaker: G8Conf, Gr8US
  • 5. 1. Gradle is .. Fast • Not verbose by default • gradle  -­‐q  clean  build • gradle  -­‐i  clean  build • Cheksum-based incremental builds (tasks) • gradle  build • gradle  build
  • 6. 2. Gradle is .. Concise apply  plugin:  'java'
  • 7. 3. Gradle is .. Groovy DSL subprojects  {        dependencies  {                compile          'org.twitter4j:twitter4j-­‐core:2.2.4'                runtime          'ch.qos.logback:logback-­‐classic:0.9.29'                testCompile  'org.spockframework:spock-­‐core:0.6-­‐groovy-­‐1.8-­‐SNAPSHOT'        }        task  copyCommonResources(  type:  Copy  )  {                from  project(  ':twitter4j'  ).file(  'common-­‐resources'  )                into  compileJava.destinationDir        }        jar.dependsOn  copyCommonResources }
  • 8. 3. Gradle is .. Groovy DSL subprojects  {        dependencies  {                compile          'org.twitter4j:twitter4j-­‐core:2.2.4'                runtime          'ch.qos.logback:logback-­‐classic:0.9.29'                testCompile  'org.spockframework:spock-­‐core:0.6-­‐groovy-­‐1.8-­‐SNAPSHOT'        }        task  copyCommonResources(  type:  Copy  )  {                from  project(  ':twitter4j'  ).file(  'common-­‐resources'  )                into  compileJava.destinationDir        }        jar.dependsOn  copyCommonResources }
  • 9. 3. Gradle is .. Groovy DSL subprojects  {        dependencies  {                compile          'org.twitter4j:twitter4j-­‐core:2.2.4'                runtime          'ch.qos.logback:logback-­‐classic:0.9.29'                testCompile  'org.spockframework:spock-­‐core:0.6-­‐groovy-­‐1.8-­‐SNAPSHOT'        }        jar.doFirst  {                copy  {                        from  project(  ':twitter4j'  ).file(  'common-­‐resources'  )                        into  compileJava.destinationDir                }        } }
  • 10. 4. Gradle is .. Groovy        task  assemblePlugin  <<  {                File  tempFile  =  File.createTempFile(  project.name,  null  )                tempFile.write(  file(  'src/main/resources/teamcity-­‐plugin.xml'  ).text.                                                replaceAll(  '@version@',  project.version  ))                File  compileLibs  =  new  File(  project.buildDir,  'compile-­‐libs'  )                (  configurations.compile.files  -­‐  configurations.provided.files  ).each  {                        File  file  -­‐>  ant.copy(  file:  file,  todir:  compileLibs  )                }                ant.zip(  destfile:  destinationZip  )  {                        zipfileset(  file:  tempFile,        fullpath:  'teamcity-­‐plugin.xml'  )                        zipfileset(  dir  :  compileLibs,  prefix    :  'server'  )                }        }
  • 11. 4. Gradle is .. Groovy        task  assemblePlugin  <<  {                File  tempFile  =  File.createTempFile(  project.name,  null  )                tempFile.write(  file(  'src/main/resources/teamcity-­‐plugin.xml'  ).text.                                                replaceAll(  '@version@',  project.version  ))                File  compileLibs  =  new  File(  project.buildDir,  'compile-­‐libs'  )                (  configurations.compile.files  -­‐  configurations.provided.files  ).each  {                        File  file  -­‐>  ant.copy(  file:  file,  todir:  compileLibs  )                }                ant.zip(  destfile:  destinationZip  )  {                        zipfileset(  file:  tempFile,        fullpath:  'teamcity-­‐plugin.xml'  )                        zipfileset(  dir  :  compileLibs,  prefix    :  'server'  )                }        }
  • 12. 4. Gradle is .. Groovy        task  assemblePlugin  <<  {                File  tempFile  =  File.createTempFile(  project.name,  null  )                tempFile.write(  file(  'src/main/resources/teamcity-­‐plugin.xml'  ).text.                                                replaceAll(  '@version@',  project.version  ))                File  compileLibs  =  new  File(  project.buildDir,  'compile-­‐libs'  )                (  configurations.compile.files  -­‐  configurations.provided.files  ).each  {                        File  file  -­‐>  ant.copy(  file:  file,  todir:  compileLibs  )                }                ant.zip(  destfile:  destinationZip  )  {                        zipfileset(  file:  tempFile,        fullpath:  'teamcity-­‐plugin.xml'  )                        zipfileset(  dir:    compileLibs,  prefix    :  'server'  )                }        }
  • 13. 5. Gradle .. knows Groovy apply  plugin:  'groovy'   dependencies  {            groovy    'org.codehaus.groovy:groovy-­‐all:1.8.1' }
  • 14. 5. Gradle .. knows Scala apply  plugin:  'scala'   dependencies  {        scalaTools  'org.scala-­‐lang:scala-­‐compiler:2.9.1.RC4',                              'org.scala-­‐lang:scala-­‐library:2.9.1.RC4'        compile        'org.scala-­‐lang:scala-­‐library:2.9.1.RC4' }
  • 15. 6. Gradle .. knows Maven • Repositories: Maven/Artifactory • Dependencies: Maven/Ivy • Artifacts: gradle clean install • maven2gradle: https://github.com/jbaruch/maven2gradle • Import “pom.xml” - work in progress • Run Maven plugins or run Gradle from Maven - can be nice
  • 16. 7. Gradle .. knows testing test  {                useJUnit()        useTestNG()        jvmArgs  ['-­‐Xmx512M']        include  '**/tests/special/**/*Test.class'        exclude  '**/Old*Test.class'        forkEvery                =  30        maxParallelForks  =  Runtime.runtime.availableProcessors() }   test  {        beforeTest  {  descr                  -­‐>  ..  }        afterTest    {  descr,  result  -­‐>  ..  }        beforeSuite{  descr                  -­‐>  ..  }                  afterSuite  {  descr,  result  -­‐>  ..  } }
  • 17. 7. Gradle .. knows testing
  • 18. 7. Gradle .. knows testing test  {                useJUnit()        useTestNG()        jvmArgs  ['-­‐Xmx512M']        include  '**/tests/special/**/*Test.class'        exclude  '**/Old*Test.class'        forkEvery                =  30        maxParallelForks  =  Runtime.runtime.availableProcessors() }   test  {        beforeTest  {  descr                  -­‐>  ..  }        afterTest    {  descr,  result  -­‐>  ..  }        beforeSuite{  descr                  -­‐>  ..  }                  afterSuite  {  descr,  result  -­‐>  ..  } }
  • 19.
  • 20.
  • 21. 8. Gradle is .. Flexible //  Multiple  source  directories sourceSets.main.java.srcDirs  =  [  'src/main/java',  'srcAdditional/main/java'  ] sourceSets.main.java.srcDirs  'srcAdditionalTwo/main/java' //  Multiple  test  source  directories sourceSets.test.java.srcDirs  =  [  'src/test/java',  'srcAdditional/test/java'  ] sourceSets.test.java.srcDirs  'srcAdditionalTwo/test/java'
  • 22. 8. Gradle is .. Flexible //  Multiple  dependencies  groups configurations  {  myConf.extendsFrom  compile  }   dependencies      {        compile          'org.twitter4j:twitter4j-­‐core:2.2.4'        runtime          'ch.qos.logback:logback-­‐classic:0.9.29'        testCompile  'org.spockframework:spock-­‐core:0.6-­‐groovy-­‐1.8-­‐SNAPSHOT'        testRuntime  '  ...  '                groovy            'org.codehaus.groovy:groovy-­‐all:1.9.0-­‐beta-­‐2'        scalaTools    'org.scala-­‐lang:scala-­‐compiler:2.9.1.RC4',                                'org.scala-­‐lang:scala-­‐library:2.9.1.RC4'        myConf            'org.slf4j:slf4j-­‐api:1.6.2' }
  • 23. 8. Gradle is .. Flexible //  Multiple  artifacts  per  project:  sources  +  javadoc  jars task  packageSources(  type:  Jar  )  {      from  sourceSets.main.allSource      classifier  =  'sources' }   task  packageJavadoc(  type:  Jar,  dependsOn:  'javadoc'  )  {      from  javadoc.destinationDir      classifier  =  'javadoc' }   artifacts  {    archives(  packageSources  )    archives(  packageJavadoc  ) }
  • 24. 9. Gradle is .. Programmable task  assembleApi(  type:  Jar,  dependsOn:  compileGroovyApi  )  {        appendix        =  'api'        includes        =  [  '**/api/**'  ]        from  compileGroovyApi.destinationDir } task  copyCommonResources(  type:  Copy  )  {        from  project(  ':twitter4j'  ).file(  'common-­‐resources'  )        into  compileJava.destinationDir } jar.dependsOn  copyCommonResources jar.doFirst{  ..  } jar.doLast  {  ..  }
  • 25. 9. Gradle is .. Programmable task  assembleApi(  type:  Jar,  dependsOn:  compileGroovyApi  )  {        appendix        =  'api'        includes        =  [  '**/api/**'  ]        from  compileGroovyApi.destinationDir } task  copyCommonResources(  type:  Copy  )  {        from  project(  ':twitter4j'  ).file(  'common-­‐resources'  )        into  compileJava.destinationDir } jar.dependsOn  copyCommonResources jar.doFirst{  ..  } jar.doLast  {  ..  }
  • 26. 10. Gradle is .. Fun and Open! • gradle-user: http://gradle.1045684.n5.nabble.com/gradle-user-f1431424.html • gradle-dev: http://gradle.1045684.n5.nabble.com/gradle-dev-f1436218.html
  • 27. More Examples • Multi-Project (Groovy + Scala): https://github.com/evgeny-goldin/gradle-examples • Groovy Project: https://github.com/evgeny-goldin/gcommons/blob/master/build.gradle • TeamCity Plugins: https://github.com/evgeny-goldin/teamcity-plugins/blob/master/build.gradle • Gradle Plugins: https://github.com/evgeny-goldin/gradle-plugins/blob/master/build.gradle
  • 28. Resources • http://gradle.org/ • http://evgeny-goldin.com/wiki/Gradle • https://github.com/gradle • https://github.com/gradleware • http://gradleware.com/
  • 29. Feel free to contact: • Groovy, Gradle, Builds • @evgeny_goldin • evgenyg@gmail.com • http://evgeny-goldin.com/blog/ • http://evgeny-goldin.com/wiki/