Skip to content

Commit 893b716

Browse files
committed
Add Maven publishing configuration for JitPack support
- Registered a root-level task to publish to Maven local - Configured Maven publishing in the android-pdf-viewer module with sources JAR and POM details - Set group and version properties for the publication
1 parent e34d32b commit 893b716

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

android-pdf-viewer/build.gradle

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: 'com.android.library'
2+
apply plugin: 'maven-publish'
23

34
ext {
45
bintrayRepo = 'maven'
@@ -63,3 +64,39 @@ dependencies {
6364
api 'io.github.oothp:pdfium-android:1.9.5-beta01'
6465
}
6566

67+
// Configure Maven publishing for JitPack
68+
group = project.findProperty("group") ?: "com.github.xposed73"
69+
version = project.findProperty("version") ?: "1.0.0"
70+
71+
def androidSourcesJar = tasks.register('androidSourcesJar', Jar) {
72+
archiveClassifier.set('sources')
73+
from android.sourceSets.main.java.srcDirs
74+
}
75+
76+
afterEvaluate {
77+
publishing {
78+
publications {
79+
release(MavenPublication) {
80+
from components.release
81+
groupId = project.group
82+
artifactId = "AndroidPdfViewer"
83+
version = project.version as String
84+
artifact androidSourcesJar.get()
85+
pom {
86+
name = "AndroidPdfViewer"
87+
description = "Android view for displaying PDFs rendered with PdfiumAndroid"
88+
licenses {
89+
license {
90+
name = "The Apache Software License, Version 2.0"
91+
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
92+
}
93+
}
94+
scm {
95+
url = "https://github.com/xposed73/AndroidPdfViewer"
96+
}
97+
}
98+
}
99+
}
100+
}
101+
}
102+

build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,8 @@ subprojects {
2525
}
2626
}
2727
}
28+
29+
// Ensure a root-level publishToMavenLocal exists for JitPack
30+
tasks.register("publishToMavenLocal") {
31+
dependsOn(subprojects.collect { it.tasks.matching { it.name == "publishToMavenLocal" } })
32+
}

0 commit comments

Comments
 (0)