mysu/app/build.gradle

162 lines
5.3 KiB
Groovy
Raw Normal View History

2022-09-07 21:31:20 +02:00
apply plugin: 'com.android.application'
2022-09-17 21:35:31 +02:00
apply plugin: "androidx.navigation.safeargs"
2022-09-07 21:31:20 +02:00
android {
compileSdkVersion 34
2022-09-07 21:31:20 +02:00
buildToolsVersion '30.0.3'
ndkVersion '17.2.4988734'
defaultConfig {
2022-09-17 22:14:08 +02:00
applicationId "net.mynero.wallet"
2022-09-07 21:31:20 +02:00
minSdkVersion 21
targetSdkVersion 34
2023-12-02 20:31:15 +01:00
versionCode 40600
versionName "0.4.6 'Fluorine Fermi'"
2022-09-07 21:31:20 +02:00
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
cppFlags "-std=c++11"
arguments '-DANDROID_STL=c++_shared'
}
}
}
bundle {
language {
enableSplit = false
}
}
flavorDimensions 'type', 'net'
productFlavors {
mainnet {
dimension 'net'
}
2022-11-11 06:27:03 +01:00
beta {
2022-09-07 21:31:20 +02:00
dimension 'net'
2022-11-11 06:27:03 +01:00
applicationIdSuffix '.beta'
versionNameSuffix ' (beta)'
2022-09-07 21:31:20 +02:00
}
devnet {
dimension 'net'
applicationIdSuffix '.test'
versionNameSuffix ' (test)'
}
alpha {
dimension 'type'
applicationIdSuffix '.alpha'
versionNameSuffix ' (alpha)'
}
prod {
dimension 'type'
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
applicationIdSuffix ".debug"
}
applicationVariants.all { variant ->
variant.buildConfigField "String", "ID_A", "\"" + getId("ID_A") + "\""
}
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
splits {
abi {
enable true
reset()
include 'armeabi-v7a', 'arm64-v8a', 'x86_64'
universalApk true
}
}
// Map for the version code that gives each ABI a value.
def abiCodes = ['armeabi-v7a': 1, 'arm64-v8a': 2, 'x86': 3, 'x86_64': 4]
// Enumerate translated locales
def availableLocales = ["en"]
new File("app/src/main/res/").eachFileMatch(~/^values-.*/) { file ->
def languageTag = file.name.substring(7).replace("-r", "-")
if (languageTag != "night")
availableLocales.add(languageTag)
}
// APKs for the same app that all have the same version information.
android.applicationVariants.all { variant ->
// Update string resource: available_locales
variant.resValue("string", "available_locales", availableLocales.join(","))
// Assigns a different version code for each output APK.
variant.outputs.all {
output ->
def abiName = output.getFilter(com.android.build.OutputFile.ABI)
output.versionCodeOverride = abiCodes.get(abiName, 0) + 10 * versionCode
if (abiName == null) abiName = "universal"
def v = "${variant.versionName}".replaceFirst(" '.*' ?", "")
.replace(".", "x")
.replace("(", "-")
.replace(")", "")
outputFileName = "$rootProject.ext.apkName-" + v + "_" + abiName + ".apk"
}
}
compileOptions {
2022-09-12 19:35:26 +02:00
sourceCompatibility JavaVersion.VERSION_1_9
targetCompatibility JavaVersion.VERSION_1_9
2022-09-07 21:31:20 +02:00
}
2022-09-17 22:14:08 +02:00
namespace 'net.mynero.wallet'
buildFeatures {
viewBinding true
}
2022-09-07 21:31:20 +02:00
}
static def getId(name) {
Properties props = new Properties()
2022-09-18 08:39:59 +02:00
props.load(new FileInputStream(new File('mynero.id')))
2022-09-07 21:31:20 +02:00
return props[name]
}
dependencies {
2023-04-29 00:38:45 +02:00
implementation 'androidx.core:core:1.10.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
2022-09-07 21:31:20 +02:00
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
2023-04-29 00:38:45 +02:00
implementation 'androidx.recyclerview:recyclerview:1.3.0'
2022-09-07 21:31:20 +02:00
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
2023-04-29 00:38:45 +02:00
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
2022-09-07 21:31:20 +02:00
implementation 'androidx.preference:preference:1.2.0'
2023-04-29 00:38:45 +02:00
implementation 'com.google.android.material:material:1.8.0'
2023-05-14 09:41:51 +02:00
implementation 'com.ncorti:slidetoact:0.9.0'
2022-09-12 19:35:26 +02:00
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
2022-09-07 21:31:20 +02:00
implementation "com.jakewharton.timber:timber:5.0.1"
implementation fileTree(dir: 'libs/classes', include: ['*.jar'])
implementation 'org.slf4j:slf4j-nop:1.7.36'
2023-04-29 00:38:45 +02:00
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1'
implementation 'androidx.navigation:navigation-fragment:2.5.3'
implementation 'androidx.navigation:navigation-ui:2.5.3'
2022-09-07 21:31:20 +02:00
//noinspection GradleDependency
testImplementation "junit:junit:4.13.2"
testImplementation "org.mockito:mockito-all:1.10.19"
testImplementation "com.squareup.okhttp3:mockwebserver:4.9.3"
testImplementation 'org.json:json:20211205'
testImplementation 'net.jodah:concurrentunit:0.4.6'
}
//https://stackoverflow.com/questions/75274720/a-failure-occurred-while-executing-appcheckdebugduplicateclasses/75315276#75315276
//Not sure why this is needed since Kotlin isn't used in this project...
configurations.implementation {
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8'
}