Files
lawnchair/build.gradle

285 lines
8.9 KiB
Groovy
Raw Normal View History

buildscript {
2021-02-28 12:17:59 +01:00
ext {
kotlin_version = '1.4.31'
compose_version = '1.0.0-beta02'
2021-02-28 12:17:59 +01:00
}
repositories {
mavenCentral()
google()
jcenter()
}
dependencies {
2021-03-11 15:00:03 +01:00
classpath 'com.android.tools.build:gradle:7.0.0-alpha09'
classpath PROTOBUF_CLASS_PATH
2021-02-28 12:17:59 +01:00
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
2021-02-28 02:55:46 +05:30
final String FRAMEWORK_PREBUILTS_DIR = "prebuilts"
2021-03-15 22:05:07 +01:00
wrapper {
gradleVersion = '8.6.3'
}
2021-02-28 02:55:46 +05:30
allprojects {
repositories {
google()
mavenCentral()
jcenter()
maven { url 'https://jitpack.io' }
}
ext.addFrameworkJar = { String path ->
def frameworkJar = new File(rootProject.projectDir, 'prebuilts/libs/' + path)
if (!frameworkJar.exists()) {
throw new IllegalArgumentException("Framework jar path doesn't exist")
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.bootstrapClasspath = files([frameworkJar] + (options.bootstrapClasspath.files as Iterable<File>))
}
}
}
}
apply plugin: 'com.android.application'
2021-02-28 16:51:04 +05:30
apply plugin: 'kotlin-android'
apply plugin: 'com.google.protobuf'
final def commitHash = { ->
final def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', '--short=7', 'HEAD'
standardOutput = stdout
}
stdout.toString().trim()
}
android {
compileSdkVersion COMPILE_SDK
buildToolsVersion BUILD_TOOLS_VERSION
defaultConfig {
minSdkVersion 25
2021-03-03 14:25:21 +01:00
targetSdkVersion 30
versionCode 1
versionName "11.0-alpha.01+${commitHash()}"
setProperty("archivesBaseName", "Lawnchair-$versionName")
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
2021-03-03 14:25:21 +01:00
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion "1.0.0-beta02"
2021-03-03 14:25:21 +01:00
}
buildTypes {
debug {
minifyEnabled false
}
}
2021-02-28 16:51:04 +05:30
kotlinOptions {
jvmTarget = '1.8'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// 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 'com.android.launcher3'
testApplicationId 'com.android.launcher3.tests'
}
l3go {
dimension "app"
applicationId 'com.android.launcher3'
testApplicationId 'com.android.launcher3.tests'
}
lawn {
dimension "app"
2021-02-28 02:55:46 +05:30
applicationId 'ch.deletescape.lawnchair'
testApplicationId 'com.android.launcher3.tests'
}
withQuickstep {
dimension "recents"
minSdkVersion 28
}
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']
manifest.srcFile 'AndroidManifest-common.xml'
proto {
srcDir 'protos/'
srcDir 'proto_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 {
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"
}
lawn {
java.srcDirs = ['src_flags', 'src_shortcuts_overrides', 'lawnchair/src']
res.srcDirs = ['lawnchair/res']
manifest.srcFile "lawnchair/AndroidManifest.xml"
}
lawnWithoutQuickstep {
manifest.srcFile "AndroidManifest.xml"
}
lawnWithQuickstep {
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']
manifest.srcFile "quickstep/AndroidManifest.xml"
}
}
2021-02-28 02:55:46 +05:30
addFrameworkJar('framework.jar')
}
allprojects {
repositories {
maven { url "../../../prebuilts/sdk/current/androidx/m2repository" }
maven { url "../../../prebuilts/fullsdk-darwin/extras/android/m2repository" }
maven { url "../../../prebuilts/fullsdk-linux/extras/android/m2repository" }
mavenCentral()
google()
2021-03-01 12:37:21 +01:00
jcenter()
}
}
dependencies {
implementation "androidx.dynamicanimation:dynamicanimation:${ANDROID_X_VERSION}"
implementation "androidx.recyclerview:recyclerview:${ANDROID_X_VERSION}"
implementation "androidx.preference:preference:${ANDROID_X_VERSION}"
implementation project(':IconLoader')
withQuickstepImplementation project(':SharedLibWrapper')
implementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/libs", include: 'launcher_protos.jar')
2021-02-28 02:55:46 +05:30
implementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/libs", include: 'sysui_statslog.jar')
// Recents lib dependency
2021-02-28 02:55:46 +05:30
withQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/libs", include: 'sysui_shared.jar')
// Required for AOSP to compile. This is already included in the sysui_shared.jar
withoutQuickstepImplementation fileTree(dir: "${FRAMEWORK_PREBUILTS_DIR}/libs", include: 'plugin_core.jar')
2021-02-28 16:51:04 +05:30
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
2021-03-03 14:25:21 +01:00
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'org.mockito:mockito-core:3.8.0'
androidTestImplementation 'com.google.dexmaker:dexmaker:1.2'
androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:1.2'
2021-03-03 14:25:21 +01:00
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test:rules:1.0.2'
androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.3'
androidTestImplementation "androidx.annotation:annotation:${ANDROID_X_VERSION}"
2021-03-03 14:25:21 +01:00
implementation 'com.google.protobuf.nano:protobuf-javanano:3.2.0rc2'
2021-02-28 02:55:46 +05:30
implementation 'com.github.ChickenHook:RestrictionBypass:2.2'
2021-03-01 12:37:21 +01:00
implementation 'com.google.android.material:material:1.3.0'
2021-03-03 14:25:21 +01:00
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.ui:ui-tooling:$compose_version"
implementation "androidx.compose.foundation:foundation:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.material:material-icons-core:$compose_version"
implementation "androidx.compose.material:material-icons-extended:$compose_version"
implementation 'androidx.activity:activity-compose:1.3.0-alpha04'
implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:1.0.0-alpha03'
implementation "androidx.compose.runtime:runtime-livedata:$compose_version"
implementation "androidx.compose.runtime:runtime-rxjava2:$compose_version"
implementation "androidx.compose.compiler:compiler:$compose_version"
implementation "androidx.navigation:navigation-compose:1.0.0-alpha08"
}
protobuf {
// Configure the protoc executable
protoc {
artifact = 'com.google.protobuf:protoc:3.0.0'
generateProtoTasks {
all().each { task ->
task.builtins {
remove java
javanano {
option "java_package=launcher_log_extension.proto|com.android.launcher3.userevent.nano"
option "java_package=launcher_log.proto|com.android.launcher3.userevent.nano"
option "java_package=launcher_dump.proto|com.android.launcher3.model.nano"
option "enum_style=java"
}
}
}
}
}
}