Help us understand the problem. What is going on with this article?

Gradle で複数種類の apk をビルドする

More than 5 years have passed since last update.

複数種類の apk(ステージング用、リリース用など)をビルドするスクリプト。
プロジェクトのroot以下に、confディレクトリを掘って、その中にkeystoreファイルを置くスタイル。debug 用のはリポジトリに入れておくと良さそう。release 用のは入れるとまずいので、そこだけ頑張らないといけない。

android {
    // ...

    // デバッグ用 apk とリリース用 apk の署名の設定
    signingConfigs {
        debug {
            storeFile file("conf/debug.keystore")
            storePassword "android"
            keyAlias "androiddebugkey"
            keyPassword "android"
        }
        release {
            storeFile file("conf/release.keystore")
            storePassword "fugafugahogehoge"
            keyAlias "yokomark"
            keyPassword "foobarbaz"
        }
    }

    // ビルドの種類に応じて、ビルド時に実行するステップを設定
    buildTypes {
        release {
            debuggable false
            zipAlign true
            runProguard true
            proguardFile getDefaultProguardFile('proguard-android-optimize.txt')
            signingConfig signingConfigs.release
        }
        debug {
            debuggable true
            zipAlign true
            runProguard false
            signingConfig signingConfigs.debug
        }
    }

    productFlavors {
        staging {
            proguardFile 'proguard-rules.txt'
            packageName "jp.yokomark.foo.staging"
        }

        production {
            proguardFile 'proguard-rules.txt'
            packageName "jp.yokomark.foo.product"
        }
    }
}
KeithYokoma
Android, Java, Perl, Scala, Play Framework, CoffeeScript, Smalltalk, JavaFX, Groovy, AWS, Docker
http://keithyokoma.hatenablog.com/
mercari
フリマアプリ「メルカリ」を、グローバルで開発しています。
https://tech.mercari.com/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした