weknowhowyoufeel/app/build.gradle
toby cabot f542f7c519 Build system improvements
1. Sign the release apk if configured to do it

By default the build will not sign the release apk, but if you define
the right properties it will.  Create a ~/.gradle/gradle.properties file
with these properties: releaseKeystoreFile, releaseKeystorePassword,
releaseKeyAlias, and releaseKeyPassword.

For example:

releaseKeystoreFile=/Users/tcabot/release-keystore
releaseKeystorePassword=k3yst0r3
releaseKeyAlias=affdexme
releaseKeyPassword=k3y

2. Allow debug builds to coexist with releases

The debug build has a different id (com.affectiva.affdexme.debug) so
android treats it as a completely different app.  By default, though,
both apps look the same on the app launch screen so the debug version is
now called AffdexMeDbg so you can have both at the same time and be able
to tell which is which.

3. Make the apk filename more descriptive

It was just "app-debug.apk" or "app-release.apk".  This commit changes
the "app" to "AffdexMe" and adds the human-readable versionName and
integer versionCode to the filename.

I would have liked the filename to track the cosmetic name (i.e., have
the debug file be called "AffdexMeDbg-....apk") but that turned out to
be surprisingly difficult given the way the build system is set up.  I
think it should be possible but this is the best bang for the buck for
the amount of effort I'm willing to put in at this point.
2016-01-25 17:16:26 -05:00

65 lines
2 KiB
Groovy

apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion '22.0.1'
defaultConfig {
applicationId "com.affectiva.affdexme"
minSdkVersion 16
targetSdkVersion 22
versionCode 14
versionName "2.0.0"
setProperty("archivesBaseName", "AffdexMe-$versionName-$versionCode")
}
buildTypes {
debug {
resValue 'string', 'app_name', 'AffdexMeDbg'
applicationIdSuffix ".debug"
}
release {
resValue 'string', 'app_name', 'AffdexMe'
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
jniLibs.srcDirs = ['native-libs']
jni.srcDirs = [] //disable automatic ndk-build
}
}
}
dependencies {
//gson is necessary for the license to be parsed
compile 'com.google.code.gson:gson:2.3'
//include the Affdex SDK jars
compile files('libs/Affdex-sdk.jar')
compile files('libs/Affdex-sdk-javadoc.jar')
compile files('libs/dagger-1.2.2.jar')
compile files('libs/flurry-analytics-4.1.0.jar')
compile files('libs/javax.inject-1.jar')
//although the use of the CameraDetector class in this project does not require it, you may have to include
//the following dependencies if you use other features of the Affdex SDK
//compile 'com.android.support:support-v4:22.2.0'
//compile 'com.google.android.gms:play-services:7.5.0'
}
// build a signed release apk only if the environment is configured
// with the properties that let us access the keystore. you can put
// them into ~/.gradle/gradle.properties
if (project.hasProperty('releaseKeystoreFile')) {
android.signingConfigs {
release {
storeFile file(releaseKeystoreFile)
storePassword releaseKeystorePassword
keyAlias releaseKeyAlias
keyPassword releaseKeyPassword
}
}
android.buildTypes.release.signingConfig = android.signingConfigs.release
}