forked from isaac-udy/Enro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
92 lines (81 loc) · 2.42 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
buildscript {
repositories {
mavenLocal()
google()
mavenCentral()
}
dependencies {
classpath deps.android.gradle
classpath deps.kotlin.gradle
classpath deps.hilt.gradle
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0'
}
}
allprojects {
repositories {
mavenLocal()
google()
mavenCentral()
}
}
subprojects {
apply from: "$rootDir/common.gradle"
apply from: "$rootDir/common_publish.gradle"
}
task clean(type: Delete) {
delete rootProject.buildDir
}
task updateVersion {
doLast {
if (!project.hasProperty("versionName")) {
throw new IllegalStateException("The updateVersion task requires a versionName property to be passed as an argument")
}
def versionPropertiesFile = rootProject.file("version.properties")
def existingProperties = new Properties()
existingProperties.load(new FileInputStream(versionPropertiesFile))
def versionName = project.getProperties().get("versionName")
def versionCode = (existingProperties.versionCode as int) + 1
if(versionName == existingProperties.versionName) {
throw new IllegalStateException("The versionName '$versionName' is the current versionName")
}
versionPropertiesFile.write("versionName=$versionName\nversionCode=$versionCode")
}
}
task disableConnectedDeviceAnimations {
doLast {
exec {
commandLine(
"adb", "shell", "\"settings put global window_animation_scale 0.00\""
)
}
exec {
commandLine(
"adb", "shell", "\"settings put global transition_animation_scale 0.00\""
)
}
exec {
commandLine(
"adb", "shell", "\"settings put global animator_duration_scale 0.00\""
)
}
}
}
task enableConnectedDeviceAnimations {
doLast {
exec {
commandLine(
"adb", "shell", "\"settings put global window_animation_scale 1.00\""
)
}
exec {
commandLine(
"adb", "shell", "\"settings put global transition_animation_scale 1.00\""
)
}
exec {
commandLine(
"adb", "shell", "\"settings put global animator_duration_scale 1.00\""
)
}
}
}