@@ -10,7 +10,7 @@ android {
1010 minSdkVersion 21
1111 targetSdkVersion 35
1212 versionCode 1
13- versionName " 4.0.11 "
13+ versionName " 4.0.12 "
1414 }
1515
1616 compileOptions {
@@ -26,48 +26,37 @@ android {
2626
2727dependencies {
2828 implementation ' androidx.core:core:1.3.1'
29- // we embed pdfium (fat-aar) — on JitPack we publish pdfium first to mavenLocal
30- embed project(path : ' :pdfium' , configuration : ' default' )
29+ embed project(' :pdfium' )
3130}
3231
3332afterEvaluate {
34- // keep task wiring for fat-aar if needed
35- def debugEmbedTask = tasks. findByName(' explodeCom.github.marain87Pdfium-debug.aarDebug' )
36- def releaseEmbedTask = tasks. findByName(' explodeCom.github.marain87Pdfium-release.aarRelease' )
33+ // Task dependencies for fat-aar
34+ tasks. findByName(' extractDeepLinksDebug ' ) ?. dependsOn(tasks . findByName( ' explodeCom.github.marain87Pdfium-debug.aarDebug' ) )
35+ tasks. findByName(' extractDeepLinksRelease ' ) ?. dependsOn(tasks . findByName( ' explodeCom.github.marain87Pdfium-release.aarRelease' ) )
3736
38- if (debugEmbedTask) {
39- tasks. named(' extractDeepLinksDebug' ). configure {
40- dependsOn(debugEmbedTask)
41- }
42- }
43- if (releaseEmbedTask) {
44- tasks. named(' extractDeepLinksRelease' ). configure {
45- dependsOn(releaseEmbedTask)
46- }
37+ // Create AAR artifact lazily
38+ def aarFile = file(" $buildDir /outputs/aar/${ project.name} -release.aar" )
39+
40+ // Register the artifact without checking existence during configuration
41+ def aarArtifact = artifacts. add(' archives' , aarFile) {
42+ type ' aar'
43+ builtBy ' assembleRelease'
4744 }
4845
49- // Robust publishing: pick the assembled *.aar from build/outputs/aar and publish that file
46+ // Publishing configuration
5047 publishing {
5148 publications {
5249 aar(MavenPublication ) {
5350 groupId = ' com.github.T-Pro'
5451 artifactId = ' AndroidPdfViewer'
55- version = ' 4.0.11 '
52+ version = ' 4.0.12 '
5653
57- def aarDir = file(" $buildDir /outputs/aar" )
58- def aarFiles = fileTree(dir : aarDir). matching { include(' *.aar' ) }. files
59- if (aarFiles. isEmpty()) {
60- throw new GradleException (" No AAR found in ${ aarDir} . Run :${ project.path} :assembleRelease first." )
61- }
62- def aarFile = aarFiles. iterator(). next()
63- println " Publishing AAR file: ${ aarFile} "
64- artifact(aarFile)
54+ // Use the lazy artifact
55+ artifact aarArtifact
6556 }
6657 }
67-
6858 repositories {
69- // publish to the JitPack container's local maven repo during CI build
7059 mavenLocal()
7160 }
7261 }
73- }
62+ }
0 commit comments