forked from bumptech/glide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
150 lines (122 loc) · 4.49 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
apply plugin: 'com.android.library'
apply plugin: 'maven'
apply plugin: 'findbugs'
apply plugin: 'pmd'
apply plugin: 'jacoco'
apply plugin: 'com.github.kt3k.coveralls'
findbugs {
toolVersion = FINDBUGS_VERSION
}
jacoco {
toolVersion = JACOCO_VERSION
}
coveralls {
jacocoReportPath = 'build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml'
}
dependencies {
compile project(':third_party:gif_decoder')
compile project(':third_party:disklrucache')
compile "com.android.support:support-v4:${SUPPORT_V4_VERSION}"
testCompile project(':testutil')
testCompile 'com.google.guava:guava-testlib:18.0'
testCompile "com.google.truth:truth:${TRUTH_VERSION}"
testCompile "junit:junit:${JUNIT_VERSION}"
testCompile "org.mockito:mockito-core:${MOCKITO_VERSION}"
testCompile "org.robolectric:robolectric:${ROBOLECTRIC_VERSION}"
testCompile "com.squareup.okhttp3:mockwebserver:${MOCKWEBSERVER_VERSION}"
testCompile "com.android.support:support-v4:${SUPPORT_V4_VERSION}"
}
android.testOptions.unitTests.all {
// configure max heap size of the test JVM
maxHeapSize = '2048m'
if (JavaVersion.current() <= JavaVersion.VERSION_1_7) {
// Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=2048m; support was removed in 8.0
jvmArgs '-XX:MaxPermSize=2048m'
}
}
android {
compileSdkVersion COMPILE_SDK_VERSION as int
buildToolsVersion BUILD_TOOLS_VERSION as String
defaultConfig {
minSdkVersion MIN_SDK_VERSION as int
targetSdkVersion TARGET_SDK_VERSION as int
versionName VERSION_NAME as String
consumerProguardFiles 'proguard-rules.txt'
}
buildTypes {
debug {
testCoverageEnabled = true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
afterEvaluate {
task findbugs(type: FindBugs, dependsOn: assembleDebug) {
description 'Run findbugs'
group 'verification'
classes = fileTree('build/intermediates/classes/debug/')
source = fileTree('src/main/java')
classpath = project.configurations.compile
effort = 'max'
excludeFilter = file("findbugs-exclude.xml")
reports {
xml.enabled = false
html.enabled = true
}
}
check.dependsOn('findbugs')
pmd {
toolVersion '5.4.0'
}
task pmd(type: Pmd) {
targetJdk = TargetJdk.VERSION_1_7
description 'Run pmd'
group 'verification'
// If ruleSets is not empty, it seems to contain some
// defaults which override rules in the ruleset file...
ruleSets = []
ruleSetFiles = files('pmd-ruleset.xml')
source = fileTree('src/main/java')
reports {
xml.enabled = false
html.enabled = true
}
}
check.dependsOn('pmd')
task jacocoTestReport(type: JacocoReport, dependsOn: testDebugUnitTest) {
def coverageSourceDirs = ['src/main/java']
group = "Reporting"
description = "Generate Jacoco coverage reports"
classDirectories = fileTree(
dir: 'build/intermediates/classes/debug',
excludes: ['**/R.class',
'**/R$*.class',
'**/BuildConfig.*',
'**/Manifest*.*',
'**/BitmapRequestBuilder.class',
'**/DrawableRequestBuilder.class',
'**/GifRequestBuilder.class',]
)
additionalSourceDirs = files(coverageSourceDirs)
sourceDirectories = files(coverageSourceDirs)
executionData = files('build/jacoco/testDebug.exec')
reports {
xml.enabled = true
html.enabled = true
}
}
}
apply from: "${rootProject.projectDir}/scripts/upload.gradle"
// exclude <dependency> tag for android support-v4 library from :glide's pom
// this will ensure that this warning will not prevent the build from completing:
// Module 'com.github.bumptech.glide:glide:4.0.0-SNAPSHOT' depends on one or more Android Libraries but is a jar
// most users will need to override support-v4 version anyway if a newer version is available
// TODO make support-v4 a <scope>runtime</scope> dependency in pom.xml
afterEvaluate {
uploadArchives.repositories.mavenDeployer.pom.whenConfigured { p ->
p.dependencies = p.dependencies.findAll { dep -> dep.artifactId != "support-v4" }
}
}