-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbintray.gradle
95 lines (85 loc) · 2.59 KB
/
bintray.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
def getBintrayInformation = { propertyFilePath ->
def propertiesFile = file(propertyFilePath)
if (!propertiesFile.exists()) {
logger.warn("Bintray properties file not found, path=${propertiesFile.absolutePath}")
return
}
def Properties properties = new Properties()
properties.load(new FileInputStream(propertiesFile))
return [
user : properties["bintray_user"],
apiKey: properties["bintray_api_key"],
]
}
install {
repositories.mavenInstaller {
pom.project {
packaging 'aar'
groupId project.ext.applicationId
artifactId project.ext.PUBLISH_ARTIFACT_ID
version project.ext.librariesVersion
name project.ext.PUBLISH_ARTIFACT_ID
url project.ext.websiteUrl
inceptionYear '2017'
licenses {
license {
name 'Apache-2.0'
url 'https://github.com/xmartlabs/bigbang/blob/master/LICENSE'
distribution 'repo'
}
}
scm {
connection project.ext.vcsUrl
developerConnection project.ext.vcsUrl
url project.ext.websiteUrl
}
}
}
}
bintray {
def bintrayInfo = getBintrayInformation("../bintray.properties")
if (bintrayInfo == null) {
return
}
user = bintrayInfo.user
key = bintrayInfo.apiKey
pkg {
repo = 'Android-Base-Project'
name = "${project.ext.projectName}"
userOrg = 'xmartlabs'
version {
name = project.ext.versionCodeNumber
released = new Date()
vcsTag = "${project.ext.versionCodeNumber}"
}
licenses = ['Apache-2.0']
vcsUrl = "${project.ext.vcsUrl}"
websiteUrl = "${project.ext.websiteUrl}"
}
configurations = ['archives']
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
options.linkSource true
classpath = configurations.compile
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
android.libraryVariants.all { variant ->
if (variant.name == 'release') {
owner.classpath += variant.javaCompile.classpath
}
}
failOnError false
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
javadocJar.dependsOn javadoc
artifacts {
archives javadocJar
archives sourcesJar
}