session-android/build.gradle

369 lines
13 KiB
Groovy
Raw Normal View History

import java.security.MessageDigest
buildscript {
repositories {
2017-11-06 17:20:52 +00:00
maven {
url 'https://maven.google.com/'
name 'Google'
}
maven {
url "https://repo1.maven.org/maven2"
jcenter()
}
}
dependencies {
2017-11-22 04:40:39 +00:00
classpath 'com.android.tools.build:gradle:3.0.1'
classpath files('libs/gradle-witness.jar')
}
}
2014-07-23 22:40:45 +00:00
apply plugin: 'com.android.application'
apply plugin: 'witness'
repositories {
2014-10-01 04:46:13 +00:00
maven {
url "https://repo1.maven.org/maven2/"
2014-10-01 04:46:13 +00:00
}
maven {
url "https://raw.github.com/signalapp/maven/master/preferencefragment/releases/"
}
maven {
url "https://raw.github.com/signalapp/maven/master/smil/releases/"
}
maven {
url "https://raw.github.com/signalapp/maven/master/photoview/releases/"
}
maven {
url "https://raw.github.com/signalapp/maven/master/shortcutbadger/releases/"
}
maven {
url "https://raw.github.com/signalapp/maven/master/circular-progress-button/releases/"
}
maven {
url "https://raw.github.com/signalapp/maven/master/sqlcipher/release/"
}
maven {
url "https://maven.google.com"
}
maven { // textdrawable
url 'https://dl.bintray.com/amulyakhare/maven'
}
google()
2015-01-24 04:38:45 +00:00
jcenter()
mavenLocal()
}
dependencies {
def supportVersion = '28.0.0'
compile "com.android.support:appcompat-v7:$supportVersion"
compile "com.android.support:recyclerview-v7:$supportVersion"
compile "com.android.support:design:$supportVersion"
compile "com.android.support:support-v13:$supportVersion"
compile "com.android.support:cardview-v7:$supportVersion"
compile "com.android.support:preference-v7:$supportVersion"
compile "com.android.support:preference-v14:$supportVersion"
compile "com.android.support:gridlayout-v7:$supportVersion"
compile "com.android.support:exifinterface:$supportVersion"
compile 'com.android.support:multidex:1.0.3'
compile 'android.arch.lifecycle:extensions:1.1.1'
compile 'android.arch.lifecycle:common-java8:1.1.1'
compile 'android.arch.work:work-runtime:1.0.0-alpha09'
2017-01-08 17:43:43 +00:00
compile 'com.google.android.gms:play-services-gcm:9.6.1'
compile 'com.google.android.gms:play-services-maps:9.6.1'
compile 'com.google.android.gms:play-services-places:9.6.1'
2017-01-08 17:43:43 +00:00
2018-08-23 18:08:35 +00:00
compile 'com.google.android.exoplayer:exoplayer-core:2.8.4'
compile 'com.google.android.exoplayer:exoplayer-ui:2.8.4'
2018-05-22 09:13:10 +00:00
compile 'org.whispersystems:signal-service-android:2.10.0-RC1'
2018-09-06 22:30:43 +00:00
compile 'org.whispersystems:webrtc-android:M69'
2017-01-08 17:43:43 +00:00
compile "me.leolin:ShortcutBadger:1.1.16"
2017-01-08 17:43:43 +00:00
compile 'se.emilsjolander:stickylistheaders:2.7.0'
compile 'com.jpardogo.materialtabstrip:library:1.0.9'
compile 'org.apache.httpcomponents:httpclient-android:4.3.5'
2017-10-12 00:12:46 +00:00
compile 'com.github.chrisbanes:PhotoView:2.1.3'
2018-01-09 01:04:39 +00:00
compile 'com.github.bumptech.glide:glide:4.5.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.5.0'
compile 'com.makeramen:roundedimageview:2.1.0'
compile 'com.pnikosis:materialish-progress:1.5'
2017-02-18 04:27:11 +00:00
compile 'org.greenrobot:eventbus:3.0.0'
compile 'pl.tajchert:waitingdots:0.1.0'
compile 'com.soundcloud.android:android-crop:0.9.10@aar'
compile 'com.melnykov:floatingactionbutton:1.3.0'
compile 'com.google.zxing:android-integration:3.1.0'
compile 'com.squareup.dagger:dagger:1.2.2'
2017-11-06 17:20:52 +00:00
annotationProcessor 'com.squareup.dagger:dagger-compiler:1.2.2'
compile 'mobi.upod:time-duration-picker:1.1.3'
provided 'com.squareup.dagger:dagger-compiler:1.2.2'
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
compile 'com.google.zxing:core:3.2.1'
compile ('com.davemorrissey.labs:subsampling-scale-image-view:3.6.0') {
exclude group: 'com.android.support', module: 'support-annotations'
}
compile ('cn.carbswang.android:NumberPickerView:1.0.9') {
exclude group: 'com.android.support', module: 'appcompat-v7'
}
compile ('com.tomergoldst.android:tooltips:1.0.6') {
exclude group: 'com.android.support', module: 'appcompat-v7'
}
compile ('com.klinkerapps:android-smsmms:4.0.1') {
exclude group: 'com.squareup.okhttp', module: 'okhttp'
exclude group: 'com.squareup.okhttp', module: 'okhttp-urlconnection'
}
compile 'com.annimon:stream:1.1.8'
compile ('com.takisoft.fix:colorpicker:0.9.1') {
exclude group: 'com.android.support', module: 'appcompat-v7'
exclude group: 'com.android.support', module: 'recyclerview-v7'
}
compile 'com.codewaves.stickyheadergrid:stickyheadergrid:0.9.4'
compile 'com.github.dmytrodanylyk.circular-progress-button:library:1.1.3-S2'
2018-07-02 23:57:06 +00:00
compile 'org.signal:android-database-sqlcipher:3.5.9-S3'
compile ('com.googlecode.ez-vcard:ez-vcard:0.9.11') {
exclude group: 'com.fasterxml.jackson.core'
exclude group: 'org.freemarker'
}
testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:1.7.1'
testCompile 'org.mockito:mockito-core:1.9.5'
testCompile 'org.powermock:powermock-api-mockito:1.6.1'
testCompile 'org.powermock:powermock-module-junit4:1.6.1'
testCompile 'org.powermock:powermock-module-junit4-rule:1.6.1'
testCompile 'org.powermock:powermock-classloading-xstream:1.6.1'
androidTestCompile 'com.android.support:multidex:1.0.3'
androidTestCompile 'com.android.support:multidex-instrumentation:1.0.3'
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.1.1') {
exclude group: 'org.hamcrest', module: 'hamcrest-core'
exclude group: 'com.android.support', module: 'support-annotations'
}
}
android {
2017-11-06 17:20:52 +00:00
flavorDimensions "none"
compileSdkVersion 28
buildToolsVersion '27.0.3'
useLibrary 'org.apache.http.legacy'
dexOptions {
javaMaxHeapSize "4g"
}
defaultConfig {
2018-10-25 00:05:23 +00:00
versionCode 421
versionName "4.29.7"
minSdkVersion 14
2018-10-03 17:37:43 +00:00
targetSdkVersion 26
2017-01-08 17:43:43 +00:00
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
project.ext.set("archivesBaseName", "Signal");
buildConfigField "long", "BUILD_TIMESTAMP", getLastCommitTimestamp() + "L"
2018-05-22 09:13:10 +00:00
buildConfigField "String", "SIGNAL_URL", "\"https://textsecure-service-staging.whispersystems.org\""
2017-08-08 23:37:15 +00:00
buildConfigField "String", "SIGNAL_CDN_URL", "\"https://cdn.signal.org\""
buildConfigField "String", "SIGNAL_CONTACT_DISCOVERY_URL", "\"https://api.directory.signal.org\""
buildConfigField "String", "SIGNAL_SERVICE_STATUS_URL", "\"uptime.signal.org\""
2016-10-17 02:05:07 +00:00
buildConfigField "String", "GIPHY_PROXY_HOST", "\"giphy-proxy-production.whispersystems.org\""
buildConfigField "int", "GIPHY_PROXY_PORT", "80"
buildConfigField "String", "USER_AGENT", "\"OWA\""
buildConfigField "boolean", "DEV_BUILD", "false"
buildConfigField "String", "MRENCLAVE", "\"cd6cfc342937b23b1bdd3bbf9721aa5615ac9ff50a75c5527d441cd3276826c9\""
2018-05-22 09:13:10 +00:00
buildConfigField "String", "UNIDENTIFIED_SENDER_TRUST_ROOT", "\"BbqY1DzohE4NUZoVF+L18oUPrK3kILllLEJh2UnPSsEx\""
2018-02-03 00:31:49 +00:00
ndk {
abiFilters "armeabi", "armeabi-v7a", "x86"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
packagingOptions {
exclude 'LICENSE.txt'
exclude 'LICENSE'
exclude 'NOTICE'
exclude 'asm-license.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/proguard/androidx-annotations.pro'
}
signingConfigs {
release
}
buildTypes {
debug {
2015-01-21 07:26:58 +00:00
minifyEnabled true
2015-04-02 01:04:23 +00:00
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-retrofit.pro',
'proguard-webrtc.pro',
'proguard-klinker.pro',
'proguard-retrolambda.pro',
'proguard-okhttp.pro',
'proguard-ez-vcard.pro',
'proguard-workmanager.pro',
2015-04-02 01:04:23 +00:00
'proguard.cfg'
testProguardFiles 'proguard-automation.pro',
'proguard.cfg'
}
release {
2015-01-21 07:26:58 +00:00
minifyEnabled true
proguardFiles = buildTypes.debug.proguardFiles
signingConfig signingConfigs.release
}
}
2014-01-11 02:20:25 +00:00
productFlavors {
play {
2017-11-06 17:20:52 +00:00
dimension "none"
ext.websiteUpdateUrl = "null"
buildConfigField "boolean", "PLAY_STORE_DISABLED", "false"
buildConfigField "String", "NOPLAY_UPDATE_URL", "$ext.websiteUpdateUrl"
}
website {
2017-11-06 17:20:52 +00:00
dimension "none"
ext.websiteUpdateUrl = "https://updates.signal.org/android"
buildConfigField "boolean", "PLAY_STORE_DISABLED", "true"
buildConfigField "String", "NOPLAY_UPDATE_URL", "\"$ext.websiteUpdateUrl\""
}
}
2017-11-06 17:20:52 +00:00
android.applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = outputFileName.replace(".apk", "-${variant.versionName}.apk")
}
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
}
androidTest {
java.srcDirs = ['test/androidTest/java']
}
test {
java.srcDirs = ['test/unitTest/java']
}
website.manifest.srcFile 'website/AndroidManifest.xml'
}
2014-01-11 02:20:25 +00:00
lintOptions {
abortOnError false
}
}
task assembleWebsiteDescriptor << {
android.applicationVariants.all { variant ->
if (variant.name.equals("websiteDebug") ||
variant.name.equals("websiteRelease"))
{
File file = new File(variant.outputs[0].outputFile.path)
if (file.exists()) {
MessageDigest md = MessageDigest.getInstance("SHA-256");
file.eachByte 4096, {bytes, size ->
md.update(bytes, 0, size);
}
String digest = md.digest().collect {String.format "%02x", it}.join();
String url = variant.productFlavors.get(0).ext.websiteUpdateUrl
String apkName = variant.outputs[0].outputFile.name
String descriptor = "{" +
"\"versionCode\" : $project.android.defaultConfig.versionCode," +
"\"versionName\" : \"$project.android.defaultConfig.versionName\"," +
"\"sha256sum\" : \"$digest\"," +
"\"url\" : \"$url/$apkName\"" +
"}"
File descriptorFile = new File(variant.outputs[0].outputFile.parent, apkName.replace(".apk", ".json"))
descriptorFile.write(descriptor)
}
}
}
}
tasks.whenTaskAdded { task ->
if (task.name.equals("lint")) {
task.enabled = false
}
if (task.name.equals("assembleWebsiteDebug") ||
task.name.equals("assembleWebsiteRelease"))
{
task.finalizedBy assembleWebsiteDescriptor
}
}
def getLastCommitTimestamp() {
new ByteArrayOutputStream().withStream { os ->
def result = exec {
executable = 'git'
args = ['log', '-1', '--pretty=format:%ct']
standardOutput = os
}
return os.toString() + "000"
}
}
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
}