forked from butterproject/butter-android
-
Notifications
You must be signed in to change notification settings - Fork 275
/
Copy pathbuild.gradle
94 lines (84 loc) · 3.27 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
//temporary to solve hugo error
maven { url 'https://guardian.github.com/maven/repo-releases' }
mavenCentral()
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.11.1'
classpath 'io.sentry:sentry-android-gradle-plugin:1.7.36'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'de.undercouch:gradle-download-task:4.0.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
ext {
compileSdk = 29
targetSdk = 29
minSdk = 16
appCompatVersion = '1.1.0'
butterknifeVersion = "10.2.1"
okHttpVersion = "3.4.2"
picassoVersion = "2.71828"
daggerVersion = "2.7"
javaxAnnotationVersion = "1.3.2"
sentryDsn = "https://[email protected]/5744175"
dhtPublicKey = "3704c4f5f0426d9c726c5b195539c42c7383816e8d756bd68fa5340435f99070"
}
allprojects {
repositories {
maven { url 'https://guardian.github.com/maven/repo-releases' }
maven { url 'https://maven.google.com' }
jcenter()
mavenCentral()
maven { url 'https://jitpack.io' }
google()
}
//let project evaluate its script first
project.afterEvaluate {
//only apply to projects that have the android plugin
if (project.plugins.hasPlugin('com.android.application')) {
//global android setting
project.android {
packagingOptions {
exclude 'META-INF/beans.xml'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/DEPENDENCIES.txt'
}
applicationVariants.all { variant ->
//rename output files
renameOutputFiles(project, variant)
}
adbOptions {
timeOutInMs 10 * 60 * 1000 // 10 minutes
}
dexOptions {
javaMaxHeapSize "512M"
}
}
}
}
}
def renameOutputFiles(Project project, variant) {
variant.outputs.each { output ->
output.versionCodeOverride = project.ext.versionCodes.get(variant.productFlavors[0].name, 0) * 10000000 + output.versionCode
def outputFileName = output.outputFile.name
// Customise APK filenames
if (outputFileName.contains("debug")) {
output.outputFileName = outputFileName.replace("debug", "development").replace(".apk", "-" + (System.getenv("BUILD_NUMBER") ?: "local") + ".apk")
} else {
output.outputFileName = outputFileName.replace(".apk", "-" + variant.versionName + ".apk")
}
}
}