gradle : Building Android Apps Mobel Meetup

Similar documents
... Fisheye Crucible Bamboo

JAVA V Tools in JDK Java, winter semester ,2017 1

Package Management and Build Tools

Software Engineering - Development Infrastructure 2. Kristjan Talvar Nortal

Software Building (Sestavování aplikací)

Construction: version control and system building

JAVA V Annotations Java, winter semester ,2016 1

Set up Maven plugins in Eclipse. Creating a new project

4. Check the site specified in previous step to work with, expand Maven osgi-bundles, and select slf4j.api,

Session 24. Spring Framework Introduction. Reading & Reference. dev.to/lechatthecat/how-to-use-spring-boot-java-web-framework-withintellij-idea-202p

Produced by. Agile Software Development. Eamonn de Leastar

... Maven.... The Apache Maven Project

Tutorial on OpenCV for Android Setup

Continuous Delivery with Grade. Hans Dockter CEO Gradle Inc., Founder

AppFactory User Guide

Fine-Tuning Your Development Environment

CSE 403 Lecture 11. Static Code Analysis. Reading: IEEE Xplore, "Using Static Analysis to Find Bugs"

Simplified Build Management with Maven

Hello Gradle. TestNG, Eclipse, IntelliJ IDEA. Óbuda University, Java Enterprise Edition John von Neumann Faculty of Informatics Lab 2.

Maven. INF5750/ Lecture 2 (Part II)

S AMPLE CHAPTER IN ACTION. Benjamin Muschko. FOREWORD BY Hans Dockter MANNING

Build automation. CSE260, Computer Science B: Honors Stony Brook University

JAVA. Java Management Extensions JMX

Build Automation Kurt Christensen

Maven Introduction to Concepts: POM, Dependencies, Plugins, Phases

Hello Maven. TestNG, Eclipse, IntelliJ IDEA. Óbuda University, Java Enterprise Edition John von Neumann Faculty of Informatics Lab 2.

Apache Maven. Created by anova r&d bvba

Google Maps Troubleshooting

EMBEDDED SYSTEMS PROGRAMMING Android NDK

Software Development. COMP220/COMP285 Seb Coope Ant: Structured Build

Gant as Ant and Maven Replacement

Unit Testing. CS 240 Advanced Programming Concepts

EPL451: Data Mining on the Web Lab 6

BlackBerry Developer Global Tour. Android. Table of Contents

Version 7.6 PREEMPTIVE SOLUTIONS DASHO. User Guide

Android tips. which simplify your life

Introduction to Software Engineering: Tools and Environments. Session 9. Oded Lachish

Ant. Originally ANT = Another Neat Tool. Created by James Duncan Davidson Now an Apache open-source project

Maven POM project modelversion groupid artifactid packaging version name

Jaxb2 Maven Plugin Could Not Process Schema

Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology

maven Build System Making Projects Make Sense

STQA Mini Project No. 1

The Workshop. Slides (you have a copy in the zip) Practical labs Ask questions

Create new Android project in Android Studio Add Button and TextView to layout Learn how to use buttons to call methods. Modify strings.

EMBEDDED SYSTEMS PROGRAMMING Android NDK

Example ear-testing can be browsed at

Programming Concepts and Skills. Creating an Android Project

02/03/15. Compile, execute, debugging THE ECLIPSE PLATFORM. Blanks'distribu.on' Ques+ons'with'no'answer' 10" 9" 8" No."of"students"vs."no.

Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology

What is Maven? Apache Maven is a software project management and comprehension tool (build, test, packaging, reporting, site, deploy).

Setting up a Maven Project

Tutorial on OpenCV for Android Setup

Enter the Gradle Hans Dockter CEO, Gradleware Founder Gradle

MANUAL DO ALUNO DE ENGENHARIA DE SOFTWARE

This tutorial explains how you can use Gradle as a build automation tool for Java as well as Groovy projects.

Appium mobile test automation

Advanced Dependency Management with Gradle. Benjamin Muschko, Gradle Inc.

A Journey in So,ware Development An overview of methods and tools (part 2)

Apache Isis Maven plugin

Software Building (Sestavování aplikací)

Topics covered. Introduction to Maven Maven for Dependency Management Maven Lifecycles and Plugins Hands on session. Maven 2

Creating Custom Builder Components

Fat / Uber jars - Using the Shade Plugin

Selenium Testing Course Content

EMBEDDED SYSTEMS PROGRAMMING Application Basics

C++ Binary Dependency Management with Gradle. Hugh Greene

DevOps and Maven. Eamonn de Leastar Dr. Siobhán Drohan Produced by:

Open Lecture Mobile Programming. Command Line Tools

(Refer Slide Time: 0:48)

Maven in the wild. An introduction to Maven

Hello World. Lesson 1. Create your first Android. Android Developer Fundamentals. Android Developer Fundamentals

Packaging, automation, Continuous Integration

Gradle. The Basics and Beyond

GAVIN KING RED HAT CEYLON SWARM

MAVEN SUCKS NO(W) REALLY

Action Developers Guide

XML Tutorial. NOTE: This course is for basic concepts of XML in line with our existing Android Studio project.

Lab 5 Exercise Build and continuous integration tools

Repository Management and Sonatype Nexus. Repository Management and Sonatype Nexus

Chapter 1. Installation and Setup

android-espresso #androidespresso

VMware AirWatch Android SDK Technical Implementation Guide Empowering your enterprise applications with MDM capabilities using

#jenkinsconf. Jenkins user plugin. This time it's. Jenkins User Conference Israel. Shiran JFrog

Migrating to Java 9 Modules. Paul Bakker

Groovy. Extending Java with scripting capabilities. Last updated: 10 July 2017

MAVEN MOCK TEST MAVEN MOCK TEST I

JavaFX.Next. Kevin Rushforth Oracle Johan Vos Gluon October Copyright 2018, Oracle and/or its affiliates. All rights reserved.

TouchTest TM Android Tutorial

Overall Design of SSS Software

Pour aller plus loin : Programmation outillée

JavaBasel 16. René Gröschke. Gradle 3.0 and beyond. Gradle 3.0 and beyond - #javabasel

Geo Catching Sprint #3 Kick-off

This document providesanoverview ofthestepsrequired to implement an android app which will call the ACH android SDK.

Android Sdk Install Documentation Eclipse. Ubuntu >>>CLICK HERE<<<

Generating A Hibernate Mapping File And Java Classes From The Sql Schema

JVM Survival Guide. Hadi Hariri

OAuth2 Autoconfig. Copyright

Administering Apache Geronimo With Custom Server Assemblies and Maven. David Jencks

Gradle Leveraging Groovy for Building Java Applications. Hans Dockter Gradle Project Lead

Transcription:

gradle : Building Android Apps Mobel Meetup 2013-10-15 @alexvb http://alex.vanboxel.be/

Biography Working with Java since the dark ages at Progress Software, Alcatel-Lucent, Interested in science and technology Alex Van Boxel Software Architect - Mobile @ Vente-Exclusive.com

Build History a brief history of java build systems

In the beginning there was nothing

Bo ttl 20 ed i 00 n created Ant and he saw it as messy

Ant example <project> <target name="clean"> <delete dir="build"/> </target> <target name="compile"> <mkdir dir="build/classes"/> <javac srcdir="src" destdir="build/classes"/> </target> <target name="jar"> <mkdir dir="build/jar"/> <jar destfile="build/jar/helloworld.jar" basedir="build/classes"> <manifest> <attribute name="main-class" value="io.mobel.helloworld"/> </manifest> </jar> </target> <target name="run"> <java jar="build/jar/helloworld.jar" fork="true"/> </target> </project>

Bo ttl 20 ed i 01 n + created Maven and he saw it was better, but...

Maven example <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/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.mycompany.app</groupid> <artifactid>my-app</artifactid> <version>1.0-snapshot</version> <packaging>jar</packaging> <name>maven Quick Start Archetype</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupid>junit</groupid> <artifactid>junit</artifactid> <version>4.8.2</version> <scope>test</scope> </dependency> </dependencies> </project>

Maven s build by convention my-app -- pom.xml `-- src -- main `-- java `-- com `-- mycompany `-- app `-- App.java `-- test `-- java `-- com `-- mycompany `-- app `-- AppTest.java

Bo ttl 20 ed i 11 n + created Gradle build files in XML is so 80 s

Out of the box features Declarative Syntax Build-By-Convention Task-graph Multi-Project Builds Dependency Power Tool Groovy

Android Build System = Gradle + Android Gradle Plugin + IDE integration

Why a new Build System Customizable and extensible but stable API Unified across IDE and CI Standard and Advanced features

One Build System to Rule them All Same build system from IDE, command-line and continuous-integration environment

Advanced Tool Interface API IDEA and Studio Command Line MobelDemoProject git:(master) gradle tasks :tasks -----------------------------------------------------------All tasks runnable from root project -----------------------------------------------------------Android tasks ------------androiddependencies - Displays the Android dependencies of the project signingreport - Displays the signing info for each variant Build tasks ----------assemble - Assembles all variants of all applications and secondary packages. assembledebug - Assembles all Debug builds assemblefreegoogleio - Assembles all builds for flavor FreeGoogleIO assemblefreegoogleiodebug - Assembles the Debug build for flavor FreeGoogleIO assemblefreegoogleiorelease - Assembles the Release build for flavor FreeGoogleIO assemblefreegoogleiostaging - Assembles the Staging build for flavor FreeGoogleIO TeamCity Others Eclipse Atlassian Bamboo Jenkins etc...

Advanced Tool Interface API Integrates with Android Studio based on IDEA or works in Eclipse with Android Plugin...

Declarative Domain Specific Language The Android plugin extends the Gradle DSL

Gradle Skelet buildscript { repositories { mavencentral() } dependencies { classpath 'com.android.tools.build:gradle:0.6.1' } } apply plugin: 'android' android { compilesdkversion 17 buildtoolsversion 18.1 }

Convention over Configuration my-app -- build.gradle `-- src -- main `-- java `-- test `-- java

Convention over Configuration my-app -- build.gradle `-- src -- main -- AndroidManifest.xml -- res -- assets -- aidl -- rs -- jni `-- java -- instrumentedtest -- res -- assets -- aidl -- rs -- jni `-- java `-- test `-- java

Gradle Tasks gradle <task> [<task>] gradle tasks [--all] assemble assemble the project(s) check run all the checks build assemble + check clean clean all the output

Build Variant = Build Types + Product Flavors

DSL: Build Types buildtypes { release { signingconfig signingconfigs.release } debug { packagenamesuffix ".debug" versionnamesuffix = ".D" debuggable true } staging.initwith(buildtypes.debug) staging { packagenamesuffix ".staging" buildconfig "private final static String server = \"staging.example.com\"" } }

DSL: Signing Configuration signingconfigs { release { storefile file("src/mobel.keystore") storepassword "mobelmobel" keyalias "release" keypassword "mobelmobel" } } buildtypes { release { signingconfig signingconfigs.release }

Convention over Configuration my-app -- build.gradle `-- src -- main -- AndroidManifest.xml -- res -- assets -- aidl -- rs -- jni `-- java -- debug --... -- staging --... -- instrumentedtest --... `-- test `-- java

DSL: Build Types debug release staging debug release staging

DSL: Product Flavor Example without groups productflavors { Mobel { } GoogleIO { } Example with groups flavorgroups 'version','session' productflavors { Mobel { flavorgroup 'session' } GoogleIO { flavorgroup 'session' } free { flavorgroup 'version' } paid { flavorgroup 'version' } }

Build Type + Product Flavor debug release mobel MobelDebug MobelRelease googleio GoogleIODebug GoogleIORelease and Flavor Groups free pail debug release mobel FreeMobelDebug FreeMobelRelease googleio FreeGoogleIODebug FreeGoogleIORelease mobel PaidMobelDebug PaidMobelRelease googleio PaidGoogleIODebug PaidGoogleIORelease

DEMO

Stable Build Environment keep is stable...

Stable Build Environment Gradle version use the gradle-wrapper Plugin version dependencies { classpath 'com.android.tools.build:gradle:0.6.1' }

Stable Build Environment Build tools android { compilesdkversion 18 buildtoolsversion "18.1.0" IDE doesn t build your project

Testing unit- and integration testing in the same project

Test Code Generation Testing Sources Sets Standard test/ Android instrumentedtest(flavor)/ Generated Manifest Special APK for library projects

Testing Scenarios check connecteddevices devicecheck

Test Server API use the cloud for parallel testing

Testing Server API Control your lab Services from TestDroid Manymo AppThwack image from AppThwack website

Dependency Management flexible and reuse your current repo s

Dependencies dependencies { compile 'com.android.support:support-v4:18.0.+' compile 'com.android.support:appcompat-v7:18.0.+' compile 'com.google.android.gms:play-services:3.2.65' compile 'com.google.android.gtm:tagmanager:3.0.0' compile 'joda-time:joda-time:2.3' compile 'com.fasterxml.jackson.core:jackson-core:2.2.3' compile 'com.fasterxml.jackson.core:jackson-databind:2.2.3' compile 'com.google.guava:guava:15.0' compile 'com.squareup.dagger:dagger:1.1.0' compile 'com.squareup.dagger:dagger-compiler:1.1.0' compile(group: 'de.keyboardsurfer.android.widget', name: 'crouton', version: '1.8.1') { transitive = false } }

Corporate Repositories Repo X Repo Y Maven Central Gradle Project Gradle Project Gradle Project Gradle Project Gradle Project Gradle Project Gradle Project Corporate Repository gradle.cache

Corporate Repository: Nexus Open Source repository manager...

Corporate Repository: Management Google Tag Manager example...

Reference http://tools.android.com/tech-docs/new-build-system http://www.gradle.org/ http://www.gradleware.com/ Google I/O (on youtube) Follow me @alexvb +Alex Van Boxel ( web: http://alex.vanboxel.be/ )