-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathbintray.gradle
99 lines (88 loc) · 3.15 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
96
97
98
99
import java.text.SimpleDateFormat
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: "com.jfrog.bintray"
def siteUrl = 'https://github.com/Piasy/HandyWidgets'
def gitUrl = 'https://github.com/Piasy/HandyWidgets.git'
group = rootProject.ext.groupName
version = rootProject.ext.releaseVersionName
install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'
// Add your description here
name 'Handy Android widgets.'
url siteUrl
// Set your license
licenses {
license {
name 'The MIT License (MIT)'
url 'http://opensource.org/licenses/MIT'
}
}
developers {
developer {
id 'piasy'
name 'piasy'
email '[email protected]'
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
android.compileSdkVersion rootProject.ext.androidCompileSdkVersion
android.buildToolsVersion rootProject.ext.androidBuildToolsVersion
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocJar
archives sourcesJar
}
Properties properties = new Properties()
// for wrapper project structure
File propertyFile = project.rootProject.file('bintray.properties')
if (!propertyFile.exists()) {
propertyFile = project.rootProject.file("HandyWidgets${File.separator}bintray.properties")
}
properties.load(propertyFile.newDataInputStream())
bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")
configurations = ['archives'] //When uploading Maven-based publication files
dryRun = false //Whether to run this as dry-run, without deploying
publish = true //If version should be auto published after an upload
pkg {
repo = 'maven'
name = 'HandyWidgets'
desc = 'Handy Android widgets. '
websiteUrl = siteUrl
issueTrackerUrl = siteUrl + '/issues'
vcsUrl = gitUrl
licenses = ['MIT']
labels = ['widgets', 'android']
publicDownloadNumbers = true
//Optional version descriptor
version {
name = rootProject.ext.releaseVersionName //Bintray logical version name
released = new SimpleDateFormat('yyyy-MM-dd\'T\'HH:mm:ss.SSSZZ').format(new Date()) //2 possible values: date in the format of 'yyyy-MM-dd'T'HH:mm:ss.SSSZZ' OR a java.util.Date instance
vcsTag = rootProject.ext.releaseVersionName
}
}
}