forked from hash-checker/hash-checker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
156 lines (143 loc) · 4.99 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
apply plugin: 'com.android.application'
apply from: 'checkstyle.gradle'
apply from: 'cpd.gradle'
apply from: 'jacoco.gradle'
apply from: 'utils.gradle'
android {
compileSdkVersion 30
buildToolsVersion '30.0.3'
defaultConfig {
applicationId 'com.smlnskgmail.jaman.hashchecker'
minSdkVersion 21
targetSdkVersion 30
versionCode 90
versionName '3.6.4'
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner 'com.smlnskgmail.jaman.hashchecker.runner.AndroidJacocoTestRunner'
resConfigs 'en',
'de',
'el',
'es',
'fa',
'fr',
'hu',
'it',
'iw',
'ko',
'nl',
'pl',
'ru',
'sv',
'zh-rCN',
'ja'
}
signingConfigs {
release {
final KEYSTORE_PATH = 'RELEASE_KEYSTORE_PATH'
final KEYSTORE_PASSWORD = 'RELEASE_KEYSTORE_PASSWORD'
final ALIAS_KEY = 'RELEASE_KEY_ALIAS'
final PASSWORD_KEY = 'RELEASE_KEY_PASSWORD'
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file("local.properties")
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
if (keystoreProperties[KEYSTORE_PATH] == null) {
keystoreProperties.put(
KEYSTORE_PATH,
System.getenv(KEYSTORE_PATH)
)
keystoreProperties.put(
KEYSTORE_PASSWORD,
System.getenv(KEYSTORE_PASSWORD)
)
keystoreProperties.put(
ALIAS_KEY,
System.getenv(ALIAS_KEY)
)
keystoreProperties.put(
PASSWORD_KEY,
System.getenv(PASSWORD_KEY)
)
}
if (!keystoreProperties.isEmpty()) {
try {
storeFile file(keystoreProperties[KEYSTORE_PATH])
storePassword keystoreProperties[KEYSTORE_PASSWORD]
keyAlias keystoreProperties[ALIAS_KEY]
keyPassword keystoreProperties[PASSWORD_KEY]
} catch (ignore) {
throw new InvalidUserDataException(
"You should define sign keys in gradle.properties or int ENV."
)
}
} else {
throw new InvalidUserDataException(
"You should define sign keys in gradle.properties or in ENV."
)
}
}
}
buildTypes {
debug {
versionNameSuffix '-dev'
minifyEnabled false
testCoverageEnabled = true
}
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
sourceSets {
main {
resources.srcDirs = [
'src/main/resources',
'src/test'
]
}
}
testOptions {
animationsDisabled true
unitTests {
includeAndroidResources = true
}
}
applicationVariants.all { variant ->
variant.outputs.each { output ->
def buildType = variant.buildType.name
output.outputFileName = "hash-checker_${buildType}.apk"
}
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.preference:preference:1.1.1'
// AdaptiveRecyclerView
implementation 'com.github.fartem:adaptive-recycler-view:1.1.1'
// ORMLite
implementation 'com.j256.ormlite:ormlite-core:5.3'
implementation 'com.j256.ormlite:ormlite-android:5.3'
// Checkstyle
checkstyle 'com.github.fartem:checkstyle-checks-java:1.1.0'
checkstyle 'com.github.fartem:checkstyle-checks-android:1.2.3'
// Unit tests
testImplementation 'junit:junit:4.13.1'
// Android tests
androidTestImplementation 'androidx.annotation:annotation:1.1.0'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test:rules:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.3.0'
// Screenshots
androidTestImplementation 'tools.fastlane:screengrab:2.0.0'
}