-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmaven-publish-helper.gradle
97 lines (87 loc) · 3.57 KB
/
maven-publish-helper.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
/**
* Maven Publish Helper
*
* Requires Android Gradle plugin 3.6.0 or higher (available since Android Studio 3.6).
* See also: https://developer.android.com/studio/build/maven-publish-plugin
*
* @Author Robert Pösel
* @Version 1.5
* @Date 3.3.2020
*/
apply plugin: 'maven-publish'
apply plugin: 'signing'
task androidJavadocs(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'
}
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
archiveClassifier.set('javadoc')
from androidJavadocs.destinationDir
}
task androidSourcesJar(type: Jar) {
archiveClassifier.set('sources')
from android.sourceSets.main.java.srcDirs
}
// Because the components are created only during the afterEvaluate phase, you must
// configure your publications using the afterEvaluate() lifecycle method.
afterEvaluate {
publishing {
publications {
// Creates a Maven publication called "release".
release(MavenPublication) {
// Temporarily override the artifactId until it is corrected in the project
artifactId "substrate-sdk-android"
// Applies the component for the release build variant.
from components.release
// Adds javadocs and sources as separate jars.
// artifact androidJavadocsJar
artifact androidSourcesJar
// You can customize attributes of the publication here or in module's build.gradle file.
//groupId = 'com.example'
artifactId = 'substrate-sdk-android'
version = android.defaultConfig.versionName // or just '1.0'
pom {
signing {
sign publishing.publications.release
sign configurations.archives
}
name = "substrate-sdk-android"
description = "Nova Substrate SDK is a native Android library to help developers build native mobile apps for Substrate-based networks, e.g. Polkadot, Kusama & parachains"
url = "https://github.com/nova-wallet/substrate-sdk-android"
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
scm {
connection = "scm:git:https://github.com/nova-wallet/substrate-sdk-android.git"
developerConnection = "scm:git:https://github.com/nova-wallet/substrate-sdk-android.git"
url = "https://github.com/nova-wallet/substrate-sdk-android"
}
developers {
developer {
id = "valentun"
name = "Valentun Sergeev"
email = "[email protected]"
}
}
}
}
}
repositories {
maven {
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
}
}