Mais conteúdo relacionado Semelhante a Javaone 2013 moscow gradle english (20) Mais de Evgeny Borisov (10) Javaone 2013 moscow gradle english5. What are the tasks of build today?
• VCS
• CI scripts & different xml configurations
• Dependency management
• Deployment (clustering)
• Unit and sanity Tests
• Documentation
• …
17. 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
23. Not like maven at all
• You can add
dependency to existing
task
• You can change task
behavior via it’s
properties
• You can extend tasks
26. Lets write a Task
1. Class MyTask extends DefaultTask
2. Write a method @TaskAction
3. Add it to DSL
4. That is all!
27. 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
28. 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!
30. • How to write plugin:
https://bitbucket.org/davidmc24/gradle-
bintray-
plugin/src/6adc1aca5ed712b8802fe6b3830b2d
860d9fda88/Bintray.gradle?at=default
• Adding plugin:
buildscript: apply from: 'gradle/Bintray.gradle'
• Usage:
repositories { bintray.jcenter() }
37. maven2gradle plugin
1. Type this in your build.gradle :
apply plugin:’maven2Gradle’
2. Put this script near you pom
3. Run: gradle build
38. What to read?
• http://www.gradle.org/docs/current/userguid
e/userguide.html
• http://www.gradle.org/docs/current/dsl/
• http://www.gradle.org/docs/current/javadoc/