Skip to content

Commit 778ad72

Browse files
committed
Update build configuration and README for JitPack publishing
- Modified the root-level task to depend on the specific publication task for the android-pdf-viewer module. - Updated the dependency version in README to 1.0.1 and added detailed instructions for publishing via JitPack. - Configured the android-pdf-viewer module to produce a sources JAR during publishing.
1 parent 9721ddc commit 778ad72

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,16 @@ dependencyResolutionManagement {
2525
2) Add the dependency:
2626

2727
```gradle
28-
implementation 'com.github.xposed73:AndroidPdfViewer:1.0.0'
28+
implementation 'com.github.xposed73:AndroidPdfViewer:1.0.1'
2929
```
30+
31+
## Publish (quickest: JitPack)
32+
33+
1) Push this project to a public GitHub repo under your account.
34+
2) Create a release tag (example: `v1.0.1`).
35+
3) Visit `https://jitpack.io/#xposed73/AndroidPdfViewer` and trigger a build for the tag.
36+
4) Consumers can then use the dependency shown above.
37+
38+
Notes:
39+
- If JitPack needs a specific JDK/Gradle, add a `jitpack.yml` with your settings.
40+
- Keep tags semantic (e.g., `v1.0.2`) to publish updates.

android-pdf-viewer/build.gradle

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ android {
5757
abortOnError false
5858
}
5959

60+
publishing {
61+
singleVariant('release') {
62+
withSourcesJar()
63+
}
64+
}
6065
}
6166

6267
dependencies {
@@ -68,10 +73,7 @@ dependencies {
6873
group = project.findProperty("group") ?: "com.github.xposed73"
6974
version = project.findProperty("version") ?: "1.0.0"
7075

71-
def androidSourcesJar = tasks.register('androidSourcesJar', Jar) {
72-
archiveClassifier.set('sources')
73-
from android.sourceSets.main.java.srcDirs
74-
}
76+
// sources jar is produced via android.publishing.singleVariant.withSourcesJar()
7577

7678
afterEvaluate {
7779
publishing {
@@ -81,7 +83,6 @@ afterEvaluate {
8183
groupId = project.group
8284
artifactId = "AndroidPdfViewer"
8385
version = project.version as String
84-
artifact androidSourcesJar.get()
8586
pom {
8687
name = "AndroidPdfViewer"
8788
description = "Android view for displaying PDFs rendered with PdfiumAndroid"

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ subprojects {
2828

2929
// Ensure a root-level publishToMavenLocal exists for JitPack
3030
tasks.register("publishToMavenLocal") {
31-
dependsOn(subprojects.collect { it.tasks.matching { it.name == "publishToMavenLocal" } })
31+
dependsOn(":android-pdf-viewer:publishReleasePublicationToMavenLocal")
3232
}

0 commit comments

Comments
 (0)