This repository was archived by the owner on Sep 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuild.gradle
More file actions
144 lines (127 loc) · 4.18 KB
/
Copy pathbuild.gradle
File metadata and controls
144 lines (127 loc) · 4.18 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
plugins {
id "org.jetbrains.kotlin.plugin.serialization" version "$kotlin_version"
}
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-parcelize'
apply plugin: 'org.mozilla.rust-android-gradle.rust-android'
apply plugin: 'maven-publish'
apply plugin: 'pl.allegro.tech.build.axion-release'
apply plugin: "org.sonarqube"
sonarqube {
properties {
property "sonar.projectName", "arklib-android"
property "sonar.projectKey", "ARK-Builders_arklib-android"
property "sonar.organization", "ark-builders"
property "sonar.host.url", "https://sonarcloud.io"
}
}
android {
compileSdkVersion 34
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
minSdkVersion 26
targetSdkVersion 34
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
publishing {
singleVariant('release') {
withSourcesJar()
}
singleVariant('debug') {
withSourcesJar()
}
}
ndkVersion "25.2.9519653"
namespace "dev.arkbuilders.arklib"
}
cargo {
module = "../arklib"
libname = "arklib"
targets = ["arm64", "x86", "x86_64", "arm"]
// speed up local build
// targets = ["arm64"]
prebuiltToolchains = true
// Set to "debug" to enable logging. Or "release" to make a production build.
// https://github.com/mozilla/rust-android-gradle/issues/38
profile = gradle.startParameter.taskNames.any { it.toLowerCase().contains("debug") } ? "debug" : "release"
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.core:core-ktx:1.7.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.3"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3"
implementation 'org.apache.tika:tika-core:2.4.0'
implementation "com.google.dagger:dagger:2.50"
implementation 'com.davemorrissey.labs:subsampling-scale-image-view-androidx:3.10.0'
implementation 'com.github.wseemann:FFmpegMediaMetadataRetriever:1.0.14'
def coilVersion = "2.4.0"
implementation "io.coil-kt:coil:$coilVersion"
implementation "io.coil-kt:coil-gif:$coilVersion"
implementation "io.coil-kt:coil-svg:$coilVersion"
implementation "io.coil-kt:coil-video:$coilVersion"
testImplementation "junit:junit:4.13.2"
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3'
testImplementation "io.mockk:mockk:1.13.7"
}
tasks.whenTaskAdded { task ->
if ((task.name == 'mergeDebugJniLibFolders' || task.name == 'mergeReleaseJniLibFolders')) {
task.dependsOn 'cargoBuild'
}
}
//For local development:
//def libVersion = '999'
def libVersion = scmVersion.version
publishing {
publications {
release(MavenPublication) {
groupId = "dev.arkbuilders"
artifactId = "arklib"
version = libVersion
afterEvaluate {
from components.release
}
}
debug(MavenPublication) {
groupId = "dev.arkbuilders"
artifactId = "arklib-debug"
version = libVersion
afterEvaluate {
from components.debug
}
}
}
repositories {
maven {
name = "GithubPackages"
url = "https://maven.pkg.github.com/ARK-Builders/arklib-android"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
tasks.withType(Test) {
systemProperty "java.library.path", rootDir
}
task buildRustLibForHost(type: Exec) {
standardOutput = new ByteArrayOutputStream()
commandLine 'sh', '../scripts/buildRustLibForHost.sh'
doLast {
println "Output: $standardOutput"
}
}
afterEvaluate {
testDebugUnitTest.dependsOn buildRustLibForHost
}