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	compile fileTree(dir: 'libs', include: ['*.jar'])
 38}
 39
 40android {
 41	compileSdkVersion 19
 42	buildToolsVersion "19.1"
 43
 44	defaultConfig {
 45		minSdkVersion 14
 46		targetSdkVersion 19
 47		versionCode 32
 48		versionName "0.8-alpha"
 49	}
 50
 51	compileOptions {
 52		sourceCompatibility JavaVersion.VERSION_1_7
 53		targetCompatibility JavaVersion.VERSION_1_7
 54	}
 55
 56	//
 57	// To sign release builds, create the file `gradle.properties` in
 58	// $HOME/.gradle or in your project directory with this content:
 59	//
 60	// mStoreFile=/path/to/key.store
 61	// mStorePassword=xxx
 62	// mKeyAlias=alias
 63	// mKeyPassword=xxx
 64	//
 65	if (project.hasProperty('mStoreFile') &&
 66			project.hasProperty('mStorePassword') &&
 67			project.hasProperty('mKeyAlias') &&
 68			project.hasProperty('mKeyPassword')) {
 69		signingConfigs {
 70			release {
 71				storeFile file(mStoreFile)
 72					storePassword mStorePassword
 73					keyAlias mKeyAlias
 74					keyPassword mKeyPassword
 75			}
 76		}
 77		buildTypes.release.signingConfig = signingConfigs.release
 78	} else {
 79		buildTypes.release.signingConfig = null
 80	}
 81
 82	buildTypes {
 83		release {
 84			runProguard true
 85			proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
 86		}
 87		applicationVariants.all { variant ->
 88			def fileName = variant.packageApplication.outputFile.name.replace(".apk",
 89					"-" + defaultConfig.versionName + ".apk")
 90				variant.packageApplication.outputFile = new
 91				File(variant.packageApplication.outputFile.parent, fileName)
 92				if (variant.zipAlign) {
 93					if (variant.name.equals('release')) {
 94						variant.outputFile = new File(variant.outputFile.parent,
 95								rootProject.name + "-" + defaultConfig.versionName + ".apk")
 96					}
 97				}
 98		}
 99	}
100
101	lintOptions {
102		disable 'MissingTranslation', 'InvalidPackage'
103	}
104
105	subprojects {
106
107		afterEvaluate {
108			if (getPlugins().hasPlugin('android') ||
109					getPlugins().hasPlugin('android-library')) {
110
111				configure(android.lintOptions) {
112					disable 'AndroidGradlePluginVersion', 'MissingTranslation'
113				}
114			}
115
116		}
117	}
118}