forked from mikepenz/Android-Iconics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gradle-release.gradle
135 lines (114 loc) · 4.14 KB
/
gradle-release.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
@SuppressWarnings(["GroovyUnusedDeclaration", "GrMethodMayBeStatic"])
def isReleaseBuild() {
return !VERSION_NAME.contains("SNAPSHOT")
}
@SuppressWarnings("GroovyUnusedDeclaration")
def getRepositoryUsername() {
return project.hasProperty('NEXUS_USERNAME') ? project.property('NEXUS_USERNAME') : System.getenv('NEXUS_USERNAME')
}
@SuppressWarnings("GroovyUnusedDeclaration")
def getRepositoryPassword() {
return project.hasProperty('NEXUS_PASSWORD') ? project.property('NEXUS_PASSWORD') : System.getenv('NEXUS_PASSWORD')
}
apply plugin: "com.jfrog.bintray"
afterEvaluate { project ->
apply plugin: 'maven-publish'
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
task androidJavadocs(type: Javadoc) {
failOnError = false
source = android.sourceSets.main.java.source
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
classifier = 'javadoc'
from androidJavadocs.destinationDir
}
task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.source
}
bintray {
dryRun = false
publish = true
override = true
user = project.hasProperty('bintray.user') ? project.property('bintray.user') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintray.apikey') ? project.property('bintray.apikey') : System.getenv('BINTRAY_API_KEY')
def gpgkey = project.hasProperty('bintray.gpg.key') ? project.property('bintray.gpg.key') : System.getenv('BINTRAY_GPG_KEY')
def gpgpass = project.hasProperty('bintray.gpg.password') ? project.property('bintray.gpg.password') : System.getenv('BINTRAY_GPG_PASS')
def versionName = android.defaultConfig.versionName
publications('release')
pkg {
publish = true
repo = "maven"
name = GROUP + ":" + POM_ARTIFACT_ID //the name (= identifier) on bintray
desc = POM_DESCRIPTION
websiteUrl = POM_URL
issueTrackerUrl = POM_SCM_URL_ISSUES
vcsUrl = POM_SCM_URL
githubRepo = POM_GITHUB_REPO
githubReleaseNotesFile = POM_GITHUB_README
publicDownloadNumbers = true
licenses = ["Apache-2.0"]
version {
name = versionName
vcsTag = versionName
released = new Date()
mavenCentralSync {
sync = true
user = getRepositoryUsername()
password = getRepositoryPassword()
close = '1'
}
gpg {
sign = true
passphrase = gpgpass
}
}
}
}
def pomConfig = {
licenses {
license {
name POM_LICENCE_NAME
url POM_LICENCE_URL
distribution POM_LICENCE_DIST
}
}
developers {
developer {
id POM_DEVELOPER_ID
name POM_DEVELOPER_NAME
email '[email protected]'
}
}
scm {
url POM_SCM_URL
connection POM_SCM_CONNECTION
developerConnection POM_SCM_DEV_CONNECTION
}
}
publishing {
publications {
release(MavenPublication) {
from components.release
groupId GROUP
artifactId POM_ARTIFACT_ID
version android.defaultConfig.versionName
artifact androidSourcesJar
artifact androidJavadocsJar
pom.withXml {
asNode().appendNode('name', POM_NAME)
asNode().appendNode('description', POM_DESCRIPTION)
asNode().appendNode('url', POM_SCM_URL)
asNode().children().last() + pomConfig
}
}
}
}
}