34
Automations with Gradle FiNC Inc Yuki Nanri

20160915 automation with_gradle

Embed Size (px)

Citation preview

Page 1: 20160915 automation with_gradle

Automations with Gradle

FiNC Inc Yuki Nanri

Page 2: 20160915 automation with_gradle

IntroductionProblemsAutomationsSummary

~table of contents~

Page 3: 20160915 automation with_gradle

Introduction

• Yuki Nanri (@neonankiti)

• Android Developer in FiNC.

Page 4: 20160915 automation with_gradle

FiNC App

• Data Collection -> Analysis -> Solution -> EC• Wellness Value Chains to make people change

WellnessSurvey

Genetic Blood

Testing

Survey+Testing

AnalysisReport

PersonalizedSolutions & Contents

Experts Advice SNSKnowledge

Walk with taking a full swing

3 times Stretch

Scapla stretch 3 times

Vegetables at every meals

Drink water more than 1L a day

Take a Yogurt in the morning

• Comprehensive Results

• Body and mental status

• Behavior• Risk of daily habit

tasks• Recomendation etc.

Fitness Task

FiNC STORE

Get Points

• Order made ・Personal supplement

• Drink• Smoothy etc.

Points available in FiNC app

Adapt PointsReport

TourismHealthyContents

etc.

Meals Task

Squat 10 timesx 3

10 minutes walk Leave half of rice

Start from vegetables at every meals

Page 5: 20160915 automation with_gradle

Problems

Product Development Process wasn’t not Good

Page 6: 20160915 automation with_gradle

Especially Distribution

・ manually change the pointed situations (staging,

production)

・ QA team used to ask us everyday distribution.

Page 7: 20160915 automation with_gradle

Solutions

・ Buying a high spec machine.

・ Ignoring QA team

・ Automation

Page 8: 20160915 automation with_gradle

What I want to share

How to build apk files quickly with flavor and build

types

Page 9: 20160915 automation with_gradle

Gradle

・ Gradle is build tool written by Groovy.

・ Gradle supports Maven repository.

Page 10: 20160915 automation with_gradle

Gradle

Page 11: 20160915 automation with_gradle

How to use

Page 12: 20160915 automation with_gradle

Components

・ Product Flavor

・ Build Type

・ Signing Config

・ Configuration

http://google.github.io/android-gradle-dsl/current/

This is require configurations

Page 13: 20160915 automation with_gradle

Product Flavors

Product flavor is used in the situations where you want to create “freemium” or “premium” app

Page 14: 20160915 automation with_gradle

Build Types

Each build type can choose signingConfig for release and debug

Page 15: 20160915 automation with_gradle

Signing Configs

When you build, you need to sign with keystore file like below.(Release keystore files should be stored securely. )

Page 16: 20160915 automation with_gradle

Configurations

Configurations are combinations of ”Flavor” and “Build Types”

Page 17: 20160915 automation with_gradle

Configurations

Page 18: 20160915 automation with_gradle

But

When we try to install these different flavors, it’ll cause conflicts

Page 19: 20160915 automation with_gradle

Why?

The same package name cannot exist at the same time

Page 20: 20160915 automation with_gradle

Where?

But the package name is written in Android.Manifest, and looks constraints.

Page 21: 20160915 automation with_gradle

Beforehand

The documents says

・ Your device and Google Play Store look at your “Application id”

・ Package in manifest is the one just for referring your R classes.

http://tools.android.com/tech-docs/new-build-system/applicationid-vs-packagename

Page 22: 20160915 automation with_gradle

So What?

Change the Application id in build.gradle

Page 23: 20160915 automation with_gradle

Product Flavors

You can change to whatever you like.

Page 24: 20160915 automation with_gradle

Build Types

Add prefix or suffix for debug build.

Page 25: 20160915 automation with_gradle

Output apks

All items exist simultaneously.

Page 26: 20160915 automation with_gradle

Further more

In some app, it still causes conflicts.

Page 27: 20160915 automation with_gradle

Why?

Provider Authorities conflicts

Page 28: 20160915 automation with_gradle

Why?

Provider’s authorities must be unique.

Page 29: 20160915 automation with_gradle

What?

Authorities in manifest also should be variable.

Page 30: 20160915 automation with_gradle

How?

Set the key value data sets

Page 31: 20160915 automation with_gradle

How?

Use it as variants

Page 32: 20160915 automation with_gradle

Summary

・ Gradle has potential to replace your manual

work.

・ Application ID must be unique.

・ Provider also must be unique.

Page 33: 20160915 automation with_gradle

Things I cannot tell

・ I didn’t have enough time to share automation parts

・ Next Part

・ Automated Distribution with Fabric

・ Connected JIRA tickets and Github with apis

Page 34: 20160915 automation with_gradle

Thank you