You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
173 lines
5.5 KiB
173 lines
5.5 KiB
/* |
|
* Copyright (c) 2022 New Vector Ltd |
|
* |
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
* you may not use this file except in compliance with the License. |
|
* You may obtain a copy of the License at |
|
* |
|
* http://www.apache.org/licenses/LICENSE-2.0 |
|
* |
|
* Unless required by applicable law or agreed to in writing, software |
|
* distributed under the License is distributed on an "AS IS" BASIS, |
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
* See the License for the specific language governing permissions and |
|
* limitations under the License. |
|
*/ |
|
|
|
import extension.allFeatures |
|
import extension.allLibraries |
|
|
|
// TODO: Remove once https://youtrack.jetbrains.com/issue/KTIJ-19369 is fixed |
|
@Suppress("DSL_SCOPE_VIOLATION") |
|
plugins { |
|
id("io.element.android-compose-application") |
|
alias(libs.plugins.stem) |
|
alias(libs.plugins.kotlin.android) |
|
alias(libs.plugins.ksp) |
|
alias(libs.plugins.anvil) |
|
alias(libs.plugins.kapt) |
|
id("com.google.firebase.appdistribution") version "3.0.2" |
|
id("org.jetbrains.kotlinx.knit") version "0.4.0" |
|
id("kotlin-parcelize") |
|
} |
|
|
|
android { |
|
namespace = "io.element.android.x" |
|
|
|
testOptions { unitTests.isIncludeAndroidResources = true } |
|
|
|
defaultConfig { |
|
applicationId = "io.element.android.x" |
|
targetSdk = Versions.targetSdk |
|
versionCode = Versions.versionCode |
|
versionName = Versions.versionName |
|
|
|
vectorDrawables { |
|
useSupportLibrary = true |
|
} |
|
} |
|
|
|
signingConfigs { |
|
named("debug") { |
|
keyAlias = "androiddebugkey" |
|
keyPassword = "android" |
|
storeFile = file("./signature/debug.keystore") |
|
storePassword = "android" |
|
} |
|
register("nightly") { |
|
keyAlias = System.getenv("ELEMENT_ANDROID_NIGHTLY_KEYID") |
|
?: project.property("signing.element.nightly.keyId") as? String? |
|
keyPassword = System.getenv("ELEMENT_ANDROID_NIGHTLY_KEYPASSWORD") |
|
?: project.property("signing.element.nightly.keyPassword") as? String? |
|
storeFile = file("./signature/nightly.keystore") |
|
storePassword = System.getenv("ELEMENT_ANDROID_NIGHTLY_STOREPASSWORD") |
|
?: project.property("signing.element.nightly.storePassword") as? String? |
|
} |
|
} |
|
|
|
buildTypes { |
|
named("debug") { |
|
resValue("string", "app_name", "ElementX dbg") |
|
applicationIdSuffix = ".debug" |
|
signingConfig = signingConfigs.getByName("debug") |
|
} |
|
|
|
named("release") { |
|
resValue("string", "app_name", "ElementX") |
|
signingConfig = signingConfigs.getByName("debug") |
|
|
|
postprocessing { |
|
isRemoveUnusedCode = true |
|
isObfuscate = false |
|
isOptimizeCode = true |
|
isRemoveUnusedResources = true |
|
proguardFiles("proguard-rules.pro") |
|
} |
|
} |
|
|
|
register("nightly") { |
|
val release = getByName("release") |
|
initWith(release) |
|
applicationIdSuffix = ".nightly" |
|
versionNameSuffix = "-nightly" |
|
resValue("string", "app_name", "ElementX nightly") |
|
matchingFallbacks += listOf("release") |
|
signingConfig = signingConfigs.getByName("nightly") |
|
|
|
postprocessing { |
|
initWith(release.postprocessing) |
|
} |
|
|
|
firebaseAppDistribution { |
|
artifactType = "APK" |
|
// This file will be generated by the GitHub action |
|
releaseNotesFile = "CHANGES_NIGHTLY.md" |
|
groups = "external-testers" |
|
// This should not be required, but if I do not add the appId, I get this error: |
|
// "App Distribution halted because it had a problem uploading the APK: [404] Requested entity was not found." |
|
appId = "1:912726360885:android:e17435e0beb0303000427c" |
|
} |
|
} |
|
} |
|
kotlinOptions { |
|
jvmTarget = "1.8" |
|
} |
|
|
|
// Waiting for https://github.com/google/ksp/issues/37 |
|
applicationVariants.all { |
|
kotlin.sourceSets { |
|
getByName(name) { |
|
kotlin.srcDir("build/generated/ksp/$name/kotlin") |
|
} |
|
} |
|
} |
|
} |
|
|
|
// Knit |
|
apply { |
|
plugin("kotlinx-knit") |
|
} |
|
|
|
knit { |
|
files = fileTree(project.rootDir) { |
|
include( |
|
"**/*.md", |
|
"**/*.kt", |
|
"*/*.kts", |
|
) |
|
exclude( |
|
"**/build/**", |
|
"*/.gradle/**", |
|
"*/towncrier/template.md", |
|
"**/CHANGES.md", |
|
) |
|
} |
|
} |
|
|
|
dependencies { |
|
allLibraries() |
|
allFeatures() |
|
implementation(projects.tests.uitests) |
|
implementation(projects.anvilannotations) |
|
anvil(projects.anvilcodegen) |
|
|
|
// https://developer.android.com/studio/write/java8-support#library-desugaring-versions |
|
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.2") |
|
implementation(libs.appyx.core) |
|
implementation(libs.androidx.splash) |
|
implementation(libs.androidx.corektx) |
|
implementation(libs.androidx.lifecycle.runtime) |
|
implementation(libs.androidx.activity.compose) |
|
implementation(libs.androidx.startup) |
|
implementation(libs.coil) |
|
|
|
implementation(libs.dagger) |
|
kapt(libs.dagger.compiler) |
|
|
|
testImplementation(libs.test.junit) |
|
testImplementation(libs.coroutines.test) |
|
testImplementation(libs.molecule.runtime) |
|
testImplementation(libs.test.truth) |
|
testImplementation(libs.test.turbine) |
|
testImplementation(projects.libraries.matrixtest) |
|
}
|
|
|