/
build.gradle
109 lines (96 loc) · 3.33 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
ext {
configuration = [
package : "cortado",
compileVersion : 25,
buildToolsVersion: "25.0.2",
minSdk : 8,
targetSdk : 25,
versionCode : 4,
versionName : "1.2.0"
]
libraries = [
support : "25.1.1",
espresso: "2.2.2"
]
bintrayConfig = [
userOrg : "blipinsk",
userName : "Bartosz Lipinski",
userEmail : "bartoszlipinski90@gmail.com",
groupId : "com.bartoszlipinski",
name : "Cortado",
artifact : "cortado",
description: "Fluent API wrapper for Android Espresso",
website : "https://github.com/blipinsk/Cortado",
gitUrl : "https://github.com/blipinsk/Cortado.git",
licenses : ["Apache-2.0"],
licenseDesc: "The Apache Software License, Version 2.0"
]
bintrayUser = hasProperty("BINTRAY_USERNAME") ? BINTRAY_USERNAME : ""
bintrayKey = hasProperty("BINTRAY_API_KEY") ? BINTRAY_API_KEY : ""
dryRun = 'false'
isUploading = project.getGradle().startParameter.taskNames.any { it.contains('bintrayUpload') }
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.novoda:bintray-release:0.3.4'
// clean build bintrayUpload
}
}
allprojects {
repositories {
jcenter()
}
}
subprojects {
repositories {
jcenter()
}
group = bintrayConfig.groupId
version = configuration.versionName
if (isUploading && project.name in [bintrayConfig.artifact]) {
println project.name
apply plugin: 'maven'
gradle.taskGraph.whenReady { taskGraph ->
taskGraph.getAllTasks().find {
it.path == ":$project.name:generatePomFileForMavenPublication"
}.doLast {
file("build/publications/maven/pom-default.xml").delete()
pom {
//noinspection GroovyAssignabilityCheck
project {
name project.name
artifactId project.name
packaging 'aar'
description bintrayConfig.description
url bintrayConfig.website
version configuration.versionName
scm {
url bintrayConfig.gitUrl
connection bintrayConfig.gitUrl
developerConnection bintrayConfig.gitUrl
}
licenses {
license {
name bintrayConfig.licenseDesc
}
}
developers {
developer {
id bintrayConfig.userOrg
name bintrayConfig.userName
email bintrayConfig.userEmail
}
}
}
}.writeTo("build/publications/maven/pom-default.xml")
}
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}