More Related Content More from Ciklum Ukraine (20) CiklumJavaSat _5112011:Igor Khotin-Gradle13. ant Сложность
повторное использование
тяжёлые build.xml
контроль циклов сборки
15. maven тяжёлые pom.xml
Сложно переопределить
поведение по-умолчанию
convention over configuration
dependency management
lost of control
16. Gradle вчера
● Hans Dockter – основатель
● Еволюция идей Gant
● Начало 2008 – первые версии
● Серия стабильных pre-1.0 релизов
● 2010 Springy Innovation Award
17. Gradle сегодня
● Релиз 1.0 milestone-3 stable
● Активное сообщество
● Gradleware
● Apache License, Version 2.0
18. Gradle in the wild
Qi4j
Groovy Carrier Aluminum
Grails Zeppelin GmhH
Canoo Spock
FCC Griffon
EADS
GPars
Hibernate
Gaelyk Spring-Security
Gant
Spring-Integration
19. Who is that Gradle?
● Build integration tool
● Declarative builds
● Groovy-based build DSL
● Build-by-convention
20. Who is that Gradle?
● Scalable – multi-project builds
● Dependency management
● Ease of migration
● Embeddable
● Deep API
31. Gradle завтра
● Сентябрь 2011 - 1.0 RC-1
● Ожидаем релиз 1.0 к концу 2012
● Более тесная интеграция с maven
● Build aggregation
● Gradle daemon
● Gradle 1.0 Plugin System
● Archetypes?
33. ant
<?xml version="1.0"?>
<project name="simple" default="dist" basedir=".">
<property name="src" location="src/main/java"/>
<property name="srcTest" location="src/test/java"/>
<property name="build" location="build"/>
<property name="dist" location="${build}/lib"/>
<property name="version" value="1.0-SNAPSHOT" />
<path id="classpath.compile">
<pathelement location="libs/commons-lang-2.5.jar"/>
</path>
<path id="classpath.test">
<pathelement location="libs/junit-4.8.2.jar"/>
<pathelement location="libs/commons-lang-2.5.jar"/>
<pathelement location="${srcTest}"/>
<pathelement location="${build}/classes"/>
<pathelement location="${build}/test-classes"/>
</path>
...
34. ant
...
<target name="init">
<mkdir dir="${build}/classes"/>
<mkdir dir="${build}/test-classes"/>
</target>
<target name="compile" depends="init">
<javac srcdir="${src}" destdir="${build}/classes">
<classpath refid="classpath.compile"/>
</javac>
</target>
<target name="testCompile" depends="compile">
<javac srcdir="${srcTest}" destdir="${build}/test-classes">
<classpath refid="classpath.test"/>
</javac>
</target>
...
35. ant
...
<target name="test" depends="testCompile">
<junit fork="yes" haltonfailure="yes">
<batchtest fork="yes">
<fileset dir="${srcTest}">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
<classpath refid="classpath.test"/>
<formatter type="plain"/>
</junit>
</target>
<target name="dist" depends="test">
<mkdir dir="${dist}"/>
<jar jarfile="${dist}/coc-comparison-${version}.jar"
basedir="${build}/classes"/>
</target>
<target name="clean"><delete dir="${build}"/></target>
</project>
36. maven
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>grId</groupId>
<artifactId>coc-comparison</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
...
37. maven
...
<dependencies>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
40. Ресурсы
● www.gradle.org
● groovy.codehaus.org
● ant.apache.org/ivy