Files
lawnchair/build.gradle

322 lines
10 KiB
Groovy
Raw Normal View History

buildscript {
2021-02-28 12:17:59 +01:00
ext {
2021-10-01 23:30:01 +07:00
kotlin_version = '1.5.30'
compose_version = '1.0.3'
2021-10-01 23:04:05 +07:00
accompanist_version = '0.19.0'
2021-06-15 20:26:41 +07:00
libsu_version = '3.1.2'
protocVersion = '3.18.0'
2021-02-28 12:17:59 +01:00
}
repositories {
mavenCentral()
google()
}
dependencies {
2021-10-01 23:04:05 +07:00
classpath 'com.android.tools.build:gradle:7.1.0-alpha12'
classpath PROTOBUF_CLASS_PATH
2021-02-28 12:17:59 +01:00
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
2021-04-24 14:12:14 +02:00
classpath 'com.google.android.gms:oss-licenses-plugin:0.10.4'
}
}
2021-02-28 02:55:46 +05:30
final String FRAMEWORK_PREBUILTS_DIR = "prebuilts"
final def keystorePropertiesFile = rootProject.file("keystore.properties")
2021-02-28 02:55:46 +05:30
2021-03-15 22:05:07 +01:00
wrapper {
2021-03-17 10:49:42 +01:00
gradleVersion = '6.8.3'
2021-03-15 22:05:07 +01:00
}
2021-02-28 02:55:46 +05:30
allprojects {
repositories {
google()
mavenCentral()
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'
2021-03-22 19:05:52 +01:00
apply plugin: 'com.google.android.gms.oss-licenses-plugin'
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
2021-03-26 08:17:34 +01:00
lintOptions {
checkReleaseBuilds false
}
defaultConfig {
minSdkVersion 25
2021-03-03 14:25:21 +01:00
targetSdkVersion 30
2021-08-26 15:14:37 +02:00
versionCode 7
2021-08-26 23:00:13 +07:00
def versionDisplayName = "11.0 Alpha 6.1"
def majorVersion = versionDisplayName.split("\\.")[0]
versionName "${versionDisplayName} (${commitHash()})"
buildConfigField "String", "VERSION_DISPLAY_NAME", "\"${versionDisplayName}\""
buildConfigField "String", "MAJOR_VERSION", "\"${majorVersion}\""
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
2021-03-03 14:25:21 +01:00
2021-03-17 10:29:38 +01:00
applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "Lawnchair ${variant.versionName}.apk"
}
}
2021-03-03 14:25:21 +01:00
buildFeatures {
compose true
}
composeOptions {
2021-10-01 23:30:01 +07:00
kotlinCompilerExtensionVersion = "1.0.3"
2021-03-03 14:25:21 +01:00
}
if (keystorePropertiesFile.exists()) {
final def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile rootProject.file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
}
buildTypes {
debug {
versionNameSuffix ".debug"
}
release {
if (keystorePropertiesFile.exists()) signingConfig signingConfigs.release
minifyEnabled true
shrinkResources true
versionNameSuffix ".release"
proguardFiles "proguard-android-optimize.txt", "proguard.flags"
}
}
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"
applicationId 'app.lawnchair'
testApplicationId 'com.android.launcher3.tests'
}
withQuickstep {
dimension "recents"
minSdkVersion 28
}
withoutQuickstep {
dimension "recents"
}
}
sourceSets {
main {
res.srcDirs = ['res']
java.srcDirs = ['src', 'src_plugins']
manifest.srcFile 'AndroidManifest-common.xml'
proto {
srcDirs = ['protos/', '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 {
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']
2021-03-19 03:38:39 +05:30
aidl.srcDirs = ['lawnchair/aidl']
res.srcDirs = ['lawnchair/res']
manifest.srcFile "lawnchair/AndroidManifest.xml"
2021-09-09 21:35:09 +07:00
assets {
srcDirs 'lawnchair/assets'
}
}
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()
}
}
dependencies {
implementation "androidx.dynamicanimation:dynamicanimation:${ANDROID_X_VERSION}"
implementation "androidx.recyclerview:recyclerview:${ANDROID_X_VERSION}"
implementation "androidx.preference:preference-ktx:${ANDROID_X_VERSION}"
implementation project(':IconLoader')
withQuickstepImplementation project(':SharedLibWrapper')
// Recents lib dependency
2021-06-03 10:55:06 +07:00
withQuickstepImplementation project(':SystemUIShared')
// 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'
2021-04-10 16:04:36 +02:00
androidTestImplementation 'org.mockito:mockito-core:3.9.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-02-28 02:55:46 +05:30
implementation 'com.github.ChickenHook:RestrictionBypass:2.2'
2021-07-03 18:56:30 +02:00
implementation 'com.google.android.material:material:1.4.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"
2021-08-05 01:51:32 +07:00
implementation 'androidx.activity:activity-compose:1.3.1'
2021-10-01 23:30:01 +07:00
implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.4.0-rc01'
implementation "androidx.compose.runtime:runtime-livedata:$compose_version"
implementation "androidx.compose.runtime:runtime-rxjava2:$compose_version"
implementation "androidx.compose.compiler:compiler:$compose_version"
2021-10-01 23:17:11 +07:00
implementation "androidx.navigation:navigation-compose:2.4.0-alpha10"
2021-08-05 10:14:44 +07:00
implementation "androidx.palette:palette-ktx:${ANDROID_X_VERSION}"
implementation "com.google.accompanist:accompanist-insets:$accompanist_version"
2021-08-05 20:41:40 +07:00
implementation "com.google.accompanist:accompanist-insets-ui:$accompanist_version"
2021-08-05 01:51:32 +07:00
implementation "com.google.accompanist:accompanist-navigation-animation:$accompanist_version"
implementation "com.google.accompanist:accompanist-placeholder-material:$accompanist_version"
implementation "com.google.accompanist:accompanist-systemuicontroller:$accompanist_version"
2021-08-05 01:51:32 +07:00
implementation "com.github.fornewid:material-motion-compose:0.6.1"
2021-08-05 00:59:06 +07:00
implementation "io.coil-kt:coil-compose:1.3.1"
2021-03-30 01:40:06 +05:30
implementation 'me.xdrop:fuzzywuzzy:1.3.1'
2021-06-15 20:26:41 +07:00
implementation "com.github.topjohnwu.libsu:core:$libsu_version"
implementation "com.github.topjohnwu.libsu:service:$libsu_version"
}
protobuf {
// Configure the protoc executable
protoc {
artifact = "com.google.protobuf:protoc:${protocVersion}"
}
generateProtoTasks {
all().each { task ->
task.builtins {
remove java
java {
option "lite"
}
}
}
}
}