-
Notifications
You must be signed in to change notification settings - Fork 0
/
deployment.gradle
93 lines (79 loc) · 2.6 KB
/
deployment.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
def packageDesc = 'Implementation of HttpURLConnection, that aims for low GC overhead'
def packageSite = 'https://github.com/Alexander--/chttpc'
def mainLic = 'Apache-2.0'
def libVcs = 'https://github.com/Alexander--/chttpc'
def libVer = '0.2'
def props = new Properties()
def propFile
def propName = project.properties.deploymentConfig
if(propName && (propFile = file(propName)).exists()) {
new FileInputStream(propFile).withStream { InputStream is ->
props.load(is)
}
}
if (props) {
task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
def pomXmlContents = new XmlParser().parseText """
<dependencies>
<dependency>
<groupId>com.android.support</groupId>
<artifactId>support-annotations</artifactId>
<version>25.1.0</version>
<scope>compile</scope>
<optional>false</optional>
</dependency>
<dependency>
<groupId>net.sf.xfd</groupId>
<artifactId>i10n</artifactId>
<version>0.3.1</version>
<scope>compile</scope>
<optional>false</optional>
</dependency>
</dependencies>
"""
publishing {
publications {
chttpc(MavenPublication) {
artifact ([
source: file("$rootProject.projectDir/release-compressed.aar"),
extension: 'aar',
])
artifact androidSourcesJar
groupId 'net.sf.chttpc'
artifactId 'chttpc'
version libVer
pom.withXml { provider ->
provider.asNode().append(pomXmlContents)
}
}
}
}
bintray {
user = props['bintrayUser']
key = props['bintrayKey']
publications = ['chttpc']
pkg {
repo = 'maven'
name = 'chttpc'
desc = packageDesc
websiteUrl = packageSite
issueTrackerUrl = 'https://github.com/Alexander--/chttpc/issues'
vcsUrl = libVcs
licenses = [mainLic]
labels = ['android', 'http']
publicDownloadNumbers = true
githubRepo = 'Alexander--/chttpc'
version {
name = libVer
vcsTag = "${name}"
}
publish = false
}
}
tasks.bintrayUpload.dependsOn tasks.prepareRelease
}