2017-07-25 04:37:23 +00:00
|
|
|
apply plugin: 'com.android.application'
|
2019-05-16 03:38:29 +00:00
|
|
|
apply plugin: 'kotlin-android-extensions'
|
|
|
|
apply plugin: 'kotlin-android'
|
|
|
|
apply plugin: 'kotlin-kapt'
|
2019-08-02 03:00:29 +00:00
|
|
|
apply plugin: 'jacoco'
|
2021-02-21 04:07:10 +00:00
|
|
|
apply plugin: "com.osacky.fladle"
|
2018-10-16 01:41:33 +00:00
|
|
|
|
2018-09-05 00:45:01 +00:00
|
|
|
def keystoreProperties = new Properties()
|
2019-08-02 03:00:29 +00:00
|
|
|
try {
|
|
|
|
def keystorePropertiesFile = rootProject.file("keystore.properties")
|
|
|
|
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
2019-08-20 13:27:07 +00:00
|
|
|
} catch (FileNotFoundException ignored) {
|
2019-08-02 03:00:29 +00:00
|
|
|
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'] = ""
|
|
|
|
}
|
|
|
|
|
2017-07-25 04:37:23 +00:00
|
|
|
android {
|
2017-08-23 17:24:48 +00:00
|
|
|
configurations.all {
|
|
|
|
resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.1'
|
|
|
|
}
|
2017-07-27 17:43:55 +00:00
|
|
|
packagingOptions {
|
|
|
|
exclude 'META-INF/LICENSE-LGPL-2.1.txt'
|
|
|
|
exclude 'META-INF/LICENSE-LGPL-3.txt'
|
|
|
|
exclude 'META-INF/LICENSE-W3C-TEST'
|
|
|
|
exclude 'META-INF/LICENSE'
|
|
|
|
exclude 'META-INF/DEPENDENCIES'
|
|
|
|
}
|
2022-10-24 05:45:28 +00:00
|
|
|
compileSdkVersion 33
|
2017-08-07 22:54:18 +00:00
|
|
|
compileOptions {
|
|
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
|
|
}
|
2020-04-20 04:19:28 +00:00
|
|
|
kotlinOptions {
|
|
|
|
jvmTarget = "1.8"
|
|
|
|
}
|
2017-07-25 04:37:23 +00:00
|
|
|
defaultConfig {
|
|
|
|
applicationId "com.wbrawner.simplemarkdown"
|
2020-08-18 17:57:56 +00:00
|
|
|
minSdkVersion 23
|
2022-10-24 05:45:28 +00:00
|
|
|
targetSdkVersion 33
|
2022-10-24 05:48:54 +00:00
|
|
|
versionCode 35
|
|
|
|
versionName "0.8.13"
|
2019-05-16 03:38:29 +00:00
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
2021-02-21 05:23:58 +00:00
|
|
|
testInstrumentationRunnerArguments clearPackageData: 'true'
|
2022-10-30 04:03:39 +00:00
|
|
|
buildConfigField "boolean", "ENABLE_CUSTOM_CSS", "true"
|
2017-07-25 04:37:23 +00:00
|
|
|
}
|
2018-09-05 00:45:01 +00:00
|
|
|
signingConfigs {
|
2021-03-12 22:38:44 +00:00
|
|
|
playRelease {
|
2018-09-05 00:45:01 +00:00
|
|
|
keyAlias keystoreProperties['keyAlias']
|
|
|
|
keyPassword keystoreProperties['keyPassword']
|
|
|
|
storeFile file(keystoreProperties['storeFile'])
|
|
|
|
storePassword keystoreProperties['storePassword']
|
|
|
|
}
|
|
|
|
}
|
2017-07-25 04:37:23 +00:00
|
|
|
buildTypes {
|
2019-08-02 03:00:29 +00:00
|
|
|
debug {
|
|
|
|
testCoverageEnabled true
|
|
|
|
}
|
2017-07-25 04:37:23 +00:00
|
|
|
release {
|
2017-12-24 01:24:55 +00:00
|
|
|
minifyEnabled true
|
2017-07-25 04:37:23 +00:00
|
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
2019-05-18 01:17:14 +00:00
|
|
|
buildConfigField "boolean", "ENABLE_CUSTOM_CSS", "false"
|
2017-07-25 04:37:23 +00:00
|
|
|
}
|
|
|
|
}
|
2020-08-23 01:39:28 +00:00
|
|
|
flavorDimensions "platform"
|
2020-06-10 18:46:05 +00:00
|
|
|
productFlavors {
|
|
|
|
free {
|
|
|
|
applicationIdSuffix ".free"
|
|
|
|
versionNameSuffix "-free"
|
|
|
|
}
|
2021-03-12 22:38:44 +00:00
|
|
|
play {
|
|
|
|
signingConfig signingConfigs.playRelease
|
|
|
|
}
|
2020-06-10 18:46:05 +00:00
|
|
|
}
|
2017-07-29 17:25:30 +00:00
|
|
|
dexOptions {
|
|
|
|
jumboMode true
|
|
|
|
}
|
2018-01-27 22:51:45 +00:00
|
|
|
testOptions {
|
|
|
|
unitTests {
|
|
|
|
includeAndroidResources = true
|
|
|
|
}
|
2019-08-20 02:23:24 +00:00
|
|
|
execution 'ANDROIDX_TEST_ORCHESTRATOR'
|
2018-01-27 22:51:45 +00:00
|
|
|
}
|
2017-07-25 04:37:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2022-10-24 05:45:28 +00:00
|
|
|
def navigation_version = '2.5.3'
|
2021-02-21 02:59:06 +00:00
|
|
|
implementation "androidx.navigation:navigation-fragment-ktx:$navigation_version"
|
|
|
|
implementation "androidx.navigation:navigation-ui-ktx:$navigation_version"
|
2022-10-24 05:45:28 +00:00
|
|
|
testImplementation 'junit:junit:4.13.2'
|
2020-04-20 04:19:28 +00:00
|
|
|
testImplementation 'org.robolectric:robolectric:4.2.1'
|
2018-09-05 00:45:01 +00:00
|
|
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
2022-10-24 05:45:28 +00:00
|
|
|
def espresso_version = '3.4.0'
|
2019-08-20 02:23:24 +00:00
|
|
|
androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_version"
|
|
|
|
androidTestImplementation "androidx.test.espresso:espresso-web:$espresso_version"
|
|
|
|
androidTestImplementation "androidx.test.espresso:espresso-intents:$espresso_version"
|
2022-10-24 05:45:28 +00:00
|
|
|
def android_test = '1.4.0'
|
2019-08-20 02:23:24 +00:00
|
|
|
androidTestImplementation "androidx.test:runner:$android_test"
|
|
|
|
androidTestImplementation "androidx.test:rules:$android_test"
|
2022-10-24 05:45:28 +00:00
|
|
|
androidTestUtil "androidx.test:orchestrator:1.4.1"
|
|
|
|
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
2019-05-16 03:38:29 +00:00
|
|
|
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
|
2022-11-03 12:10:54 +00:00
|
|
|
implementation 'com.wbrawner.plausible:plausible-android:0.1.0-SNAPSHOT'
|
2022-10-24 05:45:28 +00:00
|
|
|
implementation 'androidx.appcompat:appcompat:1.5.1'
|
|
|
|
implementation 'androidx.preference:preference-ktx:1.2.0'
|
|
|
|
implementation "androidx.fragment:fragment-ktx:1.5.4"
|
|
|
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
|
|
|
implementation 'com.google.android.material:material:1.7.0'
|
2019-05-16 03:38:29 +00:00
|
|
|
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
|
2017-12-24 01:24:55 +00:00
|
|
|
implementation 'com.commonsware.cwac:anddown:0.3.0'
|
2022-10-24 05:45:28 +00:00
|
|
|
implementation 'com.jakewharton.timber:timber:5.0.1'
|
|
|
|
playImplementation 'com.android.billingclient:billing:5.0.0'
|
2020-08-29 03:53:42 +00:00
|
|
|
playImplementation 'com.google.android.play:core-ktx:1.8.1'
|
2022-10-24 05:45:28 +00:00
|
|
|
playImplementation 'com.google.firebase:firebase-crashlytics:18.3.1'
|
|
|
|
implementation "androidx.core:core-ktx:1.9.0"
|
|
|
|
implementation 'androidx.browser:browser:1.4.0'
|
|
|
|
def coroutines_version = "1.6.4"
|
2019-08-17 18:23:26 +00:00
|
|
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
|
2020-03-19 15:21:26 +00:00
|
|
|
def lifecycle_version = "2.2.0"
|
2019-08-19 01:56:21 +00:00
|
|
|
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
|
2019-11-07 00:10:52 +00:00
|
|
|
kapt "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
|
2019-08-02 03:00:29 +00:00
|
|
|
implementation 'eu.crydee:syllable-counter:4.0.2'
|
2017-07-25 04:37:23 +00:00
|
|
|
}
|
2019-02-10 19:12:51 +00:00
|
|
|
|
2020-06-10 18:46:05 +00:00
|
|
|
android.productFlavors.each { flavor ->
|
|
|
|
if (getGradle().getStartParameter().getTaskRequests().toString().toLowerCase().contains(flavor.name)
|
|
|
|
&& flavor.name == 'play') {
|
|
|
|
apply plugin: 'com.google.gms.google-services'
|
2021-03-12 22:38:44 +00:00
|
|
|
apply plugin: 'com.google.firebase.crashlytics'
|
2020-06-10 18:46:05 +00:00
|
|
|
}
|
|
|
|
}
|
2019-08-02 03:00:29 +00:00
|
|
|
|
|
|
|
jacoco {
|
2022-11-03 12:57:18 +00:00
|
|
|
toolVersion = '0.8.8'
|
2019-08-02 03:00:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType(Test) {
|
|
|
|
jacoco.includeNoLocationClasses = true
|
2022-11-03 12:57:18 +00:00
|
|
|
jacoco.excludes = ['jdk.internal.*']
|
2019-08-02 03:00:29 +00:00
|
|
|
}
|
|
|
|
|
2019-08-20 13:27:07 +00:00
|
|
|
task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) {
|
2019-08-02 03:00:29 +00:00
|
|
|
reports {
|
|
|
|
xml.enabled = true
|
|
|
|
html.enabled = true
|
|
|
|
}
|
|
|
|
|
|
|
|
def fileFilter = [ '**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*' ]
|
|
|
|
def javaDebugTree = fileTree(dir: "$project.buildDir/intermediates/javac/debug/compileDebugJavaWithJavac/classes", excludes: fileFilter)
|
|
|
|
def kotlinDebugTree = fileTree(dir: "$project.buildDir/tmp/kotlin-classes/debug", excludes: fileFilter)
|
|
|
|
def mainSrc = "$project.projectDir/src/main/java"
|
|
|
|
|
2019-11-07 16:16:44 +00:00
|
|
|
sourceDirectories.setFrom(files([mainSrc]))
|
|
|
|
classDirectories.setFrom(files([javaDebugTree, kotlinDebugTree]))
|
|
|
|
executionData.setFrom(fileTree(dir: project.buildDir, includes: [
|
2019-08-20 02:23:24 +00:00
|
|
|
'jacoco/testDebugUnitTest.exec',
|
|
|
|
'outputs/code-coverage/connected/*coverage.ec'
|
2019-11-07 16:16:44 +00:00
|
|
|
]))
|
2019-08-02 03:00:29 +00:00
|
|
|
}
|
2021-02-21 04:07:10 +00:00
|
|
|
|
|
|
|
fladle {
|
|
|
|
variant = 'playDebug'
|
|
|
|
useOrchestrator = true
|
|
|
|
environmentVariables = [
|
|
|
|
"clearPackageData": "true"
|
|
|
|
]
|
|
|
|
testTimeout = "7m"
|
|
|
|
devices = [
|
2021-02-21 05:01:43 +00:00
|
|
|
[ "model": "NexusLowRes", "version": "29" ]
|
2021-02-21 04:07:10 +00:00
|
|
|
]
|
|
|
|
projectId = 'simplemarkdown'
|
|
|
|
}
|
2021-02-21 21:07:21 +00:00
|
|
|
|
|
|
|
task pullLogFiles(type: Exec) {
|
|
|
|
commandLine 'adb', 'pull',
|
|
|
|
'/storage/emulated/0/Android/data/com.wbrawner.simplemarkdown/files/logs'
|
|
|
|
}
|