-
Notifications
You must be signed in to change notification settings - Fork 20
/
build.gradle
220 lines (193 loc) · 6.92 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
import com.android.build.gradle.LibraryPlugin
import com.android.build.gradle.api.AndroidBasePlugin
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id "com.android.application" version '8.1.2'
id "com.android.library" version '8.1.2' apply false
id "org.jetbrains.kotlin.android" version "1.9.10"
id "com.google.protobuf" version "0.9.1"
}
allprojects {
plugins.withType(AndroidBasePlugin).configureEach {
project.android {
compileSdk 34
defaultConfig {
minSdk 28
targetSdk 30
vectorDrawables.useSupportLibrary = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
lint {
abortOnError true
checkReleaseBuilds false
}
}
project.dependencies {
implementation 'androidx.core:core-ktx:1.12.0'
}
}
plugins.withType(LibraryPlugin).configureEach {
project.android {
publishing {
singleVariant("release") {
withSourcesJar()
withJavadocJar()
}
}
}
}
tasks.withType(KotlinCompile).configureEach {
compilerOptions.jvmTarget = JvmTarget.JVM_17
}
ext.addFrameworkJar = { String path ->
def frameworkJar = new File(rootProject.projectDir, 'prebuilt/' + path)
if (!frameworkJar.exists()) {
throw new IllegalArgumentException("Framework jar path doesn't exist")
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile).configureEach {
options.bootstrapClasspath = files(frameworkJar, options.bootstrapClasspath)
}
tasks.withType(KotlinCompile).configureEach {
libraries.setFrom(files(frameworkJar, libraries))
}
}
}
}
final def buildCommit = providers.exec {
commandLine("git", "describe", "--match=liu_wanshun", "--always", "--abbrev=8", "--dirty")
}.standardOutput.asText.get().trim()
android {
namespace "com.android.launcher3"
defaultConfig {
versionCode 1
//语义化版本:https://semver.org/lang/zh-CN/
versionName "14.0.1-alpha.1"
buildConfigField "boolean", "QSB_ON_FIRST_SCREEN", "false"
buildConfigField "boolean", "IS_STUDIO_BUILD", "true"
buildConfigField "boolean", "QSB_ON_HOTSEAT", "true"
}
buildFeatures {
buildConfig = true
}
android.applicationVariants.configureEach { variant ->
variant.outputs.configureEach {
outputFileName = "${rootProject.name}_${variant.versionName}+${buildCommit}.apk"
}
}
final def keystorePropertiesFile = rootProject.file("keystore.properties")
def releaseSigning = signingConfigs.debug
if (keystorePropertiesFile.exists()) {
final def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
releaseSigning = signingConfigs.create("release") {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile rootProject.file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
configureEach {
signingConfig releaseSigning
}
debug {
minifyEnabled false
buildConfigField "boolean", "IS_DEBUG_DEVICE", "true"
}
release {
minifyEnabled true
buildConfigField "boolean", "IS_DEBUG_DEVICE", "false"
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard.pro")
}
}
flavorDimensions += ["app", "recents"]
productFlavors {
chair {
dimension "app"
applicationId 'app.lws.launcherc'
testApplicationId 'com.android.launcher3.tests'
isDefault true
}
configureEach {
//resValue("string", "quickstep_component", "${applicationId}/com.android.launcher3.uioverrides.QuickstepLauncher")
resValue("string", "launcher_component", "${applicationId}/com.android.launcher3.Launcher")
}
withQuickstep {
dimension "recents"
minSdkVersion 28
}
withoutQuickstep {
dimension "recents"
isDefault true
}
}
sourceSets {
main {
res.srcDirs = ['res']
java.srcDirs = ['src', 'src_plugins', "tests/shared"]
manifest.srcFile 'AndroidManifest-common.xml'
proto {
srcDirs = ['protos/', 'quickstep/protos_overrides/']
}
}
chair {
java.srcDirs = ["src_flags", "src_shortcuts_overrides", "chair/src"]
res.srcDirs = ["chair/res", "chair/res_overrides"]
manifest.srcFile "chair/AndroidManifest.xml"
assets.srcDirs "chair/assets"
}
chairWithoutQuickstep {
manifest.srcFile "AndroidManifest.xml"
}
chairWithQuickstep {
manifest.srcFile "quickstep/AndroidManifest-launcher.xml"
java.srcDirs = ["chair/quickstep"]
}
withoutQuickstep {
java.srcDirs = ['src_ui_overrides']
}
withQuickstep {
res.srcDirs = ['quickstep/res', 'quickstep/recents_ui_overrides/res']
java.srcDirs = ['quickstep/src', 'quickstep/recents_ui_overrides/src']
manifest.srcFile "quickstep/AndroidManifest.xml"
}
}
//来源:AOSP中编译Launcher3模块,out/soong/.intermediates/frameworks/base/framework/android_common/turbine-combined/framework.jar
addFrameworkJar('framework-13.jar')
}
dependencies {
implementation libs.androidx.lifecycle.viewmodel
implementation libs.androidx.dynamicanimation
implementation libs.androidx.recyclerview.recyclerview
implementation libs.androidx.preference
implementation project(':iconloaderlib')
implementation("com.github.ChickenHook:RestrictionBypass:2.2")
implementation("com.github.liu-wanshun:launcherlib-plugincore:13-SNAPSHOT")
implementation fileTree(dir: "prebuilt", include: 'SystemUI-statsd.jar')
api libs.airbnb.lottie
implementation libs.google.protobuf.javalite
implementation libs.google.material
implementation libs.androidx.slice.view
implementation(libs.androidx.window)
}
protobuf {
// Configure the protoc executable
protoc {
artifact = "com.google.protobuf:protoc:3.21.12"
}
generateProtoTasks {
all().each { task ->
task.builtins {
remove java
java {
option "lite"
}
}
}
}
}