GradleEvgeny Borisov
Good to be programmer…
You start crooked, everything is crooked
What are the tasks of build today?• VCS• CI scripts & different xml configurations• Dependency management• Deployment (clu...
Grandson will not cometoday, he sent mail thatthe build failed.
Which build tools do you know?
I use…1. Gradle2. Maven3. Ant4. Ivy5. I build with my hands…
Declarative & Imperative
Declarative & Imperative• ANT – Imperative• Maven - Declarative Not really
Maven<build></build>
We Love you, XML
<build></build>
We also have two problems…• XML - yes, DSL- no
Who will be today’s Chuck Norris?
Why Gradle?• Not adopted to specific type project• Powerful DSL, which can be extended easily• Groovy• Effective build– Ta...
One doesn’t simply talk.Lets build some project.
Where is myprint???test {testLogging.showStandardStreams = true}
Build task dependency graph
It’s exactly like in maven
Not like maven at all• You can adddependency to existingtask• You can change taskbehavior via it’sproperties• You can exte...
Build task dependency graph
I need a war!
Lets write a Task1. Class MyTask extends DefaultTask2. Write a method @TaskAction3. Add it to DSL4. That is all!
Additional plugins• Groovy Plugin• The Scala Plugin• The War Plugin• The Ear Plugin• The Jetty Plugin• The Eclipse Plugin•...
Your own Plugin• Why should I write my own plugin?It’s not enough to write my own tasks?• Extend DSL.– We want declarative...
Do you want plugin???
• How to write plugin:https://bitbucket.org/davidmc24/gradle-bintray-plugin/src/6adc1aca5ed712b8802fe6b3830b2d860d9fda88/B...
I can’t get out of hereI deep in thisant shit
You love ant?
Migrating from ant to gradle
Migrating from ant
I can’t migrate from maven
Yes you can!
maven2gradle plugin1. Type this in your build.gradle :apply plugin:’maven2Gradle’2. Put this script near you pom3. Run: gr...
What to read?• http://www.gradle.org/docs/current/userguide/userguide.html• http://www.gradle.org/docs/current/dsl/• http:...
Q&A• bsevgeny@gmail.com
Javaone 2013 moscow gradle   english
Javaone 2013 moscow gradle   english
Javaone 2013 moscow gradle   english
Upcoming SlideShare
Loading in …5
×

Javaone 2013 moscow gradle english

1,045 views

Published on

The English version

Published in: Technology, Art & Photos
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,045
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
24
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Javaone 2013 moscow gradle english

  1. 1. GradleEvgeny Borisov
  2. 2. Good to be programmer…
  3. 3. You start crooked, everything is crooked
  4. 4. What are the tasks of build today?• VCS• CI scripts & different xml configurations• Dependency management• Deployment (clustering)• Unit and sanity Tests• Documentation• …
  5. 5. Grandson will not cometoday, he sent mail thatthe build failed.
  6. 6. Which build tools do you know?
  7. 7. I use…1. Gradle2. Maven3. Ant4. Ivy5. I build with my hands…
  8. 8. Declarative & Imperative
  9. 9. Declarative & Imperative• ANT – Imperative• Maven - Declarative Not really
  10. 10. Maven<build></build>
  11. 11. We Love you, XML
  12. 12. <build></build>
  13. 13. We also have two problems…• XML - yes, DSL- no
  14. 14. Who will be today’s Chuck Norris?
  15. 15. Why Gradle?• Not adopted to specific type project• Powerful DSL, which can be extended easily• Groovy• Effective build– Tasks can run in parallel– Incremental build
  16. 16. One doesn’t simply talk.Lets build some project.
  17. 17. Where is myprint???test {testLogging.showStandardStreams = true}
  18. 18. Build task dependency graph
  19. 19. It’s exactly like in maven
  20. 20. Not like maven at all• You can adddependency to existingtask• You can change taskbehavior via it’sproperties• You can extend tasks
  21. 21. Build task dependency graph
  22. 22. I need a war!
  23. 23. Lets write a Task1. Class MyTask extends DefaultTask2. Write a method @TaskAction3. Add it to DSL4. That is all!
  24. 24. Additional plugins• Groovy Plugin• The Scala Plugin• The War Plugin• The Ear Plugin• The Jetty Plugin• The Eclipse Plugin• The IDEA Plugin• AspectJ plugin• ClassLoader plugin• Exec plugin• JavaFx Plugin• Tomcat Plugin• Android Plugin• The FindBugs Plugin
  25. 25. Your own Plugin• Why should I write my own plugin?It’s not enough to write my own tasks?• Extend DSL.– We want declarative build!
  26. 26. Do you want plugin???
  27. 27. • How to write plugin:https://bitbucket.org/davidmc24/gradle-bintray-plugin/src/6adc1aca5ed712b8802fe6b3830b2d860d9fda88/Bintray.gradle?at=default• Adding plugin:buildscript: apply from: gradle/Bintray.gradle• Usage:repositories { bintray.jcenter() }
  28. 28. I can’t get out of hereI deep in thisant shit
  29. 29. You love ant?
  30. 30. Migrating from ant to gradle
  31. 31. Migrating from ant
  32. 32. I can’t migrate from maven
  33. 33. Yes you can!
  34. 34. maven2gradle plugin1. Type this in your build.gradle :apply plugin:’maven2Gradle’2. Put this script near you pom3. Run: gradle build
  35. 35. What to read?• http://www.gradle.org/docs/current/userguide/userguide.html• http://www.gradle.org/docs/current/dsl/• http://www.gradle.org/docs/current/javadoc/
  36. 36. Q&A• bsevgeny@gmail.com

×