-
Notifications
You must be signed in to change notification settings - Fork 241
/
build.gradle
146 lines (123 loc) · 5.11 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
import luyao.dependencies.Deps
import luyao.dependencies.Versions
import java.text.SimpleDateFormat
plugins {
id 'dagger.hilt.android.plugin'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
android {
compileSdkVersion Versions.compileSdk
defaultConfig {
applicationId "luyao.wanandroid"
minSdkVersion Versions.minSdk
targetSdkVersion Versions.targetSdk
versionCode Versions.versionCode
versionName Versions.versionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11
}
ndk {
abiFilters 'arm64-v8a'
}
}
signingConfigs {
debug {
storeFile file(properties.getProperty("storeFile"))
storePassword properties.getProperty("storePassword")
keyAlias properties.getProperty("keyAlias")
keyPassword properties.getProperty("keyPassword")
}
release {
storeFile file(properties.getProperty("storeFile"))
storePassword properties.getProperty("storePassword")
keyAlias properties.getProperty("keyAlias")
keyPassword properties.getProperty("keyPassword")
}
}
buildTypes {
debug {
minifyEnabled false
zipAlignEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.debug
}
release {
minifyEnabled true
zipAlignEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
applicationVariants.all { variant ->
if (variant.buildType.name != "debug") {
variant.packageApplicationProvider.get().outputDirectory = rootProject.file("apk/${variant.flavorName}")
}
String time = new SimpleDateFormat("yyyyMMddHHmm", Locale.CHINA).format(new Date())
variant.outputs.each {
it.outputFileName = "Wandroid_${variant.flavorName}_${variant.versionName}_" + time + "_" + getGitBranch() + "_" + getGitSHA() + ".apk"
}
}
buildFeatures {
compose true
}
composeOptions {
// https://developer.android.com/jetpack/androidx/releases/compose-kotlin
kotlinCompilerExtensionVersion = "1.4.7"
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation Deps.appcompat
implementation Deps.retrofit
implementation Deps.retrofit_converter_gson
implementation Deps.okhttp_logging_interceptor
implementation Deps.persistentCookieJar
implementation Deps.licensesDialog
implementation Deps.material_dialogs_input
implementation "com.google.dagger:hilt-android:2.44.2"
kapt "com.google.dagger:hilt-compiler:2.44.2"
implementation 'com.tencent:mmkv-static:1.2.14'
// Compose
implementation 'androidx.activity:activity-compose:1.7.1'
implementation 'androidx.compose.material3:material3:1.0.1'
implementation 'androidx.compose.material:material:1.4.3'
implementation 'androidx.compose.animation:animation:1.4.3'
implementation 'androidx.compose.ui:ui-tooling:1.4.3'
implementation 'androidx.hilt:hilt-navigation-compose:1.0.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1'
androidTestImplementation 'androidx.compose.ui:ui-test-junit4:1.4.3'
implementation "com.google.android.material:compose-theme-adapter:1.2.1"
implementation "androidx.compose.runtime:runtime-livedata:1.4.3"
var accompanistVersion = "0.31.1-alpha"
implementation "com.google.accompanist:accompanist-systemuicontroller:$accompanistVersion"
implementation "com.google.accompanist:accompanist-themeadapter-material3:$accompanistVersion"
// implementation "com.google.accompanist:accompanist-navigation-animation:0.30.1"
// implementation "com.google.accompanist:accompanist-pager:0.30.1"
implementation "com.google.accompanist:accompanist-pager-indicators:$accompanistVersion"
// implementation "com.google.accompanist:accompanist-flowlayout:$accompanistVersion"
implementation "com.google.accompanist:accompanist-webview:$accompanistVersion"
implementation "androidx.navigation:navigation-compose:2.5.3"
implementation "androidx.constraintlayout:constraintlayout-compose:1.0.1"
implementation 'com.airbnb.android:lottie-compose:5.2.0'
implementation Deps.coil_compose
}
kapt {
correctErrorTypes = true
}
static def getGitBranch() {
return 'git symbolic-ref --short -q HEAD'.execute().text.trim()
}
static def getGitSHA() {
return 'git rev-parse --short HEAD'.execute().text.trim()
}