-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathbuild.gradle
78 lines (63 loc) · 2.52 KB
/
build.gradle
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
apply plugin: 'com.android.library' // required for aar generation to link to from AnkiDroid
apply plugin: 'com.google.protobuf'
apply plugin: 'signing'
apply plugin: 'com.vanniktech.maven.publish'
android {
compileSdkVersion 30
buildToolsVersion "30.0.1"
ndkVersion "22.0.7026061" // Used by GitHub actions - avoids an install step on some machines
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName VERSION_NAME
consumerProguardFiles "consumer-rules.pro"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
// Consider upgrade to DSL: https://docs.gradle.org/current/userguide/plugins.html#sec:plugins_block
apply plugin: "org.mozilla.rust-android-gradle.rust-android"
cargo {
module = "../rslib-bridge"
libname = "rsdroid"
targets = ["x86", "arm", "x86_64", "arm64"]
profile = 'release'
apiLevel = 21
verbose = true
}
apply from: "proto.gradle"
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar", '*.so'])
implementation 'androidx.appcompat:appcompat:1.2.0'
// Protobuf is part of the ABI, so include it as a compile/api dependency.
api 'com.google.protobuf:protobuf-java:3.13.0'
implementation 'androidx.sqlite:sqlite:2.1.0'
implementation 'com.jakewharton.timber:timber:4.7.1'
testImplementation 'junit:junit:4.12'
testImplementation "org.robolectric:robolectric:4.3.1"
testImplementation 'androidx.test:core:1.2.0'
testImplementation 'androidx.test.ext:junit:1.1.1'
testImplementation project(path: ':rsdroid-testing')
}
preBuild.dependsOn "cargoBuild"
signing {
def hasPrivate = project.hasProperty('SIGNING_PRIVATE_KEY')
def hasPassword = project.hasProperty('SIGNING_PASSWORD')
if (hasPrivate && hasPassword) {
useInMemoryPgpKeys(project.getProperty('SIGNING_PRIVATE_KEY'), project.getProperty('SIGNING_PASSWORD'))
} else {
def message = "Publishing to Sonatype will not work - PGP keys not set for publishing"
def pk = System.getenv("ORG_GRADLE_PROJECT_SIGNING_PRIVATE_KEY")
def pwd = System.getenv("ORG_GRADLE_PROJECT_SIGNING_PASSWORD")
logger.warn("$message: ${hasPrivate}, ${hasPassword}, ${pk == null || "" == pk}, ${pwd == null || "" == pwd}")
}
}