-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
94 lines (83 loc) · 3.12 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
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
classpath 'com.github.dcendents:android-maven-plugin:1.2'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.17.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
ext {
appCompatVersion = "25.4.0"
buildToolsVersion = "25.0.3"
targetSdk = 25
compileSdk = 25
minSdk = 16
butterknifeVersion = "8.4.0"
okHttpVersion = "3.4.2"
picassoVersion = "2.5.2"
torrentstreamServerVersion = "ab4439a90e49bf4e9682d4b4754922b6c506069c"
daggerVersion = "2.7"
javaxAnnotationVersion = "1.2"
}
allprojects {
repositories {
maven { url 'https://maven.google.com' }
jcenter()
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
maven { url 'http://guardian.github.com/maven/repo-releases' }
maven { url 'https://jitpack.io' }
}
//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'
exclude 'lib/x86_64/libjlibtorrent-1.2.0.16.so'
}
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")) {
outputFileName = outputFileName.replace("debug", "development").replace(".apk", "-" + (System.getenv("BUILD_NUMBER") ?: "local") + ".apk")
} else {
outputFileName = outputFileName.replace(".apk", "-" + variant.versionName + ".apk")
}
output.outputFileName = new File(
"./../../../../../build/",
outputFileName)
}
}