SimpleMarkdown/app/build.gradle.kts

201 lines
6.9 KiB
Text
Raw Normal View History

2023-01-30 03:41:15 +00:00
import java.io.FileInputStream
import java.io.FileNotFoundException
2023-11-06 04:21:02 +00:00
import java.util.Properties
2023-01-30 03:41:15 +00:00
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.fladle)
alias(libs.plugins.triplet.play)
id("com.wbrawner.releasehelper")
2023-01-30 03:41:15 +00:00
}
val keystoreProperties = Properties()
try {
val keystorePropertiesFile = rootProject.file("keystore.properties")
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
} catch (ignored: FileNotFoundException) {
logger.warn("Unable to load keystore properties. Automatic signing won't be available")
keystoreProperties["keyAlias"] = ""
keystoreProperties["keyPassword"] = ""
keystoreProperties["storeFile"] = File.createTempFile("temp", ".tmp").absolutePath
keystoreProperties["storePassword"] = ""
keystoreProperties["publishCredentialsFile"] = ""
2023-01-30 03:41:15 +00:00
}
android {
packaging {
2023-01-30 03:41:15 +00:00
resources {
excludes += listOf(
"META-INF/LICENSE-LGPL-2.1.txt",
"META-INF/LICENSE-LGPL-3.txt",
"META-INF/LICENSE-W3C-TEST",
"META-INF/LICENSE",
"META-INF/DEPENDENCIES"
)
}
}
compileSdk = libs.versions.maxSdk.get().toInt()
2023-01-30 03:41:15 +00:00
compileOptions {
2024-10-02 03:17:34 +00:00
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
2023-01-30 03:41:15 +00:00
}
kotlinOptions {
2024-10-02 03:17:34 +00:00
jvmTarget = "11"
2023-01-30 03:41:15 +00:00
}
defaultConfig {
applicationId = "com.wbrawner.simplemarkdown"
minSdk = libs.versions.minSdk.get().toInt()
targetSdk = libs.versions.maxSdk.get().toInt()
2024-10-03 22:25:04 +00:00
versionCode = 45
versionName = "2024.10.0"
2023-01-30 03:41:15 +00:00
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments["clearPackageData"] = "true"
buildConfigField("boolean", "ENABLE_CUSTOM_CSS", "true")
}
signingConfigs {
create("playRelease") {
keyAlias = keystoreProperties["keyAlias"].toString()
keyPassword = keystoreProperties["keyPassword"].toString()
storeFile = file(keystoreProperties["storeFile"].toString())
storePassword = keystoreProperties["storePassword"].toString()
}
}
buildTypes {
release {
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
buildConfigField("boolean", "ENABLE_CUSTOM_CSS", "false")
}
}
flavorDimensions.add("platform")
productFlavors {
create("free") {
applicationIdSuffix = ".free"
versionNameSuffix = "-free"
}
create("play") {
signingConfig = signingConfigs["playRelease"]
}
}
testOptions {
unitTests {
isIncludeAndroidResources = true
}
execution = "ANDROIDX_TEST_ORCHESTRATOR"
}
namespace = "com.wbrawner.simplemarkdown"
2023-09-11 04:00:58 +00:00
buildFeatures {
compose = true
}
playConfigs {
register("play") {
enabled.set(true)
commit.set(true)
}
}
2024-08-01 02:17:14 +00:00
lint {
2024-11-07 03:48:29 +00:00
disable += listOf(
"AndroidGradlePluginVersion",
"GradleDependency",
"ObsoleteLintCustomCheck"
)
2024-08-01 02:17:14 +00:00
warningsAsErrors = true
}
}
play {
commit.set(false)
enabled.set(false)
track.set("production")
defaultToAppBundles.set(true)
(keystoreProperties["publishCredentialsFile"] as? String)?.ifBlank { null }?.let {
serviceAccountCredentials.set(file(it))
}
2023-01-30 03:41:15 +00:00
}
dependencies {
"freeImplementation"(project(":free"))
"playImplementation"(project(":non-free"))
implementation(libs.androidx.material3.windowsizeclass)
implementation(libs.androidx.navigation.compose)
testImplementation(libs.junit)
testRuntimeOnly(libs.robolectric)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(libs.androidx.espresso.web)
androidTestImplementation(libs.androidx.espresso.intents)
androidTestRuntimeOnly(libs.androidx.runner)
androidTestUtil(libs.androidx.orchestrator)
implementation(libs.androidx.core.splashscreen)
implementation(libs.androidx.appcompat)
implementation(libs.material)
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.browser)
implementation(libs.commonmark)
implementation(libs.commonmark.ext.gfm.tables)
implementation(libs.commonmark.ext.gfm.strikethrough)
implementation(libs.commonmark.ext.autolink)
implementation(libs.commonmark.ext.task.list.items)
implementation(libs.commonmark.ext.yaml.front.matter)
implementation(libs.commonmark.ext.image.attributes)
implementation(libs.commonmark.ext.heading.anchor)
val composeBom = enforcedPlatform(libs.compose.bom)
2023-09-11 04:00:58 +00:00
implementation(composeBom)
androidTestImplementation(composeBom)
implementation(libs.androidx.runtime)
implementation(libs.androidx.ui)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.foundation)
implementation(libs.androidx.foundation.layout)
implementation(libs.androidx.ui.tooling)
implementation(libs.androidx.material3)
implementation(libs.androidx.material.icons.extended)
androidTestImplementation(libs.androidx.ui.test.junit4)
runtimeOnly(libs.kotlinx.coroutines.android)
testImplementation(libs.kotlinx.coroutines.test)
implementation(libs.syllable.counter)
androidTestImplementation(libs.androidx.ui.test)
androidTestImplementation(libs.androidx.core)
androidTestImplementation(libs.androidx.monitor)
androidTestImplementation(libs.junit)
implementation(libs.androidx.activity.ktx)
implementation(libs.androidx.activity.ktx)
implementation(libs.androidx.animation.core)
implementation(libs.androidx.animation)
implementation(libs.androidx.material.icons.core)
implementation(libs.androidx.ui.graphics)
implementation(libs.androidx.ui.text)
implementation(libs.androidx.ui.tooling.preview)
implementation(libs.androidx.ui.unit)
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.viewmodel.ktx)
implementation(libs.androidx.navigation.common)
implementation(libs.androidx.navigation.runtime.ktx)
implementation(libs.androidx.preference.ktx)
implementation(libs.acra.core)
implementation(libs.timber)
implementation(libs.kotlinx.coroutines.core)
2024-05-19 04:30:55 +00:00
implementation(project(":core"))
2023-01-30 03:41:15 +00:00
}
fladle {
variant.set("playDebug")
useOrchestrator.set(true)
environmentVariables.put("clearPackageData", "true")
testTimeout.set("7m")
devices.add(
mapOf("model" to "Pixel2.arm", "version" to "33")
2023-01-30 03:41:15 +00:00
)
projectId.set("simplemarkdown")
}
tasks.register<Exec>("pullLogFiles") {
commandLine = listOf(
"adb", "pull",
"/storage/emulated/0/Android/data/com.wbrawner.simplemarkdown/files/logs"
)
}