Skip to content

Commit 81ae29e

Browse files
committed
Migrate to MavenCentral from Bintray
1 parent d243b39 commit 81ae29e

File tree

6 files changed

+146
-125
lines changed

6 files changed

+146
-125
lines changed

README.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

2-
# Looking for new maintainer!
2+
#### This is a fork of the [AndroidPdfViewerV1](https://github.com/barteksc/AndroidPdfViewerV1)
3+
switch back to the mainline repo when it gets migrated off JCenter
34

45

56
# Android PdfViewer
@@ -37,13 +38,17 @@ Licensed under Apache License 2.0.
3738

3839
Add to _build.gradle_:
3940

40-
`implementation 'com.github.barteksc:android-pdf-viewer:3.2.0-beta.1'`
41-
42-
or if you want to use more stable version:
43-
44-
`implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'`
41+
```groovy
42+
allprojects {
43+
repositories {
44+
...
45+
mavenCentral()
46+
...
47+
}
48+
}
49+
```
4550

46-
Library is available in jcenter repository, probably it'll be in Maven Central soon.
51+
`implementation 'com.github.mhiew:android-pdf-viewer:3.2.0-beta.1'`
4752

4853
## ProGuard
4954
If you are using ProGuard, add following rule to proguard config file:

android-pdf-viewer/bintray.gradle

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

android-pdf-viewer/build.gradle

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,5 @@
11
apply plugin: 'com.android.library'
22

3-
ext {
4-
bintrayRepo = 'maven'
5-
bintrayName = 'android-pdf-viewer'
6-
7-
publishedGroupId = 'com.github.barteksc'
8-
libraryName = 'AndroidPdfViewer'
9-
artifact = 'android-pdf-viewer'
10-
11-
libraryDescription = 'Android view for displaying PDFs rendered with PdfiumAndroid'
12-
13-
siteUrl = 'https://github.com/barteksc/AndroidPdfViewer'
14-
gitUrl = 'https://github.com/barteksc/AndroidPdfViewer.git'
15-
16-
libraryVersion = '3.2.0-beta.1'
17-
18-
developerId = 'barteksc'
19-
developerName = 'Bartosz Schiller'
20-
developerEmail = '[email protected]'
21-
22-
licenseName = 'The Apache Software License, Version 2.0'
23-
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
24-
allLicenses = ["Apache-2.0"]
25-
}
26-
273
android {
284
compileSdkVersion 28
295

@@ -41,4 +17,11 @@ dependencies {
4117
api 'com.github.barteksc:pdfium-android:1.9.0'
4218
}
4319

44-
apply from: 'bintray.gradle'
20+
// Maven Publishing
21+
ext {
22+
PUBLISH_GROUP_ID = 'com.github.mhiew'
23+
PUBLISH_VERSION = '3.2.0-beta.1'
24+
PUBLISH_ARTIFACT_ID = 'android-pdf-viewer'
25+
}
26+
27+
apply from: "${rootProject.projectDir}/android-pdf-viewer/publish-mavencentral.gradle"
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
apply plugin: 'maven-publish'
2+
apply plugin: 'signing'
3+
4+
def isAndroid = plugins.hasPlugin('com.android.library')
5+
6+
task sourcesJar(type: Jar) {
7+
archiveClassifier.set('sources')
8+
if (isAndroid) {
9+
from android.sourceSets.main.java.srcDirs
10+
} else {
11+
from sourceSets.main.allSource
12+
}
13+
}
14+
15+
task javadoc(type: Javadoc) {
16+
source = android.sourceSets.main.java.srcDirs
17+
options.addStringOption('Xdoclint:none', '-quiet')
18+
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
19+
}
20+
21+
afterEvaluate {
22+
javadoc.classpath += files(android.libraryVariants.collect { variant ->
23+
variant.javaCompileProvider.get().classpath.files
24+
})
25+
}
26+
27+
task javadocJar(type: Jar, dependsOn: javadoc) {
28+
archiveClassifier.set('javadoc')
29+
from javadoc.destinationDir
30+
}
31+
32+
artifacts {
33+
archives sourcesJar
34+
archives javadocJar
35+
}
36+
37+
group = PUBLISH_GROUP_ID
38+
version = PUBLISH_VERSION
39+
40+
ext["signing.keyId"] = ''
41+
ext["signing.password"] = ''
42+
ext["signing.secretKeyRingFile"] = ''
43+
ext["ossrhUsername"] = ''
44+
ext["ossrhPassword"] = ''
45+
ext["sonatypeStagingProfileId"] = ''
46+
47+
File secretPropsFile = project.rootProject.file('local.properties')
48+
if (secretPropsFile.exists()) {
49+
Properties p = new Properties()
50+
p.load(new FileInputStream(secretPropsFile))
51+
p.each { name, value ->
52+
ext[name] = value
53+
}
54+
} else {
55+
ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID')
56+
ext["signing.password"] = System.getenv('SIGNING_PASSWORD')
57+
ext["signing.secretKeyRingFile"] = System.getenv('SIGNING_SECRET_KEY_RING_FILE')
58+
ext["ossrhUsername"] = System.getenv('OSSRH_USERNAME')
59+
ext["ossrhPassword"] = System.getenv('OSSRH_PASSWORD')
60+
ext["sonatypeStagingProfileId"] = System.getenv('SONATYPE_STAGING_PROFILE_ID')
61+
}
62+
63+
afterEvaluate {
64+
publishing {
65+
publications {
66+
release(MavenPublication) {
67+
if (isAndroid) {
68+
from components.release
69+
} else {
70+
from components.java
71+
}
72+
artifact sourcesJar
73+
artifact javadocJar
74+
75+
// Set within Library Gradle
76+
groupId PUBLISH_GROUP_ID
77+
artifactId PUBLISH_ARTIFACT_ID
78+
version PUBLISH_VERSION
79+
80+
pom {
81+
name = PUBLISH_ARTIFACT_ID
82+
description = 'Fork of Barteksc AndroidPdfViewer - Android view for displaying PDFs rendered with PdfiumAndroid'
83+
url = 'https://github.com/mhiew/AndroidPdfViewer'
84+
licenses {
85+
license {
86+
name = 'The Apache License, Version 2.0'
87+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
88+
}
89+
}
90+
developers {
91+
developer {
92+
id = 'min'
93+
name = 'Min Hiew'
94+
}
95+
}
96+
scm {
97+
connection = 'scm:git:https://github.com/mhiew/AndroidPdfViewer'
98+
developerConnection = 'scm:git:ssh:github.com:mhiew/AndroidPdfViewer.git'
99+
url = 'https://github.com/mhiew/AndroidPdfViewer'
100+
}
101+
}
102+
}
103+
}
104+
// The repository to publish to, Sonatype/MavenCentral
105+
repositories {
106+
maven {
107+
// This is an arbitrary name, you may also use "mavencentral" or
108+
// any other name that's descriptive for you
109+
name = "sonatype"
110+
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
111+
credentials {
112+
username ossrhUsername
113+
password ossrhPassword
114+
}
115+
}
116+
}
117+
}
118+
}
119+
120+
signing {
121+
sign publishing.publications
122+
}

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
buildscript {
33
repositories {
44
google()
5+
mavenCentral()
56
jcenter()
67
}
78
dependencies {
8-
classpath 'com.android.tools.build:gradle:3.4.2'
9-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
10-
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
9+
classpath 'com.android.tools.build:gradle:4.1.2'
1110
}
1211
}
1312

1413
allprojects {
1514
repositories {
1615
google()
16+
mavenCentral()
1717
jcenter()
1818
}
1919
}

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip

0 commit comments

Comments
 (0)