mirror of
https://github.com/alesimula/Murine-launcher.git
synced 2026-10-28 09:43:42 +00:00
317 lines
11 KiB
Groovy
317 lines
11 KiB
Groovy
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
|
|
buildscript {
|
|
dependencies {
|
|
classpath GRADLE_CLASS_PATH
|
|
classpath PROTOBUF_CLASS_PATH
|
|
classpath KOTLIN
|
|
}
|
|
}
|
|
|
|
plugins {
|
|
id "com.google.devtools.ksp" version "2.3.3"
|
|
}
|
|
|
|
final String ANDROID_TOP = "${rootDir}"
|
|
final String FRAMEWORK_PREBUILTS_DIR = "${ANDROID_TOP}/prebuilts/libs/"
|
|
|
|
apply plugin: 'com.android.application'
|
|
apply plugin: 'com.google.protobuf'
|
|
apply plugin: 'org.jetbrains.kotlin.android'
|
|
apply plugin: 'kotlin-kapt'
|
|
|
|
android {
|
|
compileSdkVersion COMPILE_SDK
|
|
|
|
namespace = 'com.android.launcher3'
|
|
|
|
defaultConfig {
|
|
minSdkVersion 33
|
|
targetSdkVersion 36
|
|
versionCode 1
|
|
versionName "1.0"
|
|
|
|
buildConfigField "boolean", "IS_STUDIO_BUILD", "false"
|
|
buildConfigField "boolean", "QSB_ON_FIRST_SCREEN", "true"
|
|
buildConfigField "boolean", "IS_DEBUG_DEVICE", "false"
|
|
buildConfigField "boolean", "WIDGET_ON_FIRST_SCREEN", "true"
|
|
buildConfigField "boolean", "WIDGETS_ENABLED", "true"
|
|
buildConfigField "boolean", "NOTIFICATION_DOTS_ENABLED", "true"
|
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
vectorDrawables.useSupportLibrary = true
|
|
}
|
|
buildTypes {
|
|
debug {
|
|
minifyEnabled false
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_21
|
|
targetCompatibility JavaVersion.VERSION_21
|
|
}
|
|
|
|
// The flavor dimensions for build variants (e.g. aospWithQuickstep, aospWithoutQuickstep)
|
|
// See: https://developer.android.com/studio/build/build-variants#flavor-dimensions
|
|
flavorDimensions "app", "recents"
|
|
|
|
productFlavors {
|
|
aosp {
|
|
dimension "app"
|
|
applicationId 'app.murinelauncher'
|
|
testApplicationId 'com.android.launcher3.tests'
|
|
}
|
|
|
|
l3go {
|
|
dimension "app"
|
|
applicationId 'app.murinelauncher'
|
|
testApplicationId 'com.android.launcher3.tests'
|
|
}
|
|
|
|
withQuickstep {
|
|
dimension "recents"
|
|
|
|
minSdkVersion 33
|
|
}
|
|
|
|
withoutQuickstep {
|
|
dimension "recents"
|
|
}
|
|
}
|
|
|
|
// Disable release builds for now
|
|
android.variantFilter { variant ->
|
|
if (variant.buildType.name.endsWith('release')) {
|
|
variant.setIgnore(true)
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
res.srcDirs = ['res']
|
|
java.srcDirs = ['src', 'src_plugins', 'tests/shared', 'system_ext', 'tests/multivalentTests/shared', 'systemui_core/shared', 'shared/src']
|
|
manifest.srcFile 'AndroidManifest-common.xml'
|
|
proto {
|
|
srcDirs = ['protos/', 'quickstep/protos_overrides/']
|
|
}
|
|
}
|
|
|
|
//androidTest {
|
|
// res.srcDirs = ['tests/res']
|
|
// java.srcDirs = ['tests/src', 'tests/tapl']
|
|
// manifest.srcFile "tests/AndroidManifest-common.xml"
|
|
//}
|
|
//
|
|
//androidTestDebug {
|
|
// manifest.srcFile "tests/AndroidManifest.xml"
|
|
//}
|
|
|
|
aosp {
|
|
java.srcDirs = ['src_flags', 'src_shortcuts_overrides']
|
|
}
|
|
|
|
aospWithoutQuickstep {
|
|
java.srcDirs = ['src_no_quickstep']
|
|
manifest.srcFile "AndroidManifest.xml"
|
|
}
|
|
|
|
aospWithQuickstep {
|
|
manifest.srcFile "quickstep/AndroidManifest-launcher.xml"
|
|
}
|
|
|
|
l3go {
|
|
res.srcDirs = ['go/res']
|
|
java.srcDirs = ['go/src']
|
|
manifest.srcFile "go/AndroidManifest.xml"
|
|
}
|
|
|
|
l3goWithoutQuickstepDebug {
|
|
manifest.srcFile "AndroidManifest.xml"
|
|
}
|
|
|
|
l3goWithQuickstepDebug {
|
|
manifest.srcFile "quickstep/AndroidManifest-launcher.xml"
|
|
}
|
|
|
|
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', 'quickstep/src_protolog', 'quickstep/dagger']
|
|
manifest.srcFile "quickstep/AndroidManifest.xml"
|
|
}
|
|
}
|
|
kotlinOptions {
|
|
jvmTarget = '21'
|
|
}
|
|
|
|
buildFeatures {
|
|
buildConfig = true
|
|
}
|
|
|
|
}
|
|
|
|
// 启用增量注解处理(提升编译速度)
|
|
kapt {
|
|
useBuildCache = true
|
|
correctErrorTypes = true
|
|
javacOptions {
|
|
// option("-Xmaxerrs", 1000)
|
|
}
|
|
}
|
|
|
|
allprojects {
|
|
ext {
|
|
daggerVersion = '2.56.2'
|
|
def addFrameworkJarInternal = { Project proj, String name ->
|
|
def frameworkJar = new File(FRAMEWORK_PREBUILTS_DIR, name)
|
|
if (!frameworkJar.exists()) {
|
|
return
|
|
}
|
|
proj.dependencies {
|
|
compileOnly proj.files(frameworkJar)
|
|
}
|
|
proj.gradle.projectsEvaluated {
|
|
proj.tasks.withType(JavaCompile).configureEach {
|
|
classpath = proj.files(frameworkJar) + classpath
|
|
}
|
|
proj.tasks.withType(KotlinCompile).configureEach {
|
|
// Prepend framework jar to the Kotlin compilation classpath
|
|
libraries.setFrom(proj.files(frameworkJar) + libraries.getFrom())
|
|
}
|
|
}
|
|
}
|
|
|
|
afterEvaluate { proj ->
|
|
if (proj.plugins.hasPlugin('com.android.application') || proj.plugins.hasPlugin('com.android.library')) {
|
|
addFrameworkJarInternal(proj, 'framework-16.jar')
|
|
|
|
proj.dependencies {
|
|
// Apply all shared prebuilt jars to every module
|
|
// Use compileOnly to avoid desugaring/R8 errors with framework stubs
|
|
compileOnly proj.fileTree(dir: FRAMEWORK_PREBUILTS_DIR, include: ['*.jar'], exclude: ['framework-16.jar'])
|
|
|
|
// Common androidx/libs available everywhere
|
|
implementation libs.androidx.core.ktx
|
|
implementation libs.annotation
|
|
implementation libs.kotlinx.coroutines
|
|
}
|
|
}
|
|
}
|
|
|
|
compileOnlyCommonJars = {
|
|
dependencies {
|
|
compileOnly fileTree(dir: FRAMEWORK_PREBUILTS_DIR, include: 'SystemUI-core-16.jar')
|
|
compileOnly fileTree(dir: FRAMEWORK_PREBUILTS_DIR, include: 'SystemUI-statsd-16.jar')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation libs.androidx.appcompat
|
|
implementation libs.androidx.core.ktx
|
|
implementation libs.androidx.recyclerview
|
|
implementation libs.androidx.dynamicanimation
|
|
implementation libs.androidx.preference
|
|
implementation libs.androidx.slice.builders
|
|
implementation libs.androidx.graphics.shapes
|
|
implementation libs.androidx.window
|
|
implementation libs.androidx.core.animation
|
|
implementation libs.androidx.material3
|
|
implementation libs.material
|
|
implementation libs.kotlinx.coroutines
|
|
|
|
implementation libs.protobuf.javalite
|
|
|
|
api libs.lottie
|
|
implementation libs.dagger
|
|
kapt libs.dagger.compiler
|
|
|
|
testImplementation libs.junit
|
|
androidTestImplementation libs.mockito.core
|
|
androidTestImplementation libs.dexmaker
|
|
androidTestImplementation libs.dexmaker.mockito
|
|
androidTestImplementation libs.runner
|
|
androidTestImplementation libs.rules
|
|
androidTestImplementation libs.uiautomator.v18
|
|
androidTestImplementation libs.annotation
|
|
}
|
|
|
|
dependencies {
|
|
implementation project(':IconLoader')
|
|
implementation project(':Animation')
|
|
implementation project(':Shared')
|
|
implementation project(':msdl')
|
|
implementation project(':flags')
|
|
implementation project(':WMShared')
|
|
}
|
|
|
|
dependencies {
|
|
// Recents lib dependency
|
|
withQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}", include: 'sysui_shared.jar')
|
|
// Required for AOSP to compile. This is already included in the sysui_shared.jar
|
|
withoutQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}", include: 'plugin_core.jar')
|
|
|
|
l3goImplementation files('prebuilts/libs/libandroid_browser_helper.jar')
|
|
// withQuickstepImplementation files('prebuilts/libs/SettingsLibCollapsingToolbarBaseActivity.jar')
|
|
withQuickstepImplementation files('prebuilts/libs/SystemUISharedLib.jar')
|
|
withQuickstepImplementation files('prebuilts/libs/SystemUISharedLib_kotlin.jar')
|
|
withQuickstepImplementation files('prebuilts/libs/SystemUI-shared-utils_kotlin.jar')
|
|
withQuickstepImplementation files('prebuilts/libs/SystemUIUnfoldLib.jar')
|
|
withQuickstepImplementation files('prebuilts/libs/SystemUIUnfoldLib_kotlin.jar')
|
|
implementation files('prebuilts/libs/SystemUI-statsd.jar')
|
|
withQuickstepImplementation files('prebuilts/libs/contextualeducationlib.jar')
|
|
// withQuickstepImplementation files('prebuilts/libs/com_android_wm_shell_flags.jar')
|
|
withQuickstepImplementation files('prebuilts/libs/WindowManager-Shell-shared.jar')
|
|
withQuickstepImplementation files('prebuilts/libs/WindowManager-Shell-shared_kotlin.jar')
|
|
// withQuickstepImplementation files('prebuilts/libs/com_android_systemui_shared_flags.jar')
|
|
// withQuickstepImplementation files('prebuilts/libs/com_android_systemui_flags.jar')
|
|
implementation files('prebuilts/libs/am_flags_lib.jar')
|
|
implementation files('prebuilts/libs/com_android_window_flags.jar')
|
|
implementation files('prebuilts/libs/com_android_systemui_flags.jar')
|
|
implementation files('prebuilts/libs/com_android_systemui_shared_flags.jar')
|
|
implementation files('prebuilts/libs/com_android_wm_shell_flags.jar')
|
|
implementation files('prebuilts/libs/PlatformAnimationLib.jar')
|
|
implementation files('prebuilts/libs/PlatformAnimationLib_kotlin.jar')
|
|
implementation files('prebuilts/libs/PluginAnnotationLib.jar')
|
|
implementation files('prebuilts/libs/PluginAnnotationLib_kotlin.jar')
|
|
implementation files('prebuilts/libs/PluginCoreLib.jar')
|
|
implementation files('prebuilts/libs/PluginCoreLib_kotlin.jar')
|
|
withQuickstepImplementation files('prebuilts/libs/com_android_window_flags.jar')
|
|
implementation files('prebuilts/libs/view_capture_proto.jar')
|
|
// implementation files('prebuilts/libs/tracinglib-platform.jar')
|
|
implementation files('prebuilts/libs/tracinglib-platform.jar')
|
|
implementation files('prebuilts/libs/view_capture.jar')
|
|
implementation files('prebuilts/libs/view_capture_kotlin.jar')
|
|
releaseImplementation files('prebuilts/libs/aconfig-annotations-lib.jar')
|
|
compileOnly files('prebuilts/libs/framework-16.jar')
|
|
}
|
|
|
|
def protocVersion = '4.33.1'//'3.8.0'
|
|
|
|
protobuf {
|
|
// Configure the protoc executable
|
|
protoc {
|
|
if (osdetector.os == "osx") {
|
|
artifact = "com.google.protobuf:protoc:${protocVersion}:osx-x86_64"
|
|
} else {
|
|
// artifact = "com.google.protobuf:protoc:${protocVersion}${PROTO_ARCH_SUFFIX}"
|
|
artifact = "com.google.protobuf:protoc:${protocVersion}"
|
|
}
|
|
}
|
|
generateProtoTasks {
|
|
all().each { task ->
|
|
task.builtins {
|
|
remove java
|
|
java {
|
|
option "lite"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|