Skip to content

Commit 7cb6d07

Browse files
committed
Add maven-publish.gradle, upload aar to maven central.
1 parent 8e8f35a commit 7cb6d07

File tree

6 files changed

+95
-121
lines changed

6 files changed

+95
-121
lines changed

andlinker/bintray.gradle

Lines changed: 0 additions & 58 deletions
This file was deleted.

andlinker/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,4 @@ dependencies {
2525
}
2626

2727
apply from: 'properties.gradle'
28-
apply from: 'install.gradle'
29-
apply from: 'bintray.gradle'
28+
apply from: 'maven-publish.gradle'

andlinker/install.gradle

Lines changed: 0 additions & 44 deletions
This file was deleted.

andlinker/maven-publish.gradle

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
apply plugin: 'maven'
2+
apply plugin: 'signing'
3+
4+
// Android libraries
5+
task sourcesJar(type: Jar) {
6+
classifier = 'sources'
7+
from android.sourceSets.main.java.srcDirs
8+
}
9+
10+
task javadoc(type: Javadoc) {
11+
// https://github.com/novoda/bintray-release/issues/71
12+
excludes = ['**/*.kt'] // < ---- Exclude all kotlin files from javadoc file.
13+
source = android.sourceSets.main.java.srcDirs
14+
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
15+
options.encoding = "UTF-8"
16+
options.charSet = "UTF-8"
17+
}
18+
19+
tasks.withType(JavaCompile) {
20+
options.encoding = "UTF-8"
21+
}
22+
23+
tasks.withType(Javadoc) {
24+
options.encoding = "UTF-8"
25+
}
26+
27+
task javadocJar(type: Jar, dependsOn: javadoc) {
28+
classifier = 'javadoc'
29+
from javadoc.destinationDir
30+
}
31+
32+
// Add javadoc/source jar tasks as artifacts
33+
artifacts {
34+
archives javadocJar
35+
archives sourcesJar
36+
}
37+
38+
// Signing artifacts
39+
signing {
40+
required { gradle.taskGraph.hasTask("uploadArchives") }
41+
sign configurations.archives
42+
}
43+
44+
uploadArchives {
45+
repositories {
46+
mavenDeployer {
47+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
48+
49+
repository(url: "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") {
50+
authentication(userName: ossrhUsername, password: ossrhPassword)
51+
}
52+
53+
snapshotRepository(url: "https://s01.oss.sonatype.org/content/repositories/snapshots/") {
54+
authentication(userName: ossrhUsername, password: ossrhPassword)
55+
}
56+
57+
pom.groupId = publishedGroupId
58+
pom.artifactId = artifact
59+
pom.version = libraryVersion
60+
61+
pom.project {
62+
packaging 'aar'
63+
64+
name libraryName
65+
description libraryDescription
66+
url siteUrl
67+
68+
scm {
69+
connection gitUrl
70+
developerConnection gitUrl
71+
url siteUrl
72+
}
73+
74+
licenses {
75+
license {
76+
name licenseName
77+
url licenseUrl
78+
}
79+
}
80+
81+
developers {
82+
developer {
83+
id developerId
84+
name developerName
85+
email developerEmail
86+
}
87+
}
88+
}
89+
}
90+
}
91+
}

andlinker/properties.gradle

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
ext {
2-
bintrayRepo = 'maven'
3-
bintrayName = 'and-linker'
4-
52
publishedGroupId = 'com.codezjx.library'
6-
libraryName = 'AndLinker'
73
artifact = 'andlinker'
8-
4+
libraryVersion = '0.8.0'
5+
6+
libraryName = 'AndLinker'
97
libraryDescription = 'AndLinker is a IPC library for Android, which combines the features of AIDL and Retrofit. Allows IPC call seamlessly compose with rxjava and rxjava2 call adapters.'
108

119
siteUrl = 'https://github.com/codezjx/AndLinker'
1210
gitUrl = 'https://github.com/codezjx/AndLinker.git'
1311

14-
libraryVersion = '0.7.2'
15-
1612
developerId = 'codezjx'
1713
developerName = 'codezjx'
1814
developerEmail = '[email protected]'

build.gradle

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ buildscript {
88
}
99
dependencies {
1010
classpath 'com.android.tools.build:gradle:3.4.2'
11-
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
12-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.1'
13-
1411

1512
// NOTE: Do not place your application dependencies here; they belong
1613
// in the individual module build.gradle files
@@ -22,13 +19,6 @@ allprojects {
2219
google()
2320
jcenter()
2421
}
25-
26-
tasks.withType(Javadoc) {
27-
options.encoding = 'UTF-8'
28-
if (JavaVersion.current().isJava8Compatible()) {
29-
options.addStringOption('Xdoclint:none', '-quiet')
30-
}
31-
}
3222
}
3323

3424
task clean(type: Delete) {

0 commit comments

Comments
 (0)