-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpublish.gradle
114 lines (95 loc) · 3.76 KB
/
publish.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
ext["signing.keyId"] = ''
ext["signing.password"] = ''
ext["signing.secretKeyRingFile"] = ''
ext["ossrhUsername"] = ''
ext["ossrhPassword"] = ''
ext["sonatypeStagingProfileId"] = ''
File secretPropsFile = project.rootProject.file('local.properties')
Properties p = new Properties()
new FileInputStream(secretPropsFile).withCloseable { is -> p.load(is) }
p.each { name, value -> ext[name] = value }
task androidJavadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
android.libraryVariants.all { variant ->
if (variant.name == 'release') {
owner.classpath += variant.javaCompileProvider.get().classpath
}
}
exclude '**/R.html', '**/R.*.html', '**/index.html', '**/*.kt'
options.encoding 'utf-8'
options {
addStringOption 'docencoding', 'utf-8'
addStringOption 'charset', 'utf-8'
links 'https://docs.oracle.com/javase/7/docs/api/'
links 'https://d.android.com/reference'
links 'https://developer.android.com/reference/androidx/'
}
}
task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
archiveClassifier.set('javadoc')
from androidJavadoc.destinationDir
preserveFileTimestamps = false
reproducibleFileOrder = true
}
task javaSourcesJar(type: Jar) {
archiveClassifier.set('sources')
from android.sourceSets.main.java.srcDirs
preserveFileTimestamps = false
reproducibleFileOrder = true
}
afterEvaluate {
publishing {
publications {
maven(MavenPublication) {
groupId = PUBLISH_GROUP_ID
artifactId = PUBLISH_ARTIFACT_ID
version = globalVersionName
pom {
name = 'Android-Smart-Rate'
description = 'Smart rate library for Android written with Koltin, RxJava 2, Dagger 2 and Moxy MVP'
url = 'https://github.com/RankoR/android-smart-rate'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'integer_32'
name = 'Artem Smirnov'
email = '[email protected]'
url = 'https://labster.pro'
}
}
scm {
connection = 'scm:git:[email protected]:RankoR/android-smart-rate.git'
developerConnection = 'scm:git:[email protected]:RankoR/android-smart-rate.git'
url = 'https://github.com/RankoR/android-smart-rate'
}
}
artifact androidJavadocJar
artifact javaSourcesJar
from components.release
}
}
Properties localProperties = new Properties()
localProperties.load(project.rootProject.file("local.properties").newDataInputStream())
repositories {
maven {
name = "sonatype"
def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username ossrhUsername
password ossrhPassword
}
}
}
}
}
signing {
sign publishing.publications
}