2 id "com.diffplug.spotless" version "5.15.2"
4 apply from: '../dependencies.gradle'
5 apply plugin: 'com.android.application'
6 apply plugin: 'kotlin-android'
11 maven { url "https://jitpack.io" }
17 ktlint()userData(['max_line_length': '100'])
22 compileSdkVersion COMPILE_SDK_VERSION
23 buildToolsVersion BUILD_TOOLS_VERSION
26 applicationId "com.farmerbb.taskbar"
28 minSdkVersion MIN_SDK_VERSION
29 targetSdkVersion TARGET_SDK_VERSION
30 versionCode VERSION_CODE
31 versionName VERSION_NAME
33 resConfigs "en", "es", "ja", "ru", "de", "zh-rCN", "tr", "nl", "pl"
34 vectorDrawables.generatedDensities = []
36 buildConfigField "String", "BASE_APPLICATION_ID", "\"com.farmerbb.taskbar\""
37 buildConfigField "String", "PAID_APPLICATION_ID", "\"com.farmerbb.taskbar.paid\""
38 buildConfigField "String", "SUPPORT_APPLICATION_ID", "\"com.farmerbb.taskbar.support\""
39 buildConfigField "String", "ANDROIDX86_APPLICATION_ID", "\"com.farmerbb.taskbar.androidx86\""
41 buildConfigField "long", "TIMESTAMP", "${System.currentTimeMillis()}L"
45 sourceCompatibility JavaVersion.VERSION_1_8
46 targetCompatibility JavaVersion.VERSION_1_8
55 if(System.getenv("KSTOREFILE") != null)
56 storeFile file(System.getenv("KSTOREFILE"))
58 storePassword System.getenv("KSTOREPWD")
59 keyAlias System.getenv("KEYALIAS")
60 keyPassword System.getenv("KEYPWD")
66 applicationIdSuffix ".debug"
67 manifestPlaceholders = [appName: "@string/tb_app_name_debug"]
73 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
74 signingConfig signingConfigs.release
75 manifestPlaceholders = [appName: "@string/tb_app_name"]
77 applicationVariants.all { variant ->
79 outputFileName = "${project.parent.name}-${defaultConfig.versionName}.apk"
85 initWith buildTypes.debug
86 testCoverageEnabled true
90 flavorDimensions "default"
93 paid { applicationId "com.farmerbb.taskbar.paid" }
94 free { applicationId "com.farmerbb.taskbar" }
99 java { srcDirs('src/main/java', 'src/playstore/java', 'src/nonlib/java', "src/compat-$COMPILE_SDK_VERSION/java") }
100 res { srcDirs('src/main/res', 'src/playstore/res', 'src/nonlib/res') }
101 manifest.srcFile 'src/playstore/AndroidManifest.xml'
113 events 'passed', 'skipped', 'failed', 'standardOut', 'standardError'
115 outputs.upToDateWhen {
119 showStandardStreams = false
120 exceptionFormat = 'full'
123 //noinspection GrDeprecatedAPIUsage
125 includeNoLocationClasses = true
126 excludes = ['jdk.internal.*']
130 includeAndroidResources = true
136 implementation "androidx.legacy:legacy-support-v4:$SUPPORT_V4_VERSION"
137 implementation "androidx.appcompat:appcompat:$APPCOMPAT_VERSION"
138 //noinspection GradleDependency
139 implementation "androidx.browser:browser:$BROWSER_VERSION"
140 implementation "com.google.android.material:material:$MATERIAL_VERSION"
141 //noinspection GradleDependency
142 implementation 'com.mikepenz:iconics-core:3.2.5'
143 implementation 'com.mikepenz:foundation-icons-typeface:3.0.0.5'
144 implementation 'moe.banana:toast-compat:1.0.5'
145 implementation group:'com.twofortyfouram', name:'android-plugin-api-for-locale', version:'[1.0.2,2.0['
146 debugImplementation "org.lsposed.hiddenapibypass:hiddenapibypass:$HIDDEN_API_BYPASS_VERSION"
147 releaseImplementation "org.lsposed.hiddenapibypass:hiddenapibypass:$HIDDEN_API_BYPASS_VERSION"
149 testImplementation "com.google.truth:truth:1.1.3"
150 testImplementation 'junit:junit:4.13.2'
151 testImplementation 'androidx.test:core:1.4.0'
152 testImplementation "org.robolectric:robolectric:4.6.1"
153 testImplementation "org.powermock:powermock-module-junit4:$POWERMOCK_VERSION"
154 testImplementation "org.powermock:powermock-module-junit4-rule:$POWERMOCK_VERSION"
155 testImplementation "org.powermock:powermock-api-mockito2:$POWERMOCK_VERSION"
156 testImplementation "org.powermock:powermock-classloading-xstream:$POWERMOCK_VERSION"
157 testImplementation 'org.apache.commons:commons-lang3:3.12.0'
160 task jacocoTestReport(type: JacocoReport, dependsOn: ['testFreeJacocoUnitTest']) {
170 '**/BuildConfig.class'
173 def jacocoTree = fileTree(dir: "$buildDir/intermediates/javac/freeJacoco/classes", excludes: fileFilter)
174 def mainSrc = "${project.projectDir}/src/main/java"
176 sourceDirectories.from = [mainSrc]
177 classDirectories.from = [jacocoTree]
178 executionData.from = "$buildDir/jacoco/testFreeJacocoUnitTest.exec"
181 println "Test report link: file://$buildDir/reports/jacoco/jacocoTestReport/html/index.html"