-
-
Notifications
You must be signed in to change notification settings - Fork 89
/
build.gradle
149 lines (124 loc) · 5.26 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
buildscript {
def versionMajor = 1
def versionMinor = 0
def versionPatch = 0
ext.versions = [
'versionCode' : versionMajor * 10000 + versionMinor * 100 + versionPatch,
'versionName' : "${versionMajor}.${versionMinor}.${versionPatch}",
'minSdk' : 16,
'targetSdk' : 27,
'compileSdk' : 27,
'sourceCompatibility': JavaVersion.VERSION_1_8,
'targetCompatibility': JavaVersion.VERSION_1_8,
'supportLibrary' : '27.0.2',
'buildTools' : '27.0.1'
]
def credentialsFile = new File(System.properties['user.home'], ".bintray/bintray.properties")
if (credentialsFile.canRead()) {
Properties props = new Properties()
props.load(new FileInputStream(credentialsFile))
ext.bintrayCredentials = [
bintrayUser : props['bintray.user'],
bintrayApiKey: props['bintray.apikey']
]
}
ext.bintrayConfig = [
bintrayRepo : 'maven',
bintrayName : 'rxshell',
publishedGroupId: 'eu.darken.rxshell',
siteUrl : 'https://github.com/d4rken/RxShell',
issuesUrl : 'https://github.com/d4rken/RxShell/issues',
gitUrl : 'https://github.com/d4rken/RxShell.git',
libraryVersion : versions.versionName,
developerId : 'darken',
developerName : 'Matthias Urhahn',
developerEmail : 'darken@darken.eu',
licenseName : 'Apache-2.0',
licenseUrl : 'https://github.com/d4rken/RxShell/blob/master/LICENSE',
allLicenses : ["Apache-2.0"]
]
ext.deps = [
'support' : [
'annotations': "com.android.support:support-annotations:${versions.supportLibrary}",
'appcompat' : "com.android.support:appcompat-v7:${versions.supportLibrary}"
],
androidPlugin: 'com.android.tools.build:gradle:3.0.1',
timber : "com.jakewharton.timber:timber:4.6.1",
rxJava : "io.reactivex.rxjava2:rxjava:2.1.6",
rxJavaReplay : "com.jakewharton.rx2:replaying-share:2.0.1",
jUnit : "junit:junit:4.12",
mockito : "org.mockito:mockito-core:2.8.9",
awaitility : "org.awaitility:awaitility:3.0.0",
]
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
//noinspection GradleDependency
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.2'
}
}
apply plugin: "com.github.kt3k.coveralls"
apply plugin: 'java'
allprojects {
apply plugin: 'jacoco'
repositories {
google()
jcenter()
}
}
subprojects { subProject ->
def exclude = ['eu/darken/R*.class', '**/BuildConfig.class', '**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*']
task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) {
reports {
xml.enabled = true
html.enabled = true
}
sourceDirectories = files(["${project.projectDir}/src/main/java"])
classDirectories = files([fileTree(dir: "$project.buildDir/intermediates/classes/debug", excludes: exclude)])
executionData = fileTree(dir: "$project.buildDir", includes: [
"jacoco/testDebugUnitTest.exec"
])
rootProject.coveralls.sourceDirs.addAll(sourceDirectories.flatten())
}
afterEvaluate {
def isLibrary = subProject.plugins.hasPlugin('android-library')
if (isLibrary) {
subProject.apply plugin: "com.github.dcendents.android-maven"
subProject.apply plugin: "com.jfrog.bintray"
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
if (subProject.hasProperty('bintrayCredentials')) {
subProject.apply from: '../publish-to-bintray.gradle'
}
}
}
}
def publishedProjects = subprojects.findAll { !it.path.contains('example') }
task jacocoRootReport(type: JacocoReport, group: 'Coverage reports') {
description = 'Generates an aggregate report from all subprojects'
dependsOn(publishedProjects.jacocoTestReport)
additionalSourceDirs = files(publishedProjects.sourceSets.main.allSource.srcDirs)
sourceDirectories = files(publishedProjects.jacocoTestReport.sourceDirectories)
classDirectories = files(publishedProjects.jacocoTestReport.classDirectories)
executionData = files(publishedProjects.jacocoTestReport.executionData)
reports {
html.enabled = true
xml.enabled = true
}
}
coveralls {
jacocoReportPath = "${buildDir}/reports/jacoco/jacocoRootReport/jacocoRootReport.xml"
}
tasks.coveralls {
group = 'Coverage reports'
description = 'Uploads the aggregated coverage report to Coveralls'
dependsOn jacocoRootReport
}