-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathbuild.gradle
More file actions
149 lines (133 loc) · 4.74 KB
/
build.gradle
File metadata and controls
149 lines (133 loc) · 4.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/*
* pdf2htmlEX/build.gradle
*
* pdf2htmlEX-Android (https://github.com/opendocument-app/pdf2htmlEX-Android)
* pdf2htmlEX library port for Android - Convert PDF to HTML without losing text or format.
*
* Copyright (c) 2019 - 2024 ViliusSutkus89.com
*
* pdf2htmlEX-Android is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* pdf2htmlEX-Android is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
plugins {
id 'com.android.library'
id 'maven-publish'
id 'signing'
id 'app.opendocument.conanandroidgradleplugin'
}
group = rootProject.group
["armv7", "armv8", "x86", "x86_64"].each { arch ->
tasks.named("conanInstall-" + arch) {
profile.set("android-21-" + arch)
}
}
android {
namespace "app.opendocument.android.pdf2htmlex"
compileSdk 35
defaultConfig {
minSdk 21
targetSdk 35
archivesBaseName = rootProject.name
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
externalNativeBuild.cmake.arguments(
'-DANDROID_STL=c++_shared',
"-DCMAKE_TOOLCHAIN_FILE=build/conan/android_toolchain.cmake",
"-DCMAKE_BUILD_TYPE=RelWithDebInfo",
)
buildConfigField("String", "VERSION_NAME", "\"${rootProject.version}\"")
}
publishing {
singleVariant("release") {
withSourcesJar()
withJavadocJar()
}
}
buildFeatures {
prefab true
buildConfig true
}
externalNativeBuild.cmake {
path 'CMakeLists.txt'
version '3.22.1'
}
ndkVersion '26.3.11579264'
sourceSets.main.assets.srcDirs += "build/conan/armv8/assets"
sourceSets.androidTest.assets.srcDirs = [ getProject().parent.getLayout().getProjectDirectory().dir("test/androidTestAssets") ]
}
// Make sure the assets are installed and ready when needed
afterEvaluate {
tasks.named("generateDebugAssets").configure {
dependsOn(tasks.named("conanInstall-armv8"))
}
tasks.named("generateReleaseAssets").configure {
dependsOn(tasks.named("conanInstall-armv8"))
}
}
dependencies {
implementation 'androidx.annotation:annotation:1.8.2'
implementation 'com.getkeepsafe.relinker:relinker:1.4.5'
implementation 'com.viliussutkus89:fontconfig-android-translator:1.0.2'
implementation 'com.viliussutkus89:assetextractor-android:1.3.3'
androidTestImplementation 'androidx.test.ext:junit:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
}
publishing {
publications {
release(MavenPublication) {
afterEvaluate {
from components.release
}
artifactId rootProject.name
version = rootProject.version
pom {
name = rootProject.name
description = 'pdf2htmlEX library port for Android - Convert PDF to HTML without losing text or format'
url = 'https://github.com/opendocument-app/pdf2htmlEX-Android'
packaging = 'aar'
inceptionYear = '2019'
developers {
developer {
id = "ViliusSutkus89"
name = "Vilius Sutkus"
email = "Vilius@ViliusSutkus89.com"
}
}
scm {
url = 'https://github.com/opendocument-app/pdf2htmlEX-Android'
connection = 'https://github.com/opendocument-app/pdf2htmlEX-Android.git'
}
licenses {
license {
name = 'GPLv3'
url = 'https://www.gnu.org/licenses/gpl-3.0.html'
distribution = 'repo'
}
}
}
}
}
}
if (System.getenv('SIGNING_KEY')) {
signing {
required { true }
useInMemoryPgpKeys(System.getenv('SIGNING_KEY'), System.getenv('SIGNING_PASS'))
sign publishing.publications.release
}
}
// Without removing .cxx dir on cleanup, double gradle clean is erroring out.
// Before removing this workaround, check if "./gradlew assembleDebug; ./gradlew clean; ./gradlew clean" works
tasks.named("clean") {
def dotCxxDir = getLayout().getProjectDirectory().dir(".cxx")
doFirst {
delete dotCxxDir
}
}