Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update project #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 0 additions & 103 deletions build.gradle

This file was deleted.

120 changes: 120 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
buildscript {

extra.apply {
set("libMinSdk", 21)
set("libCompileSdk", 34)
set("libTargetSdk", 34)

set("libGroupId", "com.github.infomaniak")
set("libVersionName", "1.9.6")
set("libArtifactId", "pdfiumandroid")
set("ndkVersion", "26.1.10909125")
set("javaVersion", JavaVersion.VERSION_17)
}
}

plugins {
alias(libs.plugins.androidLibrary)
id("maven-publish")
}

val libMinSdk: Int by rootProject.extra
val libCompileSdk: Int by rootProject.extra
val libTargetSdk: Int by rootProject.extra

val libGroupId: String by rootProject.extra
val libVersionName: String by rootProject.extra
val libArtifactId: String by rootProject.extra
val ndkVersion: String by rootProject.extra
val javaVersion: JavaVersion by rootProject.extra

android {
namespace = "com.shockwave.pdfium"
compileSdk = libCompileSdk
ndkVersion = ndkVersion

externalNativeBuild {
ndkBuild {
path = File("src/main/jni/Android.mk")
}
}

packaging {
resources {
jniLibs.pickFirsts.addAll(
listOf(
"lib/armeabi-v7a/libc++_shared.so",
"lib/arm64-v8a/libc++_shared.so",
"lib/x86_64/libc++_shared.so",
"lib/x86/libc++_shared.so",

"lib/armeabi-v7a/libjniPdfium.so",
"lib/arm64-v8a/libjniPdfium.so",
"lib/x86_64/libjniPdfium.so",
"lib/x86/libjniPdfium.so",

"lib/armeabi-v7a/libmodpdfium.so",
"lib/arm64-v8a/libmodpdfium.so",
"lib/x86_64/libmodpdfium.so",
"lib/x86/libmodpdfium.so"
)
)
}
}

defaultConfig {
minSdk = libMinSdk
targetSdk = libTargetSdk
}

buildTypes {
release {
isMinifyEnabled = false

proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}

publishing {
singleVariant("release") {
withSourcesJar()
withJavadocJar()
}
}

compileOptions {
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}

buildFeatures {
buildConfig = true
}
}

repositories {
google()
mavenLocal() // TODO to comment
mavenCentral()
}

dependencies {
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
implementation(libs.collection)
}

afterEvaluate {
publishing {
publications {
create<MavenPublication>("release") {
from(components.findByName("release")!!)
groupId = libGroupId
artifactId = libArtifactId
version = libVersionName
}
}
}
}
9 changes: 9 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[versions]
agp = "8.6.1"
collection = "1.3.0"

[libraries]
collection = { module = "androidx.collection:collection", version.ref = "collection" }

[plugins]
androidLibrary = { id = "com.android.library", version.ref = "agp" }
6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat May 21 18:52:48 EDT 2022
#Thu Feb 27 10:37:59 CET 2025
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
15 changes: 15 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

dependencyResolutionManagement {
@Suppress("UnstableApiUsage")
repositories {
google()
mavenCentral()
}
}
1 change: 0 additions & 1 deletion src/main/java/com/shockwave/pdfium/PdfiumCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ public static int getNumFd(ParcelFileDescriptor fdObj) {
/** Context needed to get screen density */
public PdfiumCore(Context ctx) {
mCurrentDpi = ctx.getResources().getDisplayMetrics().densityDpi;
Log.d(TAG, "Starting PdfiumAndroid " + BuildConfig.LIBRARY_VERSION_NAME);
}

/** Create new document from file */
Expand Down