You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			297 lines
		
	
	
		
			13 KiB
		
	
	
	
		
			Groovy
		
	
			
		
		
	
	
			297 lines
		
	
	
		
			13 KiB
		
	
	
	
		
			Groovy
		
	
| buildscript {
 | |
|     repositories {
 | |
|         maven {
 | |
|             url "https://repo1.maven.org/maven2"
 | |
|         }
 | |
|     }
 | |
|     dependencies {
 | |
|         classpath 'com.android.tools.build:gradle:1.0.1'
 | |
|         classpath files('libs/gradle-witness.jar')
 | |
|     }
 | |
| }
 | |
| 
 | |
| apply plugin: 'com.android.application'
 | |
| apply plugin: 'witness'
 | |
| 
 | |
| repositories {
 | |
|     maven {
 | |
|         url "https://repo1.maven.org/maven2/"
 | |
|     }
 | |
|     maven {
 | |
|         url "https://raw.github.com/whispersystems/maven/master/preferencefragment/releases/"
 | |
|     }
 | |
|     maven {
 | |
|         url "https://raw.github.com/whispersystems/maven/master/smil/releases/"
 | |
|     }
 | |
|     maven {
 | |
|         url "https://raw.github.com/whispersystems/maven/master/shortcutbadger/releases/"
 | |
|     }
 | |
|     maven { // textdrawable
 | |
|         url 'https://dl.bintray.com/amulyakhare/maven'
 | |
|     }
 | |
|     maven { // cwac-camera
 | |
|         url 'https://repo.commonsware.com.s3.amazonaws.com'
 | |
|     }
 | |
|     jcenter()
 | |
|     mavenLocal()
 | |
| }
 | |
| 
 | |
| dependencies {
 | |
|     compile 'me.leolin:ShortcutBadger:1.1.0-WS1'
 | |
|     compile 'se.emilsjolander:stickylistheaders:2.7.0'
 | |
|     compile 'com.google.android.gms:play-services-base:6.5.87'
 | |
|     compile 'com.jpardogo.materialtabstrip:library:1.0.9'
 | |
|     compile 'org.w3c:smil:1.0.0'
 | |
|     compile 'org.apache.httpcomponents:httpclient-android:4.3.5'
 | |
|     compile 'com.github.chrisbanes.photoview:library:1.2.3'
 | |
|     compile 'com.github.bumptech.glide:glide:3.6.0'
 | |
|     compile 'com.makeramen:roundedimageview:2.1.0'
 | |
|     compile 'com.pnikosis:materialish-progress:1.5'
 | |
|     compile 'de.greenrobot:eventbus:2.4.0'
 | |
|     compile ('com.afollestad:material-dialogs:0.7.3.1') {
 | |
|         exclude module: 'appcompat-v7'
 | |
|         exclude module: 'recyclerview-v7'
 | |
|         exclude module: 'support-annotations'
 | |
|     }
 | |
| 
 | |
|     compile 'pl.tajchert:waitingdots:0.1.0'
 | |
|     compile 'com.soundcloud.android:android-crop:0.9.10@aar'
 | |
|     compile 'com.android.support:appcompat-v7:22.1.1'
 | |
|     compile 'com.android.support:recyclerview-v7:21.0.3'
 | |
|     compile 'com.melnykov:floatingactionbutton:1.1.0'
 | |
|     compile 'com.google.zxing:android-integration:3.1.0'
 | |
|     compile ('com.android.support:support-v4-preferencefragment:1.0.0@aar'){
 | |
|         exclude module: 'support-v4'
 | |
|     }
 | |
|     compile ('com.android.support:gridlayout-v7:22.2.0') {
 | |
|         exclude module: 'support-v4'
 | |
|     }
 | |
| 
 | |
|     compile 'com.squareup.dagger:dagger:1.2.2'
 | |
|     compile ("com.doomonafireball.betterpickers:library:1.5.3") {
 | |
|         exclude group: 'com.android.support', module: 'support-v4'
 | |
|     }
 | |
|     compile 'com.madgag.spongycastle:prov:1.51.0.0'
 | |
|     compile 'com.commonsware.cwac:camera:0.6.12'
 | |
|     provided 'com.squareup.dagger:dagger-compiler:1.2.2'
 | |
| 
 | |
|     compile 'org.whispersystems:jobmanager:0.11.0'
 | |
|     compile 'org.whispersystems:libpastelog:1.0.6'
 | |
|     compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
 | |
|     compile 'org.whispersystems:textsecure-android:1.6.1'
 | |
| 
 | |
|     androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
 | |
|     androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
 | |
| 
 | |
|     androidTestCompile ('org.assertj:assertj-core:1.7.1') {
 | |
|         exclude group: 'org.hamcrest', module: 'hamcrest-core'
 | |
|     }
 | |
|     androidTestCompile ('com.squareup.assertj:assertj-android:1.0.0') {
 | |
|         exclude group: 'org.hamcrest',        module: 'hamcrest-core'
 | |
|         exclude group: 'com.android.support', module: 'support-annotations'
 | |
|     }
 | |
|     androidTestCompile ('com.android.support.test:runner:0.2') {
 | |
|         exclude group: 'com.android.support', module: 'support-annotations'
 | |
|     }
 | |
|     androidTestCompile ('com.android.support.test.espresso:espresso-core:2.1') {
 | |
|         exclude group: 'com.android.support', module: 'support-annotations'
 | |
|         exclude group: 'javax.inject'
 | |
|     }
 | |
| }
 | |
| 
 | |
| dependencyVerification {
 | |
|     verify = [
 | |
|             'me.leolin:ShortcutBadger:3142d017234bfa0cdd69ccded7cc5ea63f13b97574803c8c616c9bbeaad33ad9',
 | |
|             'se.emilsjolander:stickylistheaders:a08ca948aa6b220f09d82f16bbbac395f6b78897e9eeac6a9f0b0ba755928eeb',
 | |
|             'com.google.android.gms:play-services-base:832cb6b3130e871db6a412c4ab585656dbcc5e7948101f190186757785703f75',
 | |
|             'com.jpardogo.materialtabstrip:library:c6ef812fba4f74be7dc4a905faa4c2908cba261a94c13d4f96d5e67e4aad4aaa',
 | |
|             'org.w3c:smil:085dc40f2bb249651578bfa07499fd08b16ad0886dbe2c4078586a408da62f9b',
 | |
|             'org.apache.httpcomponents:httpclient-android:6f56466a9bd0d42934b90bfbfe9977a8b654c058bf44a12bdc2877c4e1f033f1',
 | |
|             'com.github.chrisbanes.photoview:library:8b5344e206f125e7ba9d684008f36c4992d03853c57e5814125f88496126e3cc',
 | |
|             'com.github.bumptech.glide:glide:adf657e6bddccb168a29e18ab0954043af46a9b5c736d8c3193c9783fd83d69e',
 | |
|             'com.makeramen:roundedimageview:1f5a1865796b308c6cdd114acc6e78408b110f0a62fc63553278fbeacd489cd1',
 | |
|             'com.pnikosis:materialish-progress:d71d80e00717a096784482aee21001a9d299fec3833e4ebd87739ed36cf77c54',
 | |
|             'de.greenrobot:eventbus:61d743a748156a372024d083de763b9e91ac2dcb3f6a1cbc74995c7ddab6e968',
 | |
|             'com.afollestad:material-dialogs:c17205f0d300baa307599c428a5473a6659684c94a5f68ae3c2b84b5e4741172',
 | |
|             'pl.tajchert:waitingdots:2835d49e0787dbcb606c5a60021ced66578503b1e9fddcd7a5ef0cd5f095ba2c',
 | |
|             'com.soundcloud.android:android-crop:ffd4b973cf6e97f7d64118a0dc088df50e9066fd5634fe6911dd0c0c5d346177',
 | |
|             'com.android.support:appcompat-v7:9a2355537c2f01cf0b95523605c18606b8d824017e6e94a05c77b0cfc8f21c96',
 | |
|             'com.android.support:recyclerview-v7:e525ad3f33c84bb12b73d2dc975b55364a53f0f2d0697e043efba59ba73e22d2',
 | |
|             'com.melnykov:floatingactionbutton:0679ad9f7d61eb7aeab91e8dc56358cdedd5b1c1b9c48464499ffa05c40d3985',
 | |
|             'com.google.zxing:android-integration:89e56aadf1164bd71e57949163c53abf90af368b51669c0d4a47a163335f95c4',
 | |
|             'com.android.support:support-v4-preferencefragment:5470f5872514a6226fa1fc6f4e000991f38805691c534cf0bd2778911fc773ad',
 | |
|             'com.android.support:gridlayout-v7:a9b770cffca2c7c5cd83cba4dd12503365de5e8d9c79c479165adf18ab3bc25b',
 | |
|             'com.squareup.dagger:dagger:789aca24537022e49f91fc6444078d9de8f1dd99e1bfb090f18491b186967883',
 | |
|             'com.doomonafireball.betterpickers:library:132ecd685c95a99e7377c4e27bfadbb2d7ed0bea995944060cd62d4369fdaf3d',
 | |
|             'com.madgag.spongycastle:prov:b8c3fec3a59aac1aa04ccf4dad7179351e54ef7672f53f508151b614c131398a',
 | |
|             'com.commonsware.cwac:camera:dcc93ddbb2f0393114fa1f31a13fe9e6edfcf5dbe96b22bc4b66c7b15e179054',
 | |
|             'org.whispersystems:jobmanager:ea9cb943c4892fb90c1eea1be30efeb85cefca213d52c788419553b58d0ed70d',
 | |
|             'org.whispersystems:libpastelog:550d33c565380d90f4c671e7b8ed5f3a6da55a9fda468373177106b2eb5220b2',
 | |
|             'com.amulyakhare:com.amulyakhare.textdrawable:54c92b5fba38cfd316a07e5a30528068f45ce8515a6890f1297df4c401af5dcb',
 | |
|             'org.whispersystems:textsecure-android:843d4483e9c3b3414373ddd70df19895b3ee7ef559eeb15e60926e1b07fcecf3',
 | |
|             'com.nineoldandroids:library:68025a14e3e7673d6ad2f95e4b46d78d7d068343aa99256b686fe59de1b3163a',
 | |
|             'javax.inject:javax.inject:91c77044a50c481636c32d916fd89c9118a72195390452c81065080f957de7ff',
 | |
|             'com.madgag.spongycastle:core:8d6240b974b0aca4d3da9c7dd44d42339d8a374358aca5fc98e50a995764511f',
 | |
|             'org.whispersystems:textsecure-java:f161c5d5be5a0ba52ede273692ef17982b2af270c6af5c3666bc2adb289a3f61',
 | |
|             'org.whispersystems:axolotl-android:40d3db5004a84749a73f68d2f0d01b2ae35a73c54df96d8c6c6723b96efb6fc0',
 | |
|             'com.googlecode.libphonenumber:libphonenumber:eba17eae81dd622ea89a00a3a8c025b2f25d342e0d9644c5b62e16f15687c3ab',
 | |
|             'com.google.protobuf:protobuf-java:e0c1c64575c005601725e7c6a02cebf9e1285e888f756b2a1d73ffa8d725cc74',
 | |
|             'com.squareup.okhttp:okhttp:89b7f63e2e5b6c410266abc14f50fe52ea8d2d8a57260829e499b1cd9f0e61af',
 | |
|             'com.fasterxml.jackson.core:jackson-databind:835097bcdd11f5bc8a08378c70d4c8054dfa4b911691cc2752063c75534d198d',
 | |
|             'org.whispersystems:axolotl-java:6daee739b89d8d7101de6d98f77132fee48495c6ea647d880e77def842f999ea',
 | |
|             'org.whispersystems:curve25519-android:3c29a4131a69b0d16baaa3d707678deb39602c3a3ffd75805ce7f9db252e5d0d',
 | |
|             'com.squareup.okio:okio:5e1098bd3fdee4c3347f5ab815b40ba851e4ab1b348c5e49a5b0362f0ce6e978',
 | |
|             'com.fasterxml.jackson.core:jackson-annotations:0ca408c24202a7626ec8b861e99d85eca5e38b73311dd6dd12e3e9deecc3fe94',
 | |
|             'com.fasterxml.jackson.core:jackson-core:cbf4604784b4de226262845447a1ad3bb38a6728cebe86562e2c5afada8be2c0',
 | |
|             'org.whispersystems:curve25519-java:9ccef8f5aba05d9942336f023c589d6278b4f9135bdc34a7bade1f4e7ad65fa3',
 | |
|             'com.android.support:support-v4:1e2e4d35ac7fd30db5ce3bc177b92e4d5af86acef2ef93e9221599d733346f56',
 | |
|             'com.android.support:support-annotations:7bc07519aa613b186001160403bcfd68260fa82c61cc7e83adeedc9b862b94ae',
 | |
|     ]
 | |
| }
 | |
| 
 | |
| android {
 | |
|     compileSdkVersion 22
 | |
|     buildToolsVersion '22.0.1'
 | |
|     testBuildType "automation"
 | |
| 
 | |
|     dexOptions {
 | |
|         javaMaxHeapSize "4g"
 | |
|     }
 | |
| 
 | |
|     defaultConfig {
 | |
|         minSdkVersion 9
 | |
|         targetSdkVersion 22
 | |
| 
 | |
|         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
 | |
|         buildConfigField "long", "BUILD_TIMESTAMP", System.currentTimeMillis() + "L"
 | |
|         buildConfigField "String", "PUSH_URL", "\"https://textsecure-service.whispersystems.org\""
 | |
|         buildConfigField "boolean", "DEV_BUILD", "false"
 | |
|     }
 | |
| 
 | |
|     compileOptions {
 | |
|         sourceCompatibility JavaVersion.VERSION_1_7
 | |
|         targetCompatibility JavaVersion.VERSION_1_7
 | |
|     }
 | |
| 
 | |
|     packagingOptions {
 | |
|         exclude 'LICENSE.txt'
 | |
|         exclude 'LICENSE'
 | |
|         exclude 'NOTICE'
 | |
|         exclude 'asm-license.txt'
 | |
|         exclude 'META-INF/LICENSE'
 | |
|         exclude 'META-INF/NOTICE'
 | |
|     }
 | |
| 
 | |
|     signingConfigs {
 | |
|         release
 | |
|     }
 | |
| 
 | |
|     buildTypes {
 | |
|         debug {
 | |
|             minifyEnabled true
 | |
|             proguardFiles getDefaultProguardFile('proguard-android.txt'),
 | |
|                           'proguard-google-play-services.pro',
 | |
|                           'proguard-dagger.pro',
 | |
|                           'proguard-jackson.pro',
 | |
|                           'proguard-sqlite.pro',
 | |
|                           'proguard-appcompat-v7.pro',
 | |
|                           'proguard-square-okhttp.pro',
 | |
|                           'proguard-square-okio.pro',
 | |
|                           'proguard-spongycastle.pro',
 | |
|                           'proguard-rounded-image-view.pro',
 | |
|                           'proguard-glide.pro',
 | |
|                           'proguard-shortcutbadger.pro',
 | |
|                           'proguard.cfg'
 | |
|         }
 | |
|         release {
 | |
|             minifyEnabled true
 | |
|             proguardFiles = buildTypes.debug.proguardFiles
 | |
|             signingConfig signingConfigs.release
 | |
|         }
 | |
|         automation.initWith(buildTypes.debug)
 | |
|         automation {
 | |
|             proguardFile 'proguard-automation.pro'
 | |
|             buildConfigField "String", "PUSH_URL", "\"https://textsecure-service-staging.whispersystems.org\""
 | |
|         }
 | |
|         dev.initWith(buildTypes.debug)
 | |
|         dev {
 | |
|             buildConfigField "boolean", "DEV_BUILD", "true"
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     sourceSets {
 | |
|         main {
 | |
|             manifest.srcFile 'AndroidManifest.xml'
 | |
|             java.srcDirs = ['src']
 | |
|             resources.srcDirs = ['src']
 | |
|             aidl.srcDirs = ['src']
 | |
|             renderscript.srcDirs = ['src']
 | |
|             res.srcDirs = ['res']
 | |
|             assets.srcDirs = ['assets']
 | |
|         }
 | |
|         androidTest {
 | |
|             java.srcDirs = ['test/androidTest/java']
 | |
|         }
 | |
|     }
 | |
| 
 | |
|      lintOptions {
 | |
|         abortOnError false
 | |
|     }
 | |
| }
 | |
| 
 | |
| tasks.whenTaskAdded { task ->
 | |
|     if (task.name.equals("lint")) {
 | |
|         task.enabled = false
 | |
|     }
 | |
| }
 | |
| 
 | |
| def Properties props = new Properties()
 | |
| def propFile = new File('signing.properties')
 | |
| 
 | |
| if (propFile.canRead()){
 | |
|     props.load(new FileInputStream(propFile))
 | |
| 
 | |
|     if (props !=null &&
 | |
|         props.containsKey('STORE_FILE')     &&
 | |
|         props.containsKey('STORE_PASSWORD') &&
 | |
|         props.containsKey('KEY_ALIAS')      &&
 | |
|         props.containsKey('KEY_PASSWORD'))
 | |
|     {
 | |
|         android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
 | |
|         android.signingConfigs.release.storePassword = props['STORE_PASSWORD']
 | |
|         android.signingConfigs.release.keyAlias = props['KEY_ALIAS']
 | |
|         android.signingConfigs.release.keyPassword = props['KEY_PASSWORD']
 | |
|     } else {
 | |
|         println 'signing.properties found but some entries are missing'
 | |
|         android.buildTypes.release.signingConfig = null
 | |
|     }
 | |
| }else {
 | |
|     println 'signing.properties not found'
 | |
|     android.buildTypes.release.signingConfig = null
 | |
| }
 | |
| 
 | |
| if (project.hasProperty('espresso') && System.console() != null) {
 | |
|     println "______________________WARNING_______________________"
 | |
|     println "ALL YOUR CONTACTS WILL BE DELETED IN THE PROCESS"
 | |
|     println "OF RUNNING THESE TESTS, TYPE 'delete all my contacts'"
 | |
|     println "TO CONTINUE"
 | |
|     println "----------------------------------------------------"
 | |
| 
 | |
|     def input = System.console().readLine(':')
 | |
|     if (input == 'delete all my contacts') {
 | |
|         android.productFlavors {
 | |
|             base {}
 | |
|             espresso {
 | |
|                 testInstrumentationRunner "org.thoughtcrime.securesms.TextSecureWakingTestRunner"
 | |
|             }
 | |
|         }
 | |
|         android.sourceSets.espresso {
 | |
|             manifest.srcFile 'test/espresso/AndroidManifest.xml'
 | |
|         }
 | |
|         android.sourceSets.androidTestEspresso {
 | |
|             java.srcDirs = ['test/androidTestEspresso/java']
 | |
|             res.srcDirs  = ['test/androidTestEspresso/res']
 | |
|         }
 | |
|     }
 | |
| }
 |