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 {
|
|
|
|
id("com.android.application")
|
|
|
|
id("kotlin-android")
|
|
|
|
id("com.osacky.fladle")
|
2023-09-29 02:15:38 +00:00
|
|
|
id("com.github.triplet.play") version "3.8.4"
|
|
|
|
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"] = ""
|
|
|
|
}
|
|
|
|
|
|
|
|
android {
|
|
|
|
packagingOptions {
|
|
|
|
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"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
2023-09-11 04:00:58 +00:00
|
|
|
compileSdk = 34
|
2023-01-30 03:41:15 +00:00
|
|
|
compileOptions {
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
}
|
|
|
|
kotlinOptions {
|
|
|
|
jvmTarget = "1.8"
|
|
|
|
}
|
|
|
|
defaultConfig {
|
|
|
|
applicationId = "com.wbrawner.simplemarkdown"
|
|
|
|
minSdk = 23
|
2023-09-11 04:00:58 +00:00
|
|
|
targetSdk = 34
|
2023-09-29 02:15:38 +00:00
|
|
|
versionCode = 41
|
|
|
|
versionName = "0.8.16"
|
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
|
|
|
|
}
|
|
|
|
composeOptions {
|
|
|
|
kotlinCompilerExtensionVersion = "1.5.3"
|
|
|
|
}
|
2023-09-29 02:15:38 +00:00
|
|
|
playConfigs {
|
|
|
|
register("play") {
|
|
|
|
enabled.set(true)
|
|
|
|
commit.set(true)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
play {
|
|
|
|
commit.set(false)
|
|
|
|
enabled.set(false)
|
|
|
|
track.set("production")
|
|
|
|
defaultToAppBundles.set(true)
|
2023-01-30 03:41:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2024-05-19 04:13:39 +00:00
|
|
|
"freeImplementation"(project(":free"))
|
|
|
|
"playImplementation"(project(":non-free"))
|
2024-02-11 22:44:38 +00:00
|
|
|
implementation("androidx.compose.material3:material3-window-size-class-android:1.2.0")
|
2023-09-11 04:00:58 +00:00
|
|
|
val navigationVersion = "2.7.2"
|
|
|
|
implementation("androidx.navigation:navigation-compose:$navigationVersion")
|
2023-01-30 03:41:15 +00:00
|
|
|
testImplementation("junit:junit:4.13.2")
|
2024-05-19 04:30:55 +00:00
|
|
|
testRuntimeOnly("org.robolectric:robolectric:4.2.1")
|
2023-01-30 03:41:15 +00:00
|
|
|
val espressoVersion = "3.5.1"
|
|
|
|
androidTestImplementation("androidx.test.espresso:espresso-core:$espressoVersion")
|
|
|
|
androidTestImplementation("androidx.test.espresso:espresso-web:$espressoVersion")
|
|
|
|
androidTestImplementation("androidx.test.espresso:espresso-intents:$espressoVersion")
|
2024-05-19 04:30:55 +00:00
|
|
|
androidTestRuntimeOnly("androidx.test:runner:1.5.2")
|
2023-01-30 03:41:15 +00:00
|
|
|
androidTestUtil("androidx.test:orchestrator:1.4.2")
|
2023-09-11 04:00:58 +00:00
|
|
|
implementation("androidx.core:core-splashscreen:1.0.1")
|
|
|
|
implementation("androidx.appcompat:appcompat:1.6.1")
|
|
|
|
implementation("com.google.android.material:material:1.9.0")
|
|
|
|
implementation("androidx.core:core-ktx:1.12.0")
|
|
|
|
implementation("androidx.browser:browser:1.6.0")
|
2024-05-06 05:08:32 +00:00
|
|
|
val commonMarkVersion = "0.22.0"
|
|
|
|
implementation("org.commonmark:commonmark:$commonMarkVersion")
|
|
|
|
implementation("org.commonmark:commonmark-ext-gfm-tables:$commonMarkVersion")
|
|
|
|
implementation("org.commonmark:commonmark-ext-gfm-strikethrough:$commonMarkVersion")
|
|
|
|
implementation("org.commonmark:commonmark-ext-autolink:$commonMarkVersion")
|
|
|
|
implementation("org.commonmark:commonmark-ext-task-list-items:$commonMarkVersion")
|
|
|
|
implementation("org.commonmark:commonmark-ext-yaml-front-matter:$commonMarkVersion")
|
|
|
|
implementation("org.commonmark:commonmark-ext-image-attributes:$commonMarkVersion")
|
|
|
|
implementation("org.commonmark:commonmark-ext-heading-anchor:$commonMarkVersion")
|
2023-09-11 04:00:58 +00:00
|
|
|
val composeBom = platform("androidx.compose:compose-bom:2023.08.00")
|
|
|
|
implementation(composeBom)
|
|
|
|
androidTestImplementation(composeBom)
|
|
|
|
implementation("androidx.compose.runtime:runtime")
|
|
|
|
implementation("androidx.compose.ui:ui")
|
|
|
|
implementation("androidx.activity:activity-compose")
|
|
|
|
implementation("androidx.compose.foundation:foundation")
|
|
|
|
implementation("androidx.compose.foundation:foundation-layout")
|
|
|
|
implementation("androidx.compose.ui:ui-tooling")
|
|
|
|
implementation("androidx.compose.material3:material3")
|
|
|
|
implementation("androidx.compose.material:material-icons-extended")
|
2023-09-13 04:18:00 +00:00
|
|
|
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
|
2023-09-11 04:00:58 +00:00
|
|
|
val coroutinesVersion = "1.7.1"
|
2024-05-19 04:30:55 +00:00
|
|
|
runtimeOnly("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion")
|
2024-02-15 23:09:31 +00:00
|
|
|
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion")
|
2023-01-30 03:41:15 +00:00
|
|
|
implementation("eu.crydee:syllable-counter:4.0.2")
|
2024-05-19 04:30:55 +00:00
|
|
|
androidTestImplementation("androidx.compose.ui:ui-test:1.6.0")
|
|
|
|
androidTestImplementation("androidx.test:core:1.5.0")
|
|
|
|
androidTestImplementation("androidx.test:monitor:1.6.1")
|
|
|
|
androidTestImplementation("junit:junit:4.13.2")
|
|
|
|
androidTestImplementation("org.hamcrest:hamcrest-core:1.3")
|
|
|
|
implementation("androidx.activity:activity-ktx:1.8.0")
|
|
|
|
implementation("androidx.activity:activity:1.8.0")
|
|
|
|
implementation("androidx.compose.animation:animation-core:1.6.0")
|
|
|
|
implementation("androidx.compose.animation:animation:1.6.0")
|
|
|
|
implementation("androidx.compose.material:material-icons-core:1.6.0")
|
|
|
|
implementation("androidx.compose.ui:ui-graphics:1.6.0")
|
|
|
|
implementation("androidx.compose.ui:ui-text:1.6.0")
|
|
|
|
implementation("androidx.compose.ui:ui-tooling-preview:1.6.0")
|
|
|
|
implementation("androidx.compose.ui:ui-unit:1.6.0")
|
|
|
|
implementation("androidx.core:core:1.13.1")
|
|
|
|
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2")
|
|
|
|
implementation("androidx.lifecycle:lifecycle-viewmodel:2.6.2")
|
|
|
|
implementation("androidx.navigation:navigation-common:2.7.2")
|
|
|
|
implementation("androidx.navigation:navigation-runtime:2.7.2")
|
|
|
|
implementation("androidx.preference:preference:1.2.1")
|
|
|
|
implementation("ch.acra:acra-core:5.11.3")
|
|
|
|
implementation("com.jakewharton.timber:timber:5.0.1")
|
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1")
|
|
|
|
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 "NexusLowRes", "version" to "29")
|
|
|
|
)
|
|
|
|
projectId.set("simplemarkdown")
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.register<Exec>("pullLogFiles") {
|
|
|
|
commandLine = listOf(
|
|
|
|
"adb", "pull",
|
|
|
|
"/storage/emulated/0/Android/data/com.wbrawner.simplemarkdown/files/logs"
|
|
|
|
)
|
|
|
|
}
|