mirror of
https://github.com/alesimula/Murine-launcher.git
synced 2026-10-28 09:43:42 +00:00
442 lines
17 KiB
Groovy
442 lines
17 KiB
Groovy
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
|
|
buildscript {
|
|
dependencies {
|
|
classpath PROTOBUF_CLASS_PATH
|
|
classpath KOTLIN
|
|
}
|
|
}
|
|
|
|
plugins {
|
|
alias(libs.plugins.android.application)
|
|
alias(libs.plugins.rikka.refine)
|
|
alias(libs.plugins.google.ksp)
|
|
}
|
|
|
|
final String ANDROID_TOP = "${rootDir}"
|
|
// Old 'prebuilts', nor used anymore, stashed to: https://github.com/alesimula/old-resources-m-launcher
|
|
final String FRAMEWORK_PREBUILTS_DIR = "${ANDROID_TOP}/prebuilts/libs/"
|
|
|
|
// ------------------ Framework stub dependency pipeline ------------------
|
|
// Framework stubs retrieved from Jitpack in order to prepend them to the classpath
|
|
|
|
ext.resolveJitpackStub = { String version ->
|
|
def config = project.configurations.detachedConfiguration(
|
|
project.dependencies.create("com.github.alesimula:android-framework-stubs:${version}")
|
|
)
|
|
config.transitive = false
|
|
return project.files(config.resolve())
|
|
}
|
|
|
|
// Register framework stubs for all supported versions
|
|
def frameworkStubs10 = resolveJitpackStub('10-r1')
|
|
def frameworkStubs11 = resolveJitpackStub('11-r1')
|
|
def frameworkStubs12 = resolveJitpackStub('12-r1')
|
|
def frameworkStubs13 = resolveJitpackStub('13-r1')
|
|
def frameworkStubs14 = resolveJitpackStub('14-r1')
|
|
def frameworkStubs15 = resolveJitpackStub('15-r1')
|
|
def frameworkStubs16 = resolveJitpackStub('16-r2')
|
|
def frameworkStubs17 = resolveJitpackStub('17-r2')
|
|
|
|
apply plugin: 'com.google.protobuf'
|
|
// Keep the launcher icons' anydpi-v26 versioned so pre-Oreo lookups ("force legacy icons") get the legacy icon
|
|
apply from: 'gradle/legacy-icon.gradle'
|
|
|
|
android {
|
|
def (sdkMajor, sdkMinor) = COMPILE_SDK.tokenize('.')
|
|
compileSdk {
|
|
version = sdkMinor ? release(sdkMajor as int) { it.minorApiLevel = sdkMinor as int } : release(sdkMajor as int)
|
|
}
|
|
|
|
namespace = 'com.android.launcher3'
|
|
|
|
defaultConfig {
|
|
minSdk = 26
|
|
targetSdk = 37
|
|
versionCode 10205
|
|
versionName "1.2.5"
|
|
|
|
buildConfigField "boolean", "IS_STUDIO_BUILD", "false"
|
|
buildConfigField "boolean", "QSB_ON_FIRST_SCREEN", "false"
|
|
buildConfigField "boolean", "IS_DEBUG_DEVICE", "false"
|
|
buildConfigField "boolean", "WIDGET_ON_FIRST_SCREEN", "true"
|
|
buildConfigField "boolean", "WIDGETS_ENABLED", "true"
|
|
buildConfigField "boolean", "NOTIFICATION_DOTS_ENABLED", "true"
|
|
buildConfigField "boolean", "ANIMATE_ALL_APPS_SEARCH", "false"
|
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
vectorDrawables.useSupportLibrary = true
|
|
}
|
|
|
|
def proguardFilesFromAosp = allprojects
|
|
.collect { it.file("proguard.flags") }
|
|
.findAll { it.exists() }
|
|
.toArray()
|
|
|
|
buildTypes {
|
|
debug {
|
|
applicationIdSuffix ".debug"
|
|
debuggable true
|
|
minifyEnabled false
|
|
}
|
|
|
|
release {
|
|
debuggable false
|
|
minifyEnabled true
|
|
shrinkResources = true
|
|
pseudoLocalesEnabled = false
|
|
proguardFiles proguardFilesFromAosp + "proguard.pro"
|
|
optimization {
|
|
enable = true
|
|
keepRules {
|
|
includeDefault = false // Do not include default proguard: AOSP flags + proguard.pro already cover the platform
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
dependenciesInfo {
|
|
// Disables dependency metadata when building APKs (for IzzyOnDroid/F-Droid)
|
|
includeInApk = false
|
|
// Disables dependency metadata when building Android App Bundles (for Google Play)
|
|
includeInBundle = 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"
|
|
|
|
minSdk = 33
|
|
}
|
|
|
|
withoutQuickstep {
|
|
dimension "recents"
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
// Debug-only resource overrides (e.g. the launcher icon colors), merged over res/
|
|
debug {
|
|
res.srcDirs = ['res_debug']
|
|
}
|
|
|
|
main {
|
|
res.srcDirs = ['res']
|
|
java.srcDirs = ['src', 'src_plugins' /*, 'tests/shared', 'system_ext', 'tests/multivalentTests/shared', 'systemui_core/shared'*/]
|
|
kotlin.directories.addAll(['src', 'src_plugins' /*, 'tests/shared', 'system_ext', 'tests/multivalentTests/shared', 'systemui_core/shared'*/])
|
|
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']
|
|
kotlin.directories.addAll([/*'src_flags',*/ 'src_shortcuts_overrides'])
|
|
}
|
|
|
|
aospWithoutQuickstep {
|
|
java.srcDirs = ['src_no_quickstep']
|
|
kotlin.directories.addAll(['src_no_quickstep'])
|
|
manifest.srcFile "AndroidManifest.xml"
|
|
}
|
|
|
|
aospWithQuickstep {
|
|
manifest.srcFile "quickstep/AndroidManifest-launcher.xml"
|
|
}
|
|
|
|
l3go {
|
|
res.srcDirs = ['go/res']
|
|
java.srcDirs = ['go/src']
|
|
kotlin.directories.addAll(['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']
|
|
kotlin.directories.addAll(['quickstep/src', 'quickstep/recents_ui_overrides/src', 'quickstep/src_protolog', 'quickstep/dagger'])
|
|
manifest.srcFile "quickstep/AndroidManifest.xml"
|
|
}
|
|
}
|
|
buildFeatures {
|
|
buildConfig = true
|
|
}
|
|
|
|
androidResources {
|
|
additionalParameters '--no-xml-namespaces'
|
|
}
|
|
|
|
packaging {
|
|
resources {
|
|
// Dead weight at runtime, ~53 KB of APK
|
|
excludes += ['**/*.proto', 'META-INF/*.version', 'META-INF/**/*.kotlin_module',
|
|
'kotlin/**', 'DebugProbesKt.bin']
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
allprojects {
|
|
ext {
|
|
daggerVersion = '2.56.2'
|
|
/*addFrameworkJarInternal = { Project proj, String name ->
|
|
def frameworkJar = new File(FRAMEWORK_PREBUILTS_DIR, name)
|
|
if (!frameworkJar.exists()) {
|
|
throw new IllegalArgumentException("Framework jar path ${frameworkJar.path} doesn't exist")
|
|
}
|
|
proj.dependencies {
|
|
compileOnly proj.files(frameworkJar)
|
|
}
|
|
proj.gradle.projectsEvaluated {
|
|
proj.tasks.withType(JavaCompile).configureEach {
|
|
classpath = proj.files(frameworkJar, classpath)
|
|
}
|
|
proj.tasks.withType(KotlinCompile).configureEach {
|
|
libraries.setFrom proj.files(frameworkJar, libraries)
|
|
}
|
|
}
|
|
}*/
|
|
|
|
// Prepend a framework stub jar to the compile classpath.
|
|
// excludePrefix filters JavaCompile tasks to avoid circular deps.
|
|
addFrameworkStubsInternal = { Project proj, String excludePrefix, def stubsConfig ->
|
|
proj.dependencies {
|
|
compileOnly proj.files(stubsConfig)
|
|
}
|
|
proj.gradle.projectsEvaluated {
|
|
proj.tasks.withType(JavaCompile).configureEach { task ->
|
|
if (!task.name.startsWith(excludePrefix)) {
|
|
classpath = proj.files(stubsConfig, classpath)
|
|
}
|
|
}
|
|
proj.tasks.withType(KotlinCompile).configureEach {
|
|
libraries.setFrom proj.files(stubsConfig, libraries)
|
|
}
|
|
}
|
|
}
|
|
|
|
afterEvaluate { proj ->
|
|
if (proj.plugins.hasPlugin('com.android.application') || proj.plugins.hasPlugin('com.android.library')) {
|
|
|
|
// Use different framework stubs versions for compat libs
|
|
def compatLibStubsMap = [
|
|
"" : frameworkStubs16,
|
|
Baklava : frameworkStubs16,
|
|
Q : frameworkStubs10,
|
|
R : frameworkStubs11,
|
|
S : frameworkStubs12,
|
|
T : frameworkStubs13,
|
|
U : frameworkStubs14,
|
|
V : frameworkStubs15,
|
|
]
|
|
// Use different framework stubs versions for different subprojects
|
|
def pinnedStubs = [
|
|
wm_shared: frameworkStubs16
|
|
]
|
|
|
|
def m = proj.name =~ /^compatLibV?(.*)$/
|
|
def stubs = pinnedStubs.get(proj.name, frameworkStubs17) // Default framework stub used for main project
|
|
if (m.matches()) stubs = compatLibStubsMap.get(m[0][1], frameworkStubs16)
|
|
addFrameworkStubsInternal(proj, "compileFrameworkStubs", stubs)
|
|
|
|
|
|
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-*.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')
|
|
|
|
// Always declare as dependencies regardless
|
|
compileOnly project(':compatLib')
|
|
compileOnly project(':compatLib:compatLibVQ')
|
|
compileOnly project(':compatLib:compatLibVR')
|
|
compileOnly project(':compatLib:compatLibVS')
|
|
compileOnly project(':compatLib:compatLibVT')
|
|
compileOnly project(':compatLib:compatLibVU')
|
|
compileOnly project(':compatLib:compatLibVV')
|
|
compileOnly project(':compatLib:compatLibVBaklava')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
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
|
|
// Unused, and it would drag in graphics-path with its native libandroidx.graphics.path.so
|
|
//implementation libs.androidx.material3
|
|
implementation libs.androidx.tracing
|
|
implementation libs.androidx.palette.ktx
|
|
implementation libs.material
|
|
implementation libs.kotlinx.coroutines
|
|
|
|
implementation libs.protobuf.javalite
|
|
implementation libs.lsposed.hiddenapibypass
|
|
//implementation libs.chickenhook.restrictionbypass
|
|
implementation libs.rikka.refine.runtime
|
|
|
|
//implementation libs.intuit.sdp
|
|
implementation 'com.github.alesimula:murine-sdp:1.1.3' // fork of com.intuit.sdp, @fraction/_008sdp
|
|
|
|
// Use the crash recovery library even for release (it's negligibly light)
|
|
implementation 'com.github.alesimula.Recovery:recovery:1.0.7' // injected in LauncherApplication.java
|
|
implementation 'com.github.alesimula:murine-aircompressor:2.0.16'
|
|
|
|
withQuickstepApi libs.lottie
|
|
implementation libs.dagger
|
|
ksp 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(':iconloaderlib')
|
|
implementation project(':animationlib')
|
|
implementation project(':shared')
|
|
implementation project(':msdllib')
|
|
implementation project(':flagslib')
|
|
implementation project(':wm_shared')
|
|
implementation project(':SettingsLib:SettingsTheme')
|
|
implementation project(':SettingsLib:Widgets') // All SettingsLib widget preferences in one library
|
|
withQuickstepCompileOnly project(':hidden-api')
|
|
|
|
// Include all compat libs
|
|
implementation project(':compatLib')
|
|
implementation project(':compatLib:compatLibVQ')
|
|
implementation project(':compatLib:compatLibVR')
|
|
implementation project(':compatLib:compatLibVS')
|
|
implementation project(':compatLib:compatLibVT')
|
|
implementation project(':compatLib:compatLibVU')
|
|
implementation project(':compatLib:compatLibVV')
|
|
implementation project(':compatLib:compatLibVBaklava')
|
|
|
|
implementation project(':systemUIPluginCore')
|
|
}
|
|
|
|
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') // Removed direct usage
|
|
withQuickstepImplementation files('prebuilts/libs/contextualeducationlib.jar')
|
|
withQuickstepImplementation files('prebuilts/libs/WindowManager-Shell-shared.jar')
|
|
withQuickstepImplementation files('prebuilts/libs/WindowManager-Shell-shared_kotlin.jar')
|
|
|
|
// Commented unnecessary dependancies, or replaced with withQuickstepImplementation
|
|
withQuickstepImplementation files('prebuilts/libs/am_flags_lib.jar') // only used in quickstep
|
|
withQuickstepImplementation files('prebuilts/libs/PlatformAnimationLib.jar') // only used in quickstep
|
|
withQuickstepImplementation files('prebuilts/libs/PlatformAnimationLib_kotlin.jar') // possibly used, but only in quickstep
|
|
//implementation files('prebuilts/libs/PluginAnnotationLib.jar') // part of [systemUIPluginCore]
|
|
//implementation files('prebuilts/libs/PluginAnnotationLib_kotlin.jar') // Not used
|
|
//implementation files('prebuilts/libs/PluginCoreLib.jar') // added decompiled stubs as dep [systemUIPluginCore]
|
|
//implementation files('prebuilts/libs/PluginCoreLib_kotlin.jar') // Not used
|
|
//implementation files('prebuilts/libs/view_capture_proto.jar') // Not used
|
|
//implementation files('prebuilts/libs/tracinglib-platform.jar') // Not used
|
|
//implementation files('prebuilts/libs/view_capture.jar') // Not used
|
|
//implementation files('prebuilts/libs/view_capture_kotlin.jar') // Not used
|
|
//releaseImplementation files('prebuilts/libs/aconfig-annotations-lib.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"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|