-
Notifications
You must be signed in to change notification settings - Fork 2.9k
/
Copy pathbuild.gradle
137 lines (115 loc) · 3.78 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
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.jfrog.artifactory'
group = GROUP
// Both the artifactory and bintray plugins depend on this singular
// global `version` variable. As such, we need to configure it based
// on which task we're running.
//
// The solution here is brittle; it just checks whether 'bintrayUpload'
// was called for execution, otherwise it assumes SNAPSHOT. If we
// were to wait until the task graph was built, we'd be too late
// (the plugins would already have used `version`).
boolean isReleaseBuild = gradle.startParameter.taskNames.contains('bintrayUpload')
version = isReleaseBuild ? VERSION_NAME : "$VERSION_NAME-SNAPSHOT"
logger.info("RxAndroid using version=$project.version")
android {
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
}
compileOptions {
sourceCompatibility rootProject.ext.sourceCompatibility
targetCompatibility rootProject.ext.sourceCompatibility
}
// TODO replace with https://issuetracker.google.com/issues/72050365 once released.
libraryVariants.all {
it.generateBuildConfig.enabled = false
}
}
dependencies {
api 'io.reactivex.rxjava2:rxjava:2.2.10'
testImplementation 'junit:junit:4.12'
testImplementation 'org.robolectric:robolectric:3.8'
}
// Create source/javadoc artifacts for publishing
apply from: "$rootDir/gradle/artifacts.gradle"
// Configure android-maven-gradle-plugin
install {
repositories.mavenInstaller.pom.project {
name POM_NAME
description POM_DESCRIPTION
packaging POM_PACKAGING
url POM_URL
licenses {
license {
name POM_LICENCE_NAME
url POM_LICENCE_URL
distribution POM_LICENCE_DIST
}
}
scm {
url POM_SCM_URL
connection POM_SCM_CONNECTION
developerConnection POM_SCM_DEV_CONNECTION
}
developers {
developer {
id 'JakeWharton'
name 'Jake Wharton'
}
developer {
id 'mttkay'
name 'Matthias Käppler'
}
developer {
id 'dlew'
name 'Dan Lew'
}
}
}
}
// Configure artifactory (for publishing snapshots)
//
// Based on NebulaOJOPublishingPlugin (from nebula-bintray-plugin)
artifactory {
contextUrl = 'https://oss.jfrog.org'
publish {
repository {
repoKey = 'oss-snapshot-local'
if (project.hasProperty('bintrayUser')) {
username = project.property('bintrayUser')
password = project.property('bintrayKey')
}
}
defaults {
publishConfigs('archives')
}
}
}
// Configure gradle-bintray-plugin (for publishing releases)
bintray {
configurations = ['archives']
publish = true
pkg {
repo = 'RxJava'
name = 'RxAndroid'
userOrg = 'reactivex'
licenses = ['Apache-2.0']
labels = ['rxjava', 'reactivex']
websiteUrl = 'https://github.com/ReactiveX/RxAndroid/'
issueTrackerUrl = 'https://github.com/ReactiveX/RxAndroid/issues'
vcsUrl = 'https://github.com/ReactiveX/RxAndroid.git'
}
}
if (project.hasProperty('bintrayUser') && project.hasProperty('bintrayKey')) {
bintray.user = project.bintrayUser
bintray.key = project.bintrayKey
}
if (project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')) {
def sync = bintray.pkg.version.mavenCentralSync
sync.sync = true
sync.user = project.sonatypeUsername
sync.password = project.sonatypePassword
}