comparison mupdf-source/thirdparty/zxing-cpp/wrappers/android/zxingcpp/build.gradle.kts @ 2:b50eed0cc0ef upstream

ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4. The directory name has changed: no version number in the expanded directory now.
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 15 Sep 2025 11:43:07 +0200
parents
children
comparison
equal deleted inserted replaced
1:1d09e1dec1d9 2:b50eed0cc0ef
1 plugins {
2 alias(libs.plugins.android.library)
3 alias(libs.plugins.kotlin.android)
4 id("maven-publish")
5 id("signing")
6 }
7
8 android {
9 namespace = "zxingcpp.lib" // used to be just zxingcpp but needs to contain a '.' in release builds
10 // ndk version 27 has sufficient c++20 support to enable all features (see #386)
11 // ndkVersion = "27.0.12077973"
12
13 defaultConfig {
14 compileSdk = libs.versions.androidCompileSdk.get().toInt()
15 minSdk = libs.versions.androidMinSdk.get().toInt()
16
17 ndk {
18 // speed up build: compile only arm versions
19 // abiFilters += listOf("armeabi-v7a", "arm64-v8a")
20 }
21 externalNativeBuild {
22 cmake {
23 arguments(
24 "-DCMAKE_BUILD_TYPE=RelWithDebInfo",
25 "-DANDROID_ARM_NEON=ON",
26 "-DZXING_WRITERS=OFF",
27 "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON" // This flag can be removed when NDK 28 is the default version
28 )
29 }
30 }
31
32 consumerProguardFiles("consumer-rules.pro")
33 }
34 compileOptions {
35 sourceCompatibility(JavaVersion.VERSION_1_8)
36 targetCompatibility(JavaVersion.VERSION_1_8)
37 }
38 kotlinOptions {
39 jvmTarget = "1.8"
40 }
41 externalNativeBuild {
42 cmake {
43 path(file("src/main/cpp/CMakeLists.txt"))
44 }
45 }
46 lint {
47 disable.add("UnsafeExperimentalUsageError")
48 }
49 }
50
51 kotlin {
52 explicitApi()
53 }
54
55 dependencies {
56 implementation(libs.androidx.camera.core)
57 }
58
59 val publishSnapshot: String? by project
60 group = "io.github.zxing-cpp"
61 version = "2.3.0" + if (publishSnapshot == "true") "-SNAPSHOT" else ""
62
63 val javadocJar by tasks.registering(Jar::class) {
64 archiveClassifier.set("javadoc")
65 }
66
67 publishing {
68 publications {
69 register<MavenPublication>("release") {
70 artifactId = "android"
71 groupId = project.group.toString()
72 version = project.version.toString()
73
74 afterEvaluate {
75 from(components["release"])
76 }
77
78 artifact(javadocJar.get())
79
80 pom {
81 name = "zxing-cpp"
82 description = "Wrapper for zxing-cpp barcode image processing library"
83 url = "https://github.com/zxing-cpp/zxing-cpp"
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 = "zxing-cpp"
93 name = "zxing-cpp community"
94 email = "zxingcpp@gmail.com"
95 }
96 }
97 scm {
98 connection = "scm:git:git://github.com/zxing-cpp/zxing-cpp.git"
99 developerConnection = "scm:git:git://github.com/zxing-cpp/zxing-cpp.git"
100 url = "https://github.com/zxing-cpp/zxing-cpp"
101 }
102 }
103 }
104 }
105 repositories {
106 maven {
107 name = "sonatype"
108
109 val releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
110 val snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
111 setUrl(if (version.toString().endsWith("-SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl)
112
113 credentials {
114 val ossrhUsername: String? by project
115 val ossrhPassword: String? by project
116 username = ossrhUsername
117 password = ossrhPassword
118 }
119 }
120 }
121 }
122
123 signing {
124 setRequired {
125 // signing is required if the artifacts are to be published
126 gradle.taskGraph.allTasks.any { it is PublishToMavenRepository }
127 }
128 val signingKey: String? by project
129 val signingPassword: String? by project
130 useInMemoryPgpKeys(signingKey, signingPassword)
131 sign(publishing.publications)
132 }