-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathdeps.gradle
135 lines (127 loc) · 4.96 KB
/
deps.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
ext.versions = [
paging : '3.2.1',
nav : '2.7.4',
leak_canary : '2.12',
lifecycle : '2.5.0-alpha05',
arch : '2.1.0',
coordinator_layout : '1.2.0',
appsearch : '1.0.0-alpha04',
hilt : '2.48.1',
hilt_common : '1.0.0',
hilt_compiler : '1.0.0',
retrofit : '2.9.0',
room : '2.6.0',
core_ktx : '1.12.0',
appcompat : '1.7.0-alpha03',
material : '1.10.0',
constraintlayout : '2.1.4',
junit : '4.13.2',
androidx_junit : '1.2.0-alpha01',
espresso_core : '3.5.1',
annotation : '1.4.0',
glide : '4.16.0',
glide_okhttp : '4.16.0',
swipe_refresh_layout : '1.2.0-alpha01',
okhttp : '5.0.0-alpha.7',
okhttp_bom : '5.0.0-alpha.10',
okhttp_interceptor : '5.0.0-alpha.10',
gson_conveter : '2.9.0',
threetenbp : '1.6.8',
carouselrecyclerview : '1.2.5',
palette : '1.0.0',
sheets : '2.3.1',
search_lapism : '2.0.1',
iconics : '5.4.0',
iconics_fontawesome : '5.13.3.0-kotlin@aar',
work : '2.8.1',
work_hilt : '1.0.0',
multidex : '2.0.1',
recycler_view : '1.3.2',
livedata : '2.6.2',
preference : '1.2.1',
shimmer : '0.5.0',
media3 : '1.1.1',
materialpreference : '3.8.0',
ok2curl : '0.8.0',
compose_bom : '2023.09.00',
compose_activity : '1.8.0',
compose_lifecycle : '2.6.2',
compose_paging : '3.2.1',
compose_shimmer : '1.2.0',
compose_glide : '1.0.0-alpha.1',
compose_material3 : '1.2.0-alpha07',
compose_vector_animations: '1.6.0-alpha05',
compose_text_flow : '1.1.1',
kotlin_okhttp : '1.0',
datastore : '1.0.0',
// test
composeVersion : "1.1.1",
assertJ : "1.0.1",
assertJCore : '3.24.2',
mockwebserver : "5.0.0-alpha.10",
jupiter : '5.10.0',
]
// region automated versioning system
Properties props = new Properties()
/**
* will be created by github actions or
* add manually the following props to version.properties (git ignored)
* majorVersion=1
* minorVersion=0
* patchVersion=0
* buildNumber=
* */
def versionFile = project.rootProject.file('version.properties')
if (versionFile.exists()) {
props.load(versionFile.newDataInputStream())
props.each { prop ->
project.ext.set(prop.key, prop.value)
}
}
private static Integer getVersionCode(ext) {
int major = ext.majorVersion as Integer
int minor = ext.minorVersion as Integer
int patch = ext.patchVersion as Integer
def version = major * 10000 + minor * 100 + patch
println("app version code - ${version}")
return version
}
private static String getVersionName(ext) {
if (ext.buildNumber) {
return "${ext.majorVersion}.${ext.minorVersion}.${ext.patchVersion}.${ext.buildNumber}"
}
return "${ext.majorVersion}.${ext.minorVersion}.${ext.patchVersion}"
}
// endregion
ext.env = [
compileSdk : 34,
applicationId : 'com.otaku.fetch',
minSdk : 26,
targetSdk : 33,
versionCode : getVersionCode(ext),
versionName : getVersionName(ext),
testInstrumentationRunner: "com.otaku.kickassanime.KickassTestRunner",
]
def propertiesFile = project.rootProject.file('local.properties')
/*
* loading apk signing values securely,
* the values we are looking for are -
* KEY_PATH - key file path
* KEY_PASSWORD
* STORE_PASSWORD=redC@t33
* KEY_ALIAS
* if local props doesn't exists, we will assume this script is running on github action.
* */
if (propertiesFile.exists()) {
Properties properties = new Properties()
properties.load(propertiesFile.newDataInputStream())
// Looking in local props for signing. This pros file will be absent on github actions.
properties.each(prop -> {
System.properties.putIfAbsent(prop.key, prop.value)
})
} else {
// github actions will provide environment variables containing apk signing values.
System.getenv().each(prop -> {
System.properties.putIfAbsent(prop.key, prop.value)
})
}