-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathbuild.gradle
62 lines (57 loc) · 1.63 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
//https://developer.android.com/jetpack/androidx/releases/compose-kotlin
ext.kotlin_version = '1.8.10'
ext.kotlin_compiler_extension_version = '1.4.3'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins {
id 'com.android.application' version '7.4.1' apply false
id 'com.android.library' version '7.4.1' apply false
id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
def getVersionCode = { ->
try {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-list', '--first-parent', '--count', 'HEAD'
standardOutput = stdout
}
return Integer.parseInt(stdout.toString().trim())
} catch (ignored) {
return -1;
}
}
def getVersionName = { ->
try {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--tags', '--dirty'
standardOutput = stdout
}
def versionName = stdout.toString().trim()
if (versionName.startsWith("v")) {
return versionName.substring(1)
} else {
return versionName
}
} catch (ignored) {
return null;
}
}
ext {
gitVersionCode = getVersionCode()
gitVersionName = getVersionName()
APPLICATION_ID = "one.yufz.hmspush"
COMPILE_SDK = 34
MIN_SDK = 26
TARGET_SDK = 34
}