-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
82 lines (71 loc) · 2.35 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
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.7.1'
}
}
allprojects {
repositories {
jcenter()
}
}
subprojects {
version '0.2'
group 'com.seroperson.itstimetoact'
if(name != 'itstimetoact-sample') {
apply plugin: 'com.android.library'
apply from: "$rootDir/coverage.gradle"
android.defaultConfig.minSdkVersion 1
dependencies {
testCompile(['org.robolectric:robolectric:3.1.1', 'junit:junit:4.12'])
compile 'com.android.support:support-annotations:23.2.0'
}
}
else {
apply plugin: 'com.android.application'
android.defaultConfig.minSdkVersion 9
}
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
targetSdkVersion 25
versionCode 2
versionName version
}
lintOptions {
// temporary hack to make travis build success (due to too old platform-tools)
abortOnError false
}
}
}
apply plugin: 'jacoco'
def publishedProjects = subprojects.findAll { it.name != 'itstimetoact-sample' }
task jacocoRootReport(type: JacocoReport) {
group = 'Reporting'
description = 'Generates an aggregate report from all subprojects'
sourceDirectories = files(publishedProjects.android.sourceSets.main.javaDirectories)
classDirectories = files(publishedProjects.buildDir.collect { "$it/intermediates/classes/debug/" })
executionData = files(publishedProjects.jacocoTestReport.executionData)
reports {
html.enabled = true
xml.enabled = true
}
publishedProjects.collect { dependsOn("${it.path}:test")}
}
apply plugin: 'com.github.kt3k.coveralls'
coveralls {
sourceDirs = publishedProjects.android.sourceSets.main.javaDirectories.flatten()
jacocoReportPath = "$buildDir/reports/jacoco/jacocoRootReport/jacocoRootReport.xml"
}
tasks.coveralls {
group = 'Coverage reports'
description = 'Uploads the aggregated coverage report to Coveralls'
dependsOn jacocoRootReport
onlyIf { System.env.'CI' }
}