build.gradle

  1// Top-level build file where you can add configuration options common to all
  2// sub-projects/modules.
  3buildscript {
  4	repositories {
  5		jcenter()
  6		mavenCentral()
  7	}
  8	dependencies {
  9		classpath 'com.android.tools.build:gradle:0.12.2'
 10	}
 11}
 12
 13allprojects {
 14	repositories {
 15		jcenter()
 16		mavenCentral()
 17	}
 18}
 19
 20apply plugin: 'com.android.application'
 21
 22repositories {
 23	jcenter()
 24	mavenCentral()
 25	maven {
 26		url "http://jitsi.github.com/otr4j/repository/"
 27	}
 28}
 29
 30dependencies {
 31	compile project(':libs:minidns')
 32	compile project(':libs:openpgp-api-lib')
 33	compile project(':libs:MemorizingTrustManager')
 34	compile 'com.android.support:support-v13:19.1.0'
 35	compile 'org.bouncycastle:bcprov-jdk15on:1.50'
 36	compile 'net.java:otr4j:0.21'
 37}
 38
 39android {
 40	compileSdkVersion 19
 41	buildToolsVersion "19.1"
 42
 43	defaultConfig {
 44		minSdkVersion 14
 45		targetSdkVersion 19
 46		versionCode 33
 47		versionName "0.8.1"
 48	}
 49
 50	compileOptions {
 51		sourceCompatibility JavaVersion.VERSION_1_7
 52		targetCompatibility JavaVersion.VERSION_1_7
 53	}
 54
 55	//
 56	// To sign release builds, create the file `gradle.properties` in
 57	// $HOME/.gradle or in your project directory with this content:
 58	//
 59	// mStoreFile=/path/to/key.store
 60	// mStorePassword=xxx
 61	// mKeyAlias=alias
 62	// mKeyPassword=xxx
 63	//
 64	if (project.hasProperty('mStoreFile') &&
 65			project.hasProperty('mStorePassword') &&
 66			project.hasProperty('mKeyAlias') &&
 67			project.hasProperty('mKeyPassword')) {
 68		signingConfigs {
 69			release {
 70				storeFile file(mStoreFile)
 71					storePassword mStorePassword
 72					keyAlias mKeyAlias
 73					keyPassword mKeyPassword
 74			}
 75		}
 76		buildTypes.release.signingConfig = signingConfigs.release
 77	} else {
 78		buildTypes.release.signingConfig = null
 79	}
 80
 81	buildTypes {
 82		applicationVariants.all { variant ->
 83			def fileName = variant.packageApplication.outputFile.name.replace(".apk",
 84					"-" + defaultConfig.versionName + ".apk")
 85				variant.packageApplication.outputFile = new
 86				File(variant.packageApplication.outputFile.parent, fileName)
 87				if (variant.zipAlign) {
 88					if (variant.name.equals('release')) {
 89						variant.outputFile = new File(variant.outputFile.parent,
 90								rootProject.name + "-" + defaultConfig.versionName + ".apk")
 91					}
 92				}
 93		}
 94	}
 95
 96	lintOptions {
 97		disable 'MissingTranslation', 'InvalidPackage'
 98	}
 99
100	subprojects {
101
102		afterEvaluate {
103			if (getPlugins().hasPlugin('android') ||
104					getPlugins().hasPlugin('android-library')) {
105
106				configure(android.lintOptions) {
107					disable 'AndroidGradlePluginVersion', 'MissingTranslation'
108				}
109			}
110
111		}
112	}
113}