hash-checker
180 строк · 6.2 Кб
1apply plugin: 'com.android.application'
2apply plugin: 'com.jaredsburrows.license'
3
4android {
5compileSdkVersion 33
6buildToolsVersion '33.0.0'
7defaultConfig {
8applicationId 'com.smlnskgmail.jaman.hashchecker'
9minSdkVersion 21
10targetSdkVersion 33
11versionCode 99
12versionName '3.7.3'
13vectorDrawables.useSupportLibrary = true
14
15testInstrumentationRunner 'com.smlnskgmail.jaman.hashchecker.runner.AndroidJacocoTestRunner'
16
17resConfigs 'en', 'de', 'el', 'es', 'fa', 'fr', 'hu', 'it', 'iw', 'ko', 'my', 'nl', 'pl', 'ro', 'ru', 'sv',
18'pt-rBR', 'zh-rCN', 'vi', 'ja', 'hi'
19}
20signingConfigs {
21release {
22if (!System.getenv('CI')) {
23// final KEYSTORE_PATH = 'RELEASE_KEYSTORE_PATH'
24// final KEYSTORE_PASSWORD = 'RELEASE_KEYSTORE_PASSWORD'
25// final KEY_ALIAS = 'RELEASE_KEY_ALIAS'
26// final KEY_PASSWORD = 'RELEASE_KEY_PASSWORD'
27// def keystoreProperties = new Properties()
28// def keystorePropertiesFile = rootProject.file("local.properties")
29// if (keystorePropertiesFile.exists()) {
30// keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
31// }
32// def hasSignConfigInProperties = propertiesHasSignConfig(
33// keystoreProperties,
34// KEYSTORE_PATH,
35// KEYSTORE_PASSWORD,
36// KEY_ALIAS,
37// KEY_PASSWORD
38// )
39// if (!hasSignConfigInProperties) {
40// hasSignConfigInProperties = envHasSignConfig(
41// KEYSTORE_PATH,
42// KEYSTORE_PASSWORD,
43// KEY_ALIAS,
44// KEY_PASSWORD
45// )
46// if (hasSignConfigInProperties) {
47// keystoreProperties.put(KEYSTORE_PATH, System.getenv(KEYSTORE_PATH))
48// keystoreProperties.put(KEYSTORE_PASSWORD, System.getenv(KEYSTORE_PASSWORD))
49// keystoreProperties.put(KEY_ALIAS, System.getenv(KEY_ALIAS))
50// keystoreProperties.put(KEY_PASSWORD, System.getenv(KEY_PASSWORD))
51// }
52// }
53// try {
54// storeFile file(keystoreProperties[KEYSTORE_PATH])
55// storePassword keystoreProperties[KEYSTORE_PASSWORD]
56// keyAlias keystoreProperties[KEY_ALIAS]
57// keyPassword keystoreProperties[KEY_PASSWORD]
58// } catch (ignore) {
59// throw new InvalidUserDataException("You should define sign keys in gradle.properties or int ENV.")
60// }
61}
62}
63}
64buildTypes {
65debug {
66versionNameSuffix '-dev'
67minifyEnabled false
68
69testCoverageEnabled = true
70}
71release {
72minifyEnabled true
73shrinkResources true
74proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
75
76signingConfig signingConfigs.release
77}
78}
79
80flavorDimensions "distribute-version"
81productFlavors {
82thirdPartyStores {
83dimension "distribute-version"
84applicationIdSuffix ".thirdparty"
85versionNameSuffix "-thirdparty"
86}
87googlePlay {
88dimension "distribute-version"
89}
90}
91
92compileOptions {
93sourceCompatibility JavaVersion.VERSION_1_8
94targetCompatibility JavaVersion.VERSION_1_8
95}
96sourceSets {
97main {
98resources.srcDirs = [
99'src/main/resources',
100'src/test'
101]
102}
103}
104testOptions {
105animationsDisabled true
106
107unitTests {
108includeAndroidResources = true
109}
110}
111applicationVariants.all { variant ->
112variant.outputs.each { output ->
113def buildType = variant.buildType.name
114output.outputFileName = "hash-checker_${buildType}.apk"
115}
116}
117}
118
119//static boolean propertiesHasSignConfig(
120// properties,
121// path,
122// password,
123// keyAlias,
124// keyPassword
125//) {
126// def has = { key -> properties.containsKey(key) }
127// return has(path) && has(password) && has(keyAlias) && has(keyPassword)
128//}
129
130//static boolean envHasSignConfig(
131// path,
132// password,
133// keyAlias,
134// keyPassword
135//) {
136// def has = { key -> System.getenv().containsKey(key) }
137// return has(path) && has(password) && has(keyAlias) && has(keyPassword)
138//}
139
140dependencies {
141implementation 'androidx.appcompat:appcompat:1.6.1'
142implementation 'androidx.legacy:legacy-support-v4:1.0.0'
143implementation 'com.google.android.material:material:1.9.0'
144implementation 'androidx.preference:preference:1.2.1'
145
146// SHA-3
147implementation 'com.github.aelstad:keccakj:1.1.0'
148
149// AdaptiveRecyclerView
150implementation 'com.github.fartem:adaptive-recycler-view:1.1.1'
151
152// Dagger
153implementation 'com.google.dagger:dagger:2.40.2'
154annotationProcessor 'com.google.dagger:dagger-compiler:2.40.2'
155androidTestAnnotationProcessor 'com.google.dagger:dagger-compiler:2.40.2'
156
157// ORMLite
158implementation 'com.j256.ormlite:ormlite-core:5.7'
159implementation 'com.j256.ormlite:ormlite-android:5.7'
160
161// Checkstyle
162// checkstyle 'com.github.fartem:checkstyle-checks-java:1.1.0'
163// checkstyle 'com.github.fartem:checkstyle-checks-android:1.2.3'
164
165// Unit tests
166testImplementation 'junit:junit:4.13.2'
167
168// Android tests
169androidTestImplementation 'androidx.annotation:annotation:1.3.0'
170androidTestImplementation 'androidx.test:runner:1.4.0'
171androidTestImplementation 'androidx.test:rules:1.4.0'
172androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
173androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.4.0'
174
175// Screenshots
176// androidTestImplementation 'tools.fastlane:screengrab:2.1.1'
177
178// Google Play Core Library
179googlePlayImplementation 'com.google.android.play:core:1.10.3'
180}
181